diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 386253bb60..3d2c6295f8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -37,6 +37,7 @@ RUN apt-get update \ valgrind \ docker.io \ iputils-ping \ + icecc \ && : RUN groupadd -g $USER_GID $USERNAME \ @@ -80,3 +81,13 @@ ENV TIZEN_ROOTFS /tizen_rootfs # Fast Model GDB plugins path for debugging support ENV FAST_MODEL_PLUGINS_PATH /opt/FastModelsPortfolio_11.16/plugins/Linux64_GCC-9.3 + +# Set up ccache as a pigweed command launcher when using the scripts/build/build_examples.py +# script. Also, set up icecc as the command prefix for ccache. Such setup allows to benefit +# from compilation caching and distributed compilation at the same time. +# +# NOTE: In order to use distributed compilation with icecc, one should run +# "scripts/icecc.sh start" before starting the build. +ENV CHIP_PW_COMMAND_LAUNCHER ccache +ENV CCACHE_PREFIX icecc +ENV PATH /usr/lib/ccache:$PATH diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 5c24cdec82..f3954d1eb8 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1006,6 +1006,7 @@ OpenThreadDemo openweave OperationalCredentials operationalDataset +operationalstate opkg OPTIGA optionMask diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f14a16f5e0..af102bf96e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -157,6 +157,9 @@ jobs: run: echo "$CONCURRENCY_CONTEXT" - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 2 + persist-credentials: true - name: Try to ensure the directories for core dumping exist and we can write them. run: | @@ -186,6 +189,10 @@ jobs: - name: Clean output run: rm -rf ./out - name: Run Tests with sanitizers + # Sanitizer tests are not likely to find extra issues so running the same tests + # as above repeatedly on every pull request seems extra time. Instead keep this run + # for master only + if: github.event.pull_request.number == null env: LSAN_OPTIONS: detect_leaks=1 run: | @@ -201,17 +208,34 @@ jobs: BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh done + - name: Generate tests with sanitizers (for tidy) + if: github.event.pull_request.number != null + run: | + rm -rf ./out/sanitizers + BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="is_clang=true is_asan=true chip_data_model_check_die_on_failure=true" --export-compile-commands - name: Ensure codegen is done for sanitize run: | ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/sanitizers" + - name: Find changed files + id: changed-files + uses: tj-actions/changed-files@v45 - name: Clang-tidy validation # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. # See https://github.com/llvm/llvm-project/issues/97426 + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | + touch out/changed_files.txt + for file in ${ALL_CHANGED_FILES}; do + echo "$file changed and will be considered for tidy" + echo "$file" >>out/changed_files.txt + done + ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ --compile-database out/sanitizers/compile_commands.json \ --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|-ReadImpl|-InvokeSubscribeImpl|CodegenDataModel_Write|QuieterReporting' \ + --file-list-file out/changed_files.txt \ check \ " - name: Clean output @@ -375,13 +399,16 @@ jobs: scripts/build_python_device.sh --chip_detail_logging true build_darwin: - name: Build on Darwin (clang, python_lib, simulated) + name: Build on Darwin (clang, simulated) runs-on: macos-13 if: github.actor != 'restyled-io[bot]' steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 2 + persist-credentials: true - name: Checkout submodules & Bootstrap uses: ./.github/actions/checkout-submodules-and-bootstrap with: @@ -402,37 +429,42 @@ jobs: CHIP_ROOT_PATH=examples/placeholder/linux CHIP_ROOT_PATH="$CHIP_ROOT_PATH" BUILD_TYPE="$BUILD_TYPE" scripts/build/gn_gen.sh --args="$GN_ARGS" scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - - name: Setup Build, Run Build and Run Tests + - name: Setup Build, Run Build and Run Tests (asan + target_os=all) # We can't enable leak checking here in LSAN_OPTIONS, because on # Darwin that's only supported with a new enough clang, and we're # not building with the pigweed clang here. + env: + BUILD_TYPE: default run: | - for BUILD_TYPE in default python_lib; do - case $BUILD_TYPE in - # We want to build various standalone example apps - # (similar to what examples-linux-standalone.yaml - # does), so use target_os="all" to get those picked - # up as part of the "unified" build. But then to - # save CI resources we want to exclude the - # "host clang" build, which uses the pigweed - # clang. - "default") GN_ARGS='target_os="all" is_asan=true enable_host_clang_build=false';; - esac - BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS chip_data_model_check_die_on_failure=true" --export-compile-commands - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh - done - - name: Ensure codegen is done for sanitize + # We want to build various standalone example apps (similar to what examples-linux-standalone.yaml + # does), so use target_os="all" to get those picked up as part of the "unified" build. But then + # to save CI resources we want to exclude the "host clang" build, which uses the pigweed clang. + scripts/build/gn_gen.sh --args='target_os="all" is_asan=true enable_host_clang_build=false chip_data_model_check_die_on_failure=true' --export-compile-commands + scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" + scripts/tests/gn_tests.sh + - name: Ensure codegen is done for default run: | ./scripts/run_in_build_env.sh "./scripts/run_codegen_targets.sh out/default" + - name: Find changed files + id: changed-files + uses: tj-actions/changed-files@v45 - name: Clang-tidy validation # NOTE: clang-tidy crashes on CodegenDataModel_Write due to Nullable/std::optional check. # See https://github.com/llvm/llvm-project/issues/97426 + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | + touch out/changed_files.txt + for file in ${ALL_CHANGED_FILES}; do + echo "$file changed and will be considered for tidy" + echo "$file" >>out/changed_files.txt + done + ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ --compile-database out/default/compile_commands.json \ --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/|CodegenDataModel_Write|QuieterReporting' \ + --file-list-file out/changed_files.txt \ check \ " - name: Uploading diagnostic logs diff --git a/.github/workflows/cancel_workflows_for_pr.yaml b/.github/workflows/cancel_workflows_for_pr.yaml new file mode 100644 index 0000000000..caba07bedf --- /dev/null +++ b/.github/workflows/cancel_workflows_for_pr.yaml @@ -0,0 +1,52 @@ +# Copyright (c) 2024 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: Cancel workflows on failing CI +on: + workflow_dispatch: + schedule: + - cron: "*/10 * * * *" + +jobs: + cancel_workflow: + name: Cancel CI on failing pull requests + + runs-on: ubuntu-latest + + # Don't run on forked repos + if: github.repository_owner == 'project-chip' + + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Setup pip modules we use + run: | + pip install \ + click \ + coloredlogs \ + python-dateutil \ + pygithub \ + && echo "DONE installint python prerequisites" + - name: Cancel runs + run: | + scripts/tools/cancel_workflows_for_pr.py \ + --gh-api-token "${{ secrets.GITHUB_TOKEN }}" \ + --require "Restyled" \ + --require "Lint Code Base" \ + --require "ZAP" \ + --require "Run misspell" \ + --max-pr-age-minutes 20 diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index 1ddc9e9fbc..2d46de23cf 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -73,6 +73,10 @@ jobs: platform: darwin bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} + - name: Build iOS Darwin Framework Tool Build Debug + working-directory: src/darwin/Framework + run: xcodebuild -target "darwin-framework-tool" -sdk iphoneos -configuration Debug AD_HOC_CODE_SIGNING_ALLOWED=YES + - name: Run macOS Darwin Framework Tool Build Debug working-directory: src/darwin/Framework run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 9a6989881e..9a51b612a1 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -58,25 +58,15 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl602dk-light-easyflash \ - --target bouffalolab-bl602dk-light-mfd-littlefs \ - --target bouffalolab-bl602dk-light-rpc-115200-littlefs \ + --target bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200 \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602 lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-easyflash/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+mfd lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs/chip-bl602-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl602 bl602+rpc lighting-app \ - out/artifacts/bouffalolab-bl602dk-light-rpc-115200-littlefs/chip-bl602-lighting-example.out \ + bl602 bl602+mfd+littlefs+rpc lighting-app \ + out/artifacts/bouffalolab-bl602dk-light-mfd-littlefs-rpc-115200/chip-bl602-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out @@ -85,35 +75,25 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl706dk-light-easyflash \ - --target bouffalolab-bl706dk-light-mfd-littlefs \ - --target bouffalolab-bl706dk-light-ethernet-littlefs \ + --target bouffalolab-bl706dk-light-ethernet-easyflash \ --target bouffalolab-bl706dk-light-wifi-littlefs \ - --target bouffalolab-bl706dk-light-rpc-115200-littlefs \ + --target bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200 \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702 lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-easyflash/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+mfd lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-mfd-littlefs/chip-bl702-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-eth lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-ethernet-littlefs/chip-bl702-lighting-example.out \ + bl702 bl702+eth lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-ethernet-easyflash/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl706-wifi lighting-app \ + bl702 bl702+wifi lighting-app \ out/artifacts/bouffalolab-bl706dk-light-wifi-littlefs/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702 bl702+rpc lighting-app \ - out/artifacts/bouffalolab-bl706dk-light-rpc-115200-littlefs/chip-bl702-lighting-example.out \ + bl702 bl706+mfd+rpc+littlefs lighting-app \ + out/artifacts/bouffalolab-bl706dk-light-mfd-rpc-littlefs-115200/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out @@ -123,7 +103,6 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl704ldk-light-easyflash \ --target bouffalolab-bl704ldk-light-mfd-littlefs \ build \ --copy-artifacts-to out/artifacts \ @@ -131,11 +110,7 @@ jobs: - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l lighting-app \ - out/artifacts/bouffalolab-bl704ldk-light-easyflash/chip-bl702l-lighting-example.out \ - /tmp/bloat_reports/ - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - bl702l bl702l+mfd lighting-app \ + bl702l bl702l+mfd+littlefs lighting-app \ out/artifacts/bouffalolab-bl704ldk-light-mfd-littlefs/chip-bl702l-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output @@ -145,4 +120,4 @@ jobs: uses: ./.github/actions/upload-size-reports if: ${{ !env.ACT }} with: - platform-name: BouffaloLab + platform-name: BouffaloLab \ No newline at end of file diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 6d28635597..57337d5531 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -68,8 +68,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4187c-thermostat-openthread-mtd \ - --target efr32-brd4187c-air-quality-sensor-app-openthread-mtd \ + --target efr32-brd4187c-thermostat-use-ot-lib \ --target efr32-brd4187c-switch-shell-use-ot-coap-lib \ --target efr32-brd4187c-unit-test \ build \ @@ -82,29 +81,17 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4187c-light-use-ot-lib \ - --target efr32-brd4187c-pump \ - --target efr32-brd4187c-lock-shell-heap-monitoring \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Clean out build output - run: rm -rf ./out - - name: Build BRD4187C variants (3) - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ + --target efr32-brd4187c-lock-rpc \ + --target efr32-brd4187c-air-quality-sensor-app-shell-heap-monitoring \ --target efr32-brd4187c-window-covering-additional-data-advertising \ - --target efr32-brd4187c-light-rpc \ build \ --copy-artifacts-to out/artifacts \ " - name: Prepare some bloat report from the previous builds run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD4187C lighting-app \ - out/efr32-brd4187c-light-rpc/matter-silabs-lighting-example.out \ + efr32 BRD4187C lock-app \ + out/efr32-brd4187c-lock-rpc/matter-silabs-lock-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ efr32 BRD4187C window-app \ @@ -112,12 +99,12 @@ jobs: /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - - name: Build BRD4338A WiFi Soc variants + - name: Build some WiFi Soc variants run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --enable-flashbundle \ - --target efr32-brd4338a-light-skip-rps-generation \ + --target efr32-brd2605a-light-skip-rps-generation \ --target efr32-brd4338a-lock-skip-rps-generation \ build \ --copy-artifacts-to out/artifacts \ @@ -130,24 +117,6 @@ jobs: /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out - - name: Build BRD2605A WiFi Soc variants - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --enable-flashbundle \ - --target efr32-brd2605a-light-skip-rps-generation \ - --target efr32-brd2605a-lock-skip-rps-generation \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Prepare bloat report for brd2605a lock app - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - efr32 BRD2605a lock-app \ - out/efr32-brd2605a-lock-skip-rps-generation/matter-silabs-lock-example.out \ - /tmp/bloat_reports/ - - name: Clean out build output - run: rm -rf ./out - name: Build EFR32 with WiFi NCP run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index a2dca96dc6..b3a6ed24e6 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -105,14 +105,11 @@ jobs: example_binaries/esp32-build/chip-all-clusters-app.elf \ /tmp/bloat_reports/ - - name: Build example Pigweed App - run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults - - name: Build example Lighting App (Target:ESP32H2) run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32h2 esp32h2 - - name: Build example Lock App (Target:ESP32C6) - run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 + - name: Build example Lighting App (Target:ESP32C6) + run: scripts/examples/esp_example.sh lighting-app sdkconfig.defaults.esp32c6 esp32c6 - name: Uploading Size Reports uses: ./.github/actions/upload-size-reports @@ -124,7 +121,7 @@ jobs: name: ESP32_1 runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + if: github.actor != 'restyled-io[bot]' && github.repository_owner == 'espressif' container: image: ghcr.io/project-chip/chip-build-esp32:81 @@ -168,3 +165,9 @@ jobs: - name: Build example LIT ICD App (Target:ESP32H2) run: scripts/examples/esp_example.sh lit-icd-app sdkconfig.defaults esp32h2 + + - name: Build example Pigweed App + run: scripts/examples/esp_example.sh pigweed-app sdkconfig.defaults + + - name: Build example Lock App (Target:ESP32C6) + run: scripts/examples/esp_example.sh lock-app sdkconfig.defaults.esp32c6 esp32c6 diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index ee226b12dc..7000082f03 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -65,7 +65,7 @@ jobs: --target linux-arm64-chip-tool-nodeps-ipv6only \ --target linux-arm64-lock-clang \ --target linux-arm64-minmdns-clang \ - --target linux-arm64-light-rpc-ipv6only-clang \ + --target linux-arm64-light-data-model-enabled-rpc-ipv6only-clang \ --target linux-arm64-thermostat-no-ble-clang \ --target linux-arm64-lit-icd-no-ble-clang \ --target linux-arm64-fabric-admin-clang-rpc \ diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index b3115f2ff3..783c46ef41 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -38,7 +38,7 @@ jobs: BUILD_TYPE: esp32-qemu runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + if: github.actor != 'restyled-io[bot]' && github.repository_owner == 'espressif' container: image: ghcr.io/project-chip/chip-build-esp32-qemu:81 diff --git a/.github/workflows/restyled.yml b/.github/workflows/restyled.yml new file mode 100644 index 0000000000..9174483ecb --- /dev/null +++ b/.github/workflows/restyled.yml @@ -0,0 +1,35 @@ +name: Restyled + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + restyled: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: restyled-io/actions/setup@v4 + - id: restyler + uses: restyled-io/actions/run@v4 + with: + fail-on-differences: true + + - if: | + !cancelled() && + steps.restyler.outputs.success == 'true' && + github.event.pull_request.head.repo.full_name == github.repository + uses: peter-evans/create-pull-request@v6 + with: + base: ${{ steps.restyler.outputs.restyled-base }} + branch: ${{ steps.restyler.outputs.restyled-head }} + title: ${{ steps.restyler.outputs.restyled-title }} + body: ${{ steps.restyler.outputs.restyled-body }} + labels: "restyled" + reviewers: ${{ github.event.pull_request.user.login }} + delete-branch: true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 04aa91020a..63957b64d8 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -111,6 +111,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml \ + src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/chip-ota.xml \ src/app/zap-templates/zcl/data-model/chip/chip-types.xml \ src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml \ @@ -199,6 +200,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml \ @@ -209,6 +211,7 @@ jobs: src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml \ " - name: Build Apps run: | @@ -594,7 +597,7 @@ jobs: " - name: Run Tests run: | - scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factory-reset --quiet --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' - name: Uploading core files uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} diff --git a/.pullapprove.yml b/.pullapprove.yml index 83d7b70b34..81267526ee 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -8,257 +8,250 @@ github_api_version: "shadow-cat-preview" ############################################################ overrides: - - if: "'hotfix' in labels" - status: success - explanation: "Hotfix label added, bypassing reviews" + - if: "'hotfix' in labels" + status: success + explanation: "Hotfix label added, bypassing reviews" - ############################################################ - # Draft PRs - ############################################################ - - if: "draft" - status: pending - explanation: "PR is draft, pending review" + ############################################################ + # Draft PRs + ############################################################ + - if: "draft" + status: pending + explanation: "PR is draft, pending review" - ############################################################ - # License Checks - ############################################################ - - if: "'*license/cla*' not in statuses.successful" - status: pending - explanation: "CLA must be agreed to by all contributors" + ############################################################ + # License Checks + ############################################################ + - if: "'*license/cla*' not in statuses.successful" + status: pending + explanation: "CLA must be agreed to by all contributors" - ############################################################ - # Conditions to Skip Review - ############################################################ - - if: "base.ref != 'master'" - status: success - explanation: "Review not required unless merging to master" + ############################################################ + # Conditions to Skip Review + ############################################################ + - if: "base.ref != 'master'" + status: success + explanation: "Review not required unless merging to master" - ############################################################ - # Required status checks - ############################################################ - - if: "'*restyle*' not in statuses.successful" - status: failure - explanation: "Style must be inline before reviewing can be complete" + ############################################################ + # Require Issues + ############################################################ + # disabling until we have PRs up to date + # - if: "'*issue*' not in statuses.successful" + # status: failure + # explanation: "An issue is required for all PRs" - ############################################################ - # Require Issues - ############################################################ - # disabling until we have PRs up to date - # - if: "'*issue*' not in statuses.successful" - # status: failure - # explanation: "An issue is required for all PRs" - - ############################################################ - # Fast tracking - ############################################################ - - if: "'fast track' in labels" - status: success - explanation: "PR has been fast tracked, bypassing reviews" + ############################################################ + # Fast tracking + ############################################################ + - if: "'fast track' in labels" + status: success + explanation: "PR has been fast tracked, bypassing reviews" ############################################################ # Notifications ############################################################ notifications: - ############################################################ - # New contributors - ############################################################ - - when: pull_request.opened - if: "author_association == 'FIRST_TIME_CONTRIBUTOR'" - comment: | - Hey @{{ author }}, thanks for the PR! The review will start once - the tests and CI checks have passed. If they don't, please review - the logs and try to fix the issues (ask for help if you can't - figure it out). A reviewer will be assigned once the tests are - passing and they'll walk you through getting the PR finished - and merged. + ############################################################ + # New contributors + ############################################################ + - when: pull_request.opened + if: "author_association == 'FIRST_TIME_CONTRIBUTOR'" + comment: | + Hey @{{ author }}, thanks for the PR! The review will start once + the tests and CI checks have passed. If they don't, please review + the logs and try to fix the issues (ask for help if you can't + figure it out). A reviewer will be assigned once the tests are + passing and they'll walk you through getting the PR finished + and merged. groups: - ############################################################ - # Shared Reviewer Groups - ############################################################ - shared-reviewers-amazon: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-amazon] - reviews: - request: 0 # Do not auto-add - shared-reviewers-apple: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-apple] - reviews: - request: 0 # Do not auto-add - shared-reviewers-bosch: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-bosch] - reviews: - request: 0 # Do not auto-add - shared-reviewers-comcast: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-comcast] - reviews: - request: 0 # Do not auto-add - shared-reviewers-dyson: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-dyson] - reviews: - request: 0 # Do not auto-add - shared-reviewers-espressif: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-espressif] - reviews: - request: 0 # Do not auto-add - shared-reviewers-google: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-google] - reviews: - request: 0 # Do not auto-add - shared-reviewers-grundfos: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-grundfos] - reviews: - request: 0 # Do not auto-add - shared-reviewers-irobot: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-irobot] - reviews: - request: 0 # Do not auto-add - shared-reviewers-lg: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-lg] - reviews: - request: 0 # Do not auto-add - shared-reviewers-logitech: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-logitech] - reviews: - request: 0 # Requested to be only on demand - shared-reviewers-nordic: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-nordic] - reviews: - request: 0 # Do not auto-add - shared-reviewers-nxp: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-nxp] - reviews: - request: 0 # Do not auto-add - shared-reviewers-samsung: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-samsung] - reviews: - request: 0 # Do not auto-add - shared-reviewers-eve: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-eve] - reviews: - request: 0 # Do not auto-add - # shared-reviewers-signify disabled for now, because the reviewers-signify - # team is empty and pullapprove seems to mis-handle that badly and treats - # _all_ reviewers as being in this group. - # - # See https://github.com/dropseed/pullapprove/issues/71 - # - # shared-reviewers-signify: - # type: optional - # conditions: - # - files.include('*') - # reviewers: - # teams: [reviewers-signify] - # reviews: - # request: 0 # Do not auto-add - shared-reviewers-silabs: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-silabs] - reviews: - request: 0 # Do not auto-add - shared-reviewers-somfy: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-somfy] - reviews: - request: 0 # Do not auto-add - shared-reviewers-tcl: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-tcl] - reviews: - request: 0 # Do not auto-add - shared-reviewers-qorvo: - type: optional - conditions: - - files.include('*') - reviewers: - teams: [reviewers-qorvo] - reviews: - request: 0 # Do not auto-add + ############################################################ + # Shared Reviewer Groups + ############################################################ + shared-reviewers-amazon: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-amazon] + reviews: + request: 0 # Do not auto-add + shared-reviewers-apple: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-apple] + reviews: + request: 0 # Do not auto-add + shared-reviewers-bosch: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-bosch] + reviews: + request: 0 # Do not auto-add + shared-reviewers-comcast: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-comcast] + reviews: + request: 0 # Do not auto-add + shared-reviewers-dyson: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-dyson] + reviews: + request: 0 # Do not auto-add + shared-reviewers-espressif: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-espressif] + reviews: + request: 0 # Do not auto-add + shared-reviewers-google: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-google] + reviews: + request: 0 # Do not auto-add + shared-reviewers-grundfos: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-grundfos] + reviews: + request: 0 # Do not auto-add + shared-reviewers-irobot: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-irobot] + reviews: + request: 0 # Do not auto-add + shared-reviewers-lg: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-lg] + reviews: + request: 0 # Do not auto-add + shared-reviewers-logitech: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-logitech] + reviews: + request: 0 # Requested to be only on demand + shared-reviewers-nordic: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-nordic] + reviews: + request: 0 # Do not auto-add + shared-reviewers-nxp: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-nxp] + reviews: + request: 0 # Do not auto-add + shared-reviewers-samsung: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-samsung] + reviews: + request: 0 # Do not auto-add + shared-reviewers-eve: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-eve] + reviews: + request: 0 # Do not auto-add + # shared-reviewers-signify disabled for now, because the reviewers-signify + # team is empty and pullapprove seems to mis-handle that badly and treats + # _all_ reviewers as being in this group. + # + # See https://github.com/dropseed/pullapprove/issues/71 + # + # shared-reviewers-signify: + # type: optional + # conditions: + # - files.include('*') + # reviewers: + # teams: [reviewers-signify] + # reviews: + # request: 0 # Do not auto-add + shared-reviewers-silabs: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-silabs] + reviews: + request: 0 # Do not auto-add + shared-reviewers-somfy: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-somfy] + reviews: + request: 0 # Do not auto-add + shared-reviewers-tcl: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-tcl] + reviews: + request: 0 # Do not auto-add + shared-reviewers-qorvo: + type: optional + conditions: + - files.include('*') + reviewers: + teams: [reviewers-qorvo] + reviews: + request: 0 # Do not auto-add - ############################################################ - # Base Required Reviewers - ############################################################ - required-reviewers: - description: > - [Required - Reviewers](https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#review-requirements) - This is the main group of required reviews for general pull - requests. - type: required - requirements: - - len(groups.approved.include('shared-reviewers-*')) >= 2 - reviews: - required: 0 - labels: - approved: "review - approved" - pending: "review - pending" - rejected: "review - changed requested" + ############################################################ + # Base Required Reviewers + ############################################################ + required-reviewers: + description: > + [Required + Reviewers](https://github.com/project-chip/connectedhomeip/blob/master/CONTRIBUTING.md#review-requirements) + This is the main group of required reviews for general pull + requests. + type: required + requirements: + - len(groups.approved.include('shared-reviewers-*')) >= 2 + reviews: + required: 0 + labels: + approved: "review - approved" + pending: "review - pending" + rejected: "review - changed requested" diff --git a/data_model/1.4/clusters/DemandResponseLoadControl.xml b/data_model/1.4/clusters/DemandResponseLoadControl.xml deleted file mode 100644 index 1acd1ea26c..0000000000 --- a/data_model/1.4/clusters/DemandResponseLoadControl.xml +++ /dev/null @@ -1,453 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/EnergyCalendar.xml b/data_model/1.4/clusters/EnergyCalendar.xml deleted file mode 100644 index 2ba9320361..0000000000 --- a/data_model/1.4/clusters/EnergyCalendar.xml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/Humidistat.xml b/data_model/1.4/clusters/Humidistat.xml deleted file mode 100644 index 1af5469848..0000000000 --- a/data_model/1.4/clusters/Humidistat.xml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/clusters/cluster_ids.json b/data_model/1.4/clusters/cluster_ids.json index 9de2f243b3..687bbc3229 100644 --- a/data_model/1.4/clusters/cluster_ids.json +++ b/data_model/1.4/clusters/cluster_ids.json @@ -64,11 +64,9 @@ "144": "Electrical Power Measurement", "145": "Electrical Energy Measurement", "148": "Water Heater Management", - "150": "Demand Response Load Control", "151": "Messages", "152": "Device Energy Management", "153": "Energy EVSE", - "154": "Energy Calendar", "155": "Energy Preference", "156": "Power Topology", "157": "Energy EVSE Mode", @@ -81,7 +79,6 @@ "513": "Thermostat", "514": "Fan Control", "516": "Thermostat User Interface Configuration", - "517": "Humidistat", "768": "Color Control", "769": "Ballast Configuration", "1024": "Illuminance Measurement", diff --git a/data_model/1.4/device_types/EnergyTariff.xml b/data_model/1.4/device_types/EnergyTariff.xml deleted file mode 100644 index 887bfa420d..0000000000 --- a/data_model/1.4/device_types/EnergyTariff.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/device_types/EnergyTariffCalendar.xml b/data_model/1.4/device_types/EnergyTariffCalendar.xml deleted file mode 100644 index 70d74b7239..0000000000 --- a/data_model/1.4/device_types/EnergyTariffCalendar.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/data_model/1.4/device_types/HumidifierDehumidifier.xml b/data_model/1.4/device_types/HumidifierDehumidifier.xml deleted file mode 100644 index 973919635f..0000000000 --- a/data_model/1.4/device_types/HumidifierDehumidifier.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/docs/guides/repl/Matter_Access_Control.ipynb b/docs/development_controllers/chip-repl/Matter_Access_Control.ipynb similarity index 100% rename from docs/guides/repl/Matter_Access_Control.ipynb rename to docs/development_controllers/chip-repl/Matter_Access_Control.ipynb diff --git a/docs/guides/repl/Matter_Basic_Interactions.ipynb b/docs/development_controllers/chip-repl/Matter_Basic_Interactions.ipynb similarity index 100% rename from docs/guides/repl/Matter_Basic_Interactions.ipynb rename to docs/development_controllers/chip-repl/Matter_Basic_Interactions.ipynb diff --git a/docs/guides/repl/Matter_Multi_Fabric_Commissioning.ipynb b/docs/development_controllers/chip-repl/Matter_Multi_Fabric_Commissioning.ipynb similarity index 100% rename from docs/guides/repl/Matter_Multi_Fabric_Commissioning.ipynb rename to docs/development_controllers/chip-repl/Matter_Multi_Fabric_Commissioning.ipynb diff --git a/docs/guides/repl/Matter_REPL_Intro.ipynb b/docs/development_controllers/chip-repl/Matter_REPL_Intro.ipynb similarity index 100% rename from docs/guides/repl/Matter_REPL_Intro.ipynb rename to docs/development_controllers/chip-repl/Matter_REPL_Intro.ipynb diff --git a/docs/development_controllers/chip-repl/index.md b/docs/development_controllers/chip-repl/index.md new file mode 100644 index 0000000000..b17962ab66 --- /dev/null +++ b/docs/development_controllers/chip-repl/index.md @@ -0,0 +1,15 @@ +# chip-repl + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +- [Matter REPL](./matter-repl.md) +- [Intro](./Matter_REPL_Intro.ipynb) +- [Access Control](./Matter_Access_Control.ipynb) +- [Basic interactions](./Matter_Basic_Interactions.ipynb) +- [Fabric Commissioning](./Matter_Multi_Fabric_Commissioning.ipynb) diff --git a/docs/guides/matter-repl.md b/docs/development_controllers/chip-repl/matter-repl.md similarity index 97% rename from docs/guides/matter-repl.md rename to docs/development_controllers/chip-repl/matter-repl.md index e7ebba5b3e..9bb3e60916 100644 --- a/docs/guides/matter-repl.md +++ b/docs/development_controllers/chip-repl/matter-repl.md @@ -244,8 +244,8 @@ Some tests provides the option to exclude them. For example, you can use It is recommended to use the test wrapper to run mobile-device-test.py, for example, you can run: -``` -./scripts/tests/run_python_test.py --app chip-all-clusters-app --factoryreset +```shell +./scripts/tests/run_python_test.py --app chip-all-clusters-app --factory-reset ``` It provides some extra options, for example: @@ -254,7 +254,7 @@ It provides some extra options, for example: optional arguments: -h, --help show this help message and exit --app APP Path to local application to use, omit to use external apps. - --factoryreset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests. + --factory-reset Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests. --app-args APP_ARGS The extra parameters passed to the device side app. --script SCRIPT Path to the test script to use, omit to use the default test script (mobile-device-test.py). --script-args SCRIPT_ARGS Arguments for the REPL test script @@ -263,8 +263,8 @@ optional arguments: You can pass your own flags for mobile-device-test.py by appending them to the command line with two dashes, for example: -``` -./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factoryreset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout" +```shell +./scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-no-ble-no-wifi-tsan-clang/chip-all-clusters-app --factory-reset --script-args "-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout" ``` will pass `-t 90 --disable-test ClusterObjectTests.TestTimedRequestTimeout` to diff --git a/docs/guides/python_chip_controller_advanced_usage.md b/docs/development_controllers/chip-repl/python_chip_controller_advanced_usage.md similarity index 100% rename from docs/guides/python_chip_controller_advanced_usage.md rename to docs/development_controllers/chip-repl/python_chip_controller_advanced_usage.md diff --git a/docs/guides/python_chip_controller_building.md b/docs/development_controllers/chip-repl/python_chip_controller_building.md similarity index 98% rename from docs/guides/python_chip_controller_building.md rename to docs/development_controllers/chip-repl/python_chip_controller_building.md index 8a7acc884a..aa49adad24 100644 --- a/docs/guides/python_chip_controller_building.md +++ b/docs/development_controllers/chip-repl/python_chip_controller_building.md @@ -39,7 +39,7 @@ Linux (amd64 / aarch64) or macOS. To build and run the Python CHIP controller: 1. Install all necessary packages and prepare the build system. For more - details, see the [Building Matter](BUILDING.md) documentation: + details, see the [Building Matter](../../guides/BUILDING.md) documentation: ``` sudo apt-get update @@ -77,7 +77,8 @@ To build and run the Python CHIP controller: 5. Build and install the Python CHIP controller: ``` - scripts/build_python.sh -m platform -i separate + scripts/build_python.sh -m platform -i out/python_env + source out/python_env/bin/activate ``` > Note: This builds the Python CHIP Controller along with the CHIP REPL as diff --git a/docs/guides/chip_tool_guide.md b/docs/development_controllers/chip-tool/chip_tool_guide.md similarity index 99% rename from docs/guides/chip_tool_guide.md rename to docs/development_controllers/chip-tool/chip_tool_guide.md index 31aa29353c..8aac8daa12 100644 --- a/docs/guides/chip_tool_guide.md +++ b/docs/development_controllers/chip-tool/chip_tool_guide.md @@ -38,7 +38,8 @@ Before you can use the CHIP Tool, you must compile it from source on Linux To build and run the CHIP Tool: 1. Install all required packages for Matter and prepare the source code and the - build system. Read the [Building Matter](BUILDING.md) guide for instructions. + build system. Read the [Building Matter](../../guides/BUILDING.md) guide for + instructions. 2. Open a command prompt in the `connectedhomeip` directory. 3. Run the following command: diff --git a/docs/development_controllers/chip-tool/index.md b/docs/development_controllers/chip-tool/index.md new file mode 100644 index 0000000000..69dc7dcd68 --- /dev/null +++ b/docs/development_controllers/chip-tool/index.md @@ -0,0 +1,11 @@ +# chip-tool + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +- [chip-tool guide](./chip_tool_guide.md) diff --git a/docs/development_controllers/index.md b/docs/development_controllers/index.md new file mode 100644 index 0000000000..dfc6b330b1 --- /dev/null +++ b/docs/development_controllers/index.md @@ -0,0 +1,13 @@ +# Development Controllers + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +chip-repl/index +chip-tool/index +``` + +- [chip-tool](./chip-tool) +- [chip-repl](./chip-repl) diff --git a/docs/getting_started/changing_examples.md b/docs/getting_started/changing_examples.md new file mode 100644 index 0000000000..611610ce43 --- /dev/null +++ b/docs/getting_started/changing_examples.md @@ -0,0 +1,64 @@ +# Changing Examples + +The composition of most examples in the SDK is static and code generated. + +The tool used to describe and change the composition of an example is called +ZAP. More information about ZAP and a walk-through of the tool can be found in +the [ZAP introduction](./zap.md). The composition of the device is captured in a +.zap file, which is readable by the ZAP tool. This is then compiled into a +human-readable .matter file, which is used to build the static features of the +example. + +To change the composition of a device example, you need to + +1. Change the zap file to implement your desired changes +2. Run the code generation tool to generate the .matter file +3. Re-build the example + +## Changing the zap file in an example + +Most examples in the SDK keep the .zap file in a sub-directory called +example-name-common (ex. lighting-common). To load an existing .zap file into +the ZAP tool, from the chip-root use + +``` +./scripts/tools/zap/run_zaptool.sh +``` + +For example, to make changes to the lighting app, use: + +``` +./scripts/tools/zap/run_zaptool.sh examples/lighting-app/lighting-common/lighting-app.zap +``` + +This will open the ZAP GUI tool, which can be used to change the endpoint +composition, clusters, features, attributes, commands and events exposed by the +device. + +Details of how to use the tool can be found in the [ZAP Introduction](./zap.md). + +## Running code generation + +To compile the .matter file for use in building, use: + +``` +./scripts/tools/zap/generate.py +``` + +For example, for changes to the lighting app, use: + +``` +./scripts/tools/zap/generate.py examples/lighting-app/lighting-common/lighting-app.zap +``` + +If there are changes to many .zap files, the following script can be used to +recompile the .zap files for all the examples and the controller. + +``` + ./scripts/tools/zap_regen_all.py +``` + +## Rebuilding the example + +After generating the .matter file, re-build the example. Instructions for +building examples are given in [Building your first example](./first_example.md) diff --git a/docs/getting_started/first_example.md b/docs/getting_started/first_example.md index 89ab7d493d..14fe239749 100644 --- a/docs/getting_started/first_example.md +++ b/docs/getting_started/first_example.md @@ -26,7 +26,7 @@ for testing. [chip-tool](../../examples/chip-tool/) is a C++ command line controller with an interactive shell. More information on chip-tool can be found in the -[chip-tool guide](../guides/chip_tool_guide.md). +[chip-tool guide](../development_controllers/chip-tool/chip_tool_guide.md). [chip-repl](../../src/controller/python/chip-repl.py) is a shell for the python controller. The chip-repl is part of the python controller framework, often used diff --git a/docs/getting_started/index.md b/docs/getting_started/index.md index ea881141ff..098f047ed7 100644 --- a/docs/getting_started/index.md +++ b/docs/getting_started/index.md @@ -12,5 +12,6 @@ The following docs are a brief introduction to SDK development. ``` - [Running your first example](./first_example.md) -- [SDK Basics](./SDKBasics.md) -- [ZAP](./zap.md) +- [Changing examples](./changing_examples.md) +- [SDK Architecture Introduction](./SDKBasics.md) +- [ZAP Introduction](./zap.md) diff --git a/docs/guides/darwin.md b/docs/guides/darwin.md index 00165e6fca..4692c0b065 100644 --- a/docs/guides/darwin.md +++ b/docs/guides/darwin.md @@ -292,17 +292,17 @@ Example: - [ESP32 Lighting](/examples/lighting-app/esp32/README.md) - [ESP32 Temperature Sensor](/examples/temperature-measurement-app/esp32/README.md) - [mbedOS](/examples/all-clusters-app/mbed/README.md) -- [nRF Connect All Clusters](./nrfconnect_examples_configuration.md) +- [nRF Connect All Clusters](../platforms/nrf/nrfconnect_examples_configuration.md) - [nRF Connect Pump](/examples/pump-app/nrfconnect/README.md) -- [NXP Examples](./nxp/nxp_imx8m_linux_examples.md) +- [NXP Examples](../platforms/nxp/nxp_imx8m_linux_examples.md) - [NXP](/examples/all-clusters-app/nxp/mw320/README.md) - [Infineon CYW30739 Lighting](/examples/lighting-app/infineon/cyw30739/README.md) - [Infineon PSoC6](/examples/all-clusters-app/infineon/psoc6/README.md) - [Qorvo](/examples/lighting-app/qpg/README.md) -- [Silicon Labs](./silabs_getting_started.md) +- [Silicon Labs](../platforms/silabs/silabs_getting_started.md) - [Simulated Linux](./simulated_device_linux.md) - [Telink](/examples/lighting-app/telink/README.md) -- [TI Platform](./ti/ti_matter_overview.md) +- [TI Platform](../platforms/ti/ti_matter_overview.md) - [Tizen](/examples/lighting-app/tizen/README.md) ## Providing Feedback to Apple diff --git a/docs/guides/index.md b/docs/guides/index.md index 14d9caf7e2..97167c84ae 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -9,54 +9,13 @@ and features. :hidden: * -esp32/README -nxp/README -ti/ti_matter_overview ``` ## Build Guides - [Building](./BUILDING.md) -## Platform Guides - -- [Android - Building](./android_building.md) -- [Apple - Testing with iPhone, iPad, macOS, Apple TV, HomePod, Watch, etc](./darwin.md) -- [ASR - Getting Started Guide](./asr_getting_started_guide.md) -- [Espressif (ESP32) - Getting Started Guide](./esp32/README.md) -- [Infineon PSoC6 - Software Update](./infineon_psoc6_software_update.md) -- [Linux - Simulated Devices](./simulated_device_linux.md) -- [mbedOS - Adding a new target](./mbedos_add_new_target.md) -- [mbedOS - Commissioning](./mbedos_commissioning.md) -- [mbedOS - Platform Overview](./mbedos_platform_overview.md) -- [nRF Connect - Android Commissioning](./nrfconnect_android_commissioning.md) -- [nRF Connect - CLI Guide](./nrfconnect_examples_cli.md) -- [nRF Connect - Configuration](./nrfconnect_examples_configuration.md) -- [nRF Connect - Factory Data Configuration](./nrfconnect_factory_data_configuration.md) -- [nRF Connect - Platform Overview](./nrfconnect_platform_overview.md) -- [nRF Connect - Software Update](./nrfconnect_examples_software_update.md) -- [NXP - Getting Started Guide](./nxp/README.md) -- [Silicon Labs - Documentation](https://siliconlabs.github.io/matter/latest/index.html) -- [Silicon Labs - Getting Started](./silabs_getting_started.md) -- [Silicon Labs - Software Update](./silabs_efr32_software_update.md) -- [Silicon Labs - CLI Guide](./silabs_cli_guide.md) -- [TI - Platform Overview](./ti/ti_matter_overview.md) - -## Tool Guides - -- [CHIP Tool](./chip_tool_guide.md) -- [Python Matter-Repl](./matter-repl.md) -- [python-chip-controller - Advanced](./python_chip_controller_advanced_usage.md) -- [python-chip-controller - Building](./python_chip_controller_building.md) -- [CHEF test devices](../../examples/chef/README.md) - - [New device type adding](../../examples/chef/NEW_CHEF_DEVICES.md) - ## Development Guides - [Access Control](./access-control-guide.md) - [Matter IDL tooling and validation](./matter_idl_tooling.md) - -## Setup Guides - -- [Open Thread - Hardware suggestions](./openthread_rcp_nrf_dongle.md) -- [Open Thread - Setting up a Raspberry Pi as a Border Router](./openthread_border_router_pi.md) diff --git a/docs/index.md b/docs/index.md index f4b4062271..6b7553f205 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,9 +8,11 @@ PROJECT_FLOW VSCODE_DEVELOPMENT ci-cd/index +development_controllers/index getting_started/index cluster_and_device_type_dev/index guides/index +platforms/index style/index examples/index product_considerations/index diff --git a/docs/guides/android_building.md b/docs/platforms/android/android_building.md similarity index 100% rename from docs/guides/android_building.md rename to docs/platforms/android/android_building.md diff --git a/docs/platforms/android/index.md b/docs/platforms/android/index.md new file mode 100644 index 0000000000..a8bdd37290 --- /dev/null +++ b/docs/platforms/android/index.md @@ -0,0 +1,11 @@ +# Android + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Android - Building](./android_building.md) diff --git a/docs/guides/asr_getting_started_guide.md b/docs/platforms/asr/asr_getting_started_guide.md similarity index 97% rename from docs/guides/asr_getting_started_guide.md rename to docs/platforms/asr/asr_getting_started_guide.md index e47cc554ef..e5a4bac6e2 100644 --- a/docs/guides/asr_getting_started_guide.md +++ b/docs/platforms/asr/asr_getting_started_guide.md @@ -33,7 +33,7 @@ to speed up development. You can find them in the samples with `/asr` subfolder. ## Building the Example Application -- [Setup Matter Environment](./BUILDING.md) +- [Setup Matter Environment](../../guides/BUILDING.md) - Setup toolchain - for ASR582X and ASR550X @@ -140,7 +140,7 @@ There are two commissioning modes supported by ASR platform: `build_examples.py` script. For example: `./scripts/build/build_examples.py --target asr-$ASR_BOARD-lighting-ota build` 2. For more usage details, please refer to the - [OTA example](../../examples/ota-requestor-app/asr/README.md) + [OTA example](../../../examples/ota-requestor-app/asr/README.md) ## Factory diff --git a/docs/platforms/asr/index.md b/docs/platforms/asr/index.md new file mode 100644 index 0000000000..f4748a4c70 --- /dev/null +++ b/docs/platforms/asr/index.md @@ -0,0 +1,11 @@ +# ASR + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[ASR - Getting Started Guide](./asr_getting_started_guide.md) diff --git a/docs/platforms/bouffalolab/index.md b/docs/platforms/bouffalolab/index.md new file mode 100644 index 0000000000..bacc0e63ca --- /dev/null +++ b/docs/platforms/bouffalolab/index.md @@ -0,0 +1,11 @@ +# Bouffalolab + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Bouffalo Lab - Matter factory data generation](./matter_factory_data.md) diff --git a/docs/platforms/bouffalolab/matter_factory_data.md b/docs/platforms/bouffalolab/matter_factory_data.md new file mode 100644 index 0000000000..9021cd80f6 --- /dev/null +++ b/docs/platforms/bouffalolab/matter_factory_data.md @@ -0,0 +1,249 @@ +# Introduction to Matter factory data + +Each Matter device should have it own unique factory data manufactured. + +This guide demonstrates what `Bouffalo Lab` provides to support factory data: + +- credential factory data protected by hardware security engine +- reference tool to generate factory data +- tool/method to program factory data + +# Matter factory data + +## How to enable + +One dedicate flash region allocates for factory data as below which is read-only +for firmware. + +```toml +name = "MFD" +address0 = 0x3FE000 +size0 = 0x1000 +``` + +To enable matter factory data feature, please append `-mfd` option at end of +target name. Take BL602 Wi-Fi Matter Light as example. + +``` +./scripts/build/build_examples.py --target bouffalolab-bl602dk-light-littlefs-mfd build +``` + +## Factory data + +This flash region is divided to two parts: + +- One is plain text data, such as Vendor ID, Product ID, Serial number and so + on. + + > For development/test purpose, all data can put in plain text data. + +- Other is cipher text data, such as private key for device attestation data. + + `Bouffalo Lab` provides hardware security engine to decrypt this part data + with **only hardware access** efuse key. + +Current supported data + +- DAC certificate and private key +- PAI certificate +- Certificate declaration + +- Discriminator ID +- Pass Code +- Spake2p iteration count, salt and verifier +- Vendor ID and name +- Product ID and name +- Product part number and product label +- Manufacturing date +- Hardware version and version string +- Serial Number +- Unique identifier + +> Note, it is available to add customer/product own information in factory data, +> please reference to `bl_mfd.h`/`bl_mfd.c` in SDK and reference generation +> script +> [generate_factory_data.py](../../../scripts/tools/bouffalolab/generate_factory_data.py) + +# Generate Matter factory data + +Script tool +[generate_factory_data.py](../../../scripts/tools/bouffalolab/generate_factory_data.py) +call `chip-cert` to generate test certificates and verify certificates. + +Please run below command to compile `chip-cert` tool under `connnectedhomeip` +repo. + +```shell +./scripts/build/build_examples.py --target linux-x64-chip-cert build +``` + +## Command options + +- `--cd`, certificate declare + + If not specified, `Chip-Test-CD-Signing-Cert.pem` and + `Chip-Test-CD-Signing-Key.pem` will sign a test certificate declare for + development and test purpose + +- `--pai_cert` and `--pai-key`, PAI certificate and PAI private key + + If not specified, `Chip-Test-PAI-FFF1-8000-Cert.pem` and + `Chip-Test-PAI-FFF1-8000-Key.pem` will be used for development and test + purpose. + +- `--dac_cert` and `--dac_key`, DAC certificate and DAC private key. + + If not specified, script will use PAI certificate and key specified + by`--pai_cert` and `--pai-key` to generate DAC certificate and private key + for development and test purpose. + +- `--discriminator`, discriminator ID + + If not specified, script will generate for user. + +- `--passcode`, passcode + + If not specified, script will generate for user. + +- `--spake2p_it` and `--spake2p_salt` + + If not specified, script will generate and calculate verifier for user. + +Please reference to `--help` for more detail. + +## Generate with default test certificates + +- Run following command to generate all plain text factory data + + Please create output folder first. Here takes `out/test-cert` as example. + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert + ``` + +- Run following command to generate factory data which encrypt private of + device attestation data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --key + ``` + + > An example of hex string of 16 bytes: 12345678123456781234567812345678 + +After command executes successfully, the output folder will has files as below: + +- Test certificate declare file which file name ends with `cd.der` + + If user wants to reuse CD generated before, please specify CD with option + `--cd` as below. + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --cd + ``` + +- Test DAC certificate and DAC certificate key which file names ends with + `dac_cert.pem` and `dac_key.pem` separately. + +- QR code picture which file name ends with `onboard.png` +- On board information which file name ends with `onboard.txt` +- Matter factory data which file name ends with `mfd.bin`. + +## Generate with self-defined PAA/PAI certificates + +Self-defined PAA/PAI certificates may use in development and test scenario. But, +user should know it has limit to work with real ecosystem. + +- Export environment variables in terminal for easy operations + + ``` + export TEST_CERT_VENDOR_ID=130D # Vendor ID hex string + export TEST_CERT_CN=BFLB # Common Name + ``` + +- Generate PAA certificate and key to `out/cert` folder. + + ```shell + mkdir out/test-cert + ./out/linux-x64-chip-cert/chip-cert gen-att-cert --type a --subject-cn "${TEST_CERT_CN} PAA 01" --valid-from "2020-10-15 14:23:43" --lifetime 7305 --out-key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --out out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --subject-vid ${TEST_CERT_VENDOR_ID} + ``` + +- Convert PAA PEM format file to PAA DER format file + + ```shell + ./out/linux-x64-chip-cert/chip-cert convert-cert -d out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.der + ``` + + > Please save this PAA DER format file which will be used by `chip-tool` + > during commissioning. + +- Generate PAI certificate and key: + + ```shell + ./out/linux-x64-chip-cert/chip-cert gen-att-cert --type i --subject-cn "${TEST_CERT_CN} PAI 01" --subject-vid ${TEST_CERT_VENDOR_ID} --valid-from "2020-10-15 14:23:43" --lifetime 7305 --ca-key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --ca-cert out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --out-key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem --out out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem + ``` + +- Generate `MFD` in plain text data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --paa_cert out/test-cert/Chip-PAA-Cert-${TEST_CERT_VENDOR_ID}.pem --paa_key out/test-cert/Chip-PAA-Key-${TEST_CERT_VENDOR_ID}.pem --pai_cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --pai_key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem + ``` + + > Appending `--key ` option to enable encrypt + > private key of attestation device data. + +## Generate with self-defined DAC certificate and key + +Self-defined DAC certificates may use in development and test scenario. But, +user should know it has limit to work with real ecosystem. + +- Export environment variables in terminal for easy operations + + ``` + export TEST_CERT_VENDOR_ID=130D # Vendor ID hex string + export TEST_CERT_PRODUCT_ID=1001 # Vendor ID hex string + export TEST_CERT_CN=BFLB # Common Name + ``` + +- Generate DAC certificate and key + + ```shell + out/linux-x64-chip-cert/chip-cert gen-att-cert --type d --subject-cn "${TEST_CERT_CN} PAI 01" --subject-vid ${TEST_CERT_VENDOR_ID} --subject-pid ${TEST_CERT_VENDOR_ID} --valid-from "2020-10-16 14:23:43" --lifetime 5946 --ca-key out/test-cert/Chip-PAI-Key-${TEST_CERT_VENDOR_ID}.pem --ca-cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --out-key out/test-cert/Chip-DAC-Key-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem --out out/test-cert/Chip-DAC-Cert-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem + ``` + + > **Note**, `--valid-from` and `--lifetime` should be in `--valid-from` and + > `--lifetime` of PAI certificate. + +- Generate `MFD` in plain text data + + ```shell + ./scripts/tools/bouffalolab/generate_factory_data.py --output out/test-cert --pai_cert out/test-cert/Chip-PAI-Cert-${TEST_CERT_VENDOR_ID}.pem --dac_cert out/test-cert/Chip-DAC-Cert-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem --dac_key out/test-cert/Chip-DAC-Key-${TEST_CERT_VENDOR_ID}-${TEST_CERT_PRODUCT_ID}.pem + ``` + + > Appending `--key ` option to enable encrypt + > private key of attestation device data. + +# Program factory data + +After each target built successfully, a flash programming python script will be +generated under out folder. + +Take BL616 Wi-Fi Matter Light as example, `chip-bl616-lighting-example.flash.py` +is using to program firmware, and also for factory data and factory decryption +key. + +```shell +/out/bouffalolab-bl616dk-light-wifi-mfd/chip-bl616-lighting-example.flash.py --port --mfd out/test-cert/ +``` + +> If `MFD` file has cipher text data, please append +> `--key ` option to program to this key to efuse. + +- Limits on BL IOT SDK + + If developer would like to program `MFD` with all plain text data, option + `--key ` needs pass to script, otherwise, flash tool + will raise an error. And SoC BL602, BL702 and BL702L use BL IOT SDK for + Matter Application. + +Please free contact to `Bouffalo Lab` for DAC provider service and higher +security solution, such as SoC inside certificate requesting. diff --git a/docs/guides/esp32/ble_settings.md b/docs/platforms/esp32/ble_settings.md similarity index 100% rename from docs/guides/esp32/ble_settings.md rename to docs/platforms/esp32/ble_settings.md diff --git a/docs/guides/esp32/build_app_and_commission.md b/docs/platforms/esp32/build_app_and_commission.md similarity index 98% rename from docs/guides/esp32/build_app_and_commission.md rename to docs/platforms/esp32/build_app_and_commission.md index 942cb6add8..df295cc493 100644 --- a/docs/guides/esp32/build_app_and_commission.md +++ b/docs/platforms/esp32/build_app_and_commission.md @@ -168,7 +168,7 @@ $ out/debug/chip-tool pairing ble-wifi 12345 MY_SSID MY_PASSWORD 20202021 3840 #### Commissioning the Thread device (ESP32H2) - For ESP32-H2, firstly start OpenThread Border Router, you can either use - [Raspberry Pi OpenThread Border Router](../openthread_border_router_pi.md) + [Raspberry Pi OpenThread Border Router](../openthread/openthread_border_router_pi.md) OR [ESP32 OpenThread Border Router](../../../examples/thread-br-app/esp32/README.md) diff --git a/docs/guides/esp32/config_options.md b/docs/platforms/esp32/config_options.md similarity index 100% rename from docs/guides/esp32/config_options.md rename to docs/platforms/esp32/config_options.md diff --git a/docs/guides/esp32/factory_data.md b/docs/platforms/esp32/factory_data.md similarity index 100% rename from docs/guides/esp32/factory_data.md rename to docs/platforms/esp32/factory_data.md diff --git a/docs/guides/esp32/flash_nvs_encryption.md b/docs/platforms/esp32/flash_nvs_encryption.md similarity index 100% rename from docs/guides/esp32/flash_nvs_encryption.md rename to docs/platforms/esp32/flash_nvs_encryption.md diff --git a/docs/guides/esp32/README.md b/docs/platforms/esp32/index.md similarity index 100% rename from docs/guides/esp32/README.md rename to docs/platforms/esp32/index.md diff --git a/docs/guides/esp32/ota.md b/docs/platforms/esp32/ota.md similarity index 100% rename from docs/guides/esp32/ota.md rename to docs/platforms/esp32/ota.md diff --git a/docs/guides/esp32/providers.md b/docs/platforms/esp32/providers.md similarity index 100% rename from docs/guides/esp32/providers.md rename to docs/platforms/esp32/providers.md diff --git a/docs/guides/esp32/rpc_console.md b/docs/platforms/esp32/rpc_console.md similarity index 100% rename from docs/guides/esp32/rpc_console.md rename to docs/platforms/esp32/rpc_console.md diff --git a/docs/guides/esp32/secure_cert_partition.md b/docs/platforms/esp32/secure_cert_partition.md similarity index 100% rename from docs/guides/esp32/secure_cert_partition.md rename to docs/platforms/esp32/secure_cert_partition.md diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/platforms/esp32/setup_idf_chip.md similarity index 100% rename from docs/guides/esp32/setup_idf_chip.md rename to docs/platforms/esp32/setup_idf_chip.md diff --git a/docs/guides/esp32/vs_code_development.md b/docs/platforms/esp32/vs_code_development.md similarity index 100% rename from docs/guides/esp32/vs_code_development.md rename to docs/platforms/esp32/vs_code_development.md diff --git a/docs/platforms/index.md b/docs/platforms/index.md new file mode 100644 index 0000000000..4011f2e4c2 --- /dev/null +++ b/docs/platforms/index.md @@ -0,0 +1,35 @@ +# Platform Guides + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +android/index +asr/index +bouffalolab/index +esp32/index +infineon/index +mbedos/index +nrf/index +nxp/index +openiotsdk/index +openthread/index +silabs/index +stm32/index +ti/index +``` + +- [Android](./android/) +- [ASR](./asr/) +- [Bouffalo Lab](./bouffalolab) +- [ESP32](./esp32/) +- [Infineon](./infineon/) +- [MbedOS](./mbedos/) +- [NRF](./nrf/) +- [NXP](./nxp/) +- [OpenIoTSDK](./openiotsdk/) +- [OpenThread](./openthread/) +- [Silabs](./silabs/) +- [STM32](./stm32/) +- [TI](./ti/) diff --git a/docs/platforms/infineon/index.md b/docs/platforms/infineon/index.md new file mode 100644 index 0000000000..7784db777f --- /dev/null +++ b/docs/platforms/infineon/index.md @@ -0,0 +1,12 @@ +# Infineon + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Provisioning](./infineon_psoc6_software_update.md) +[Software update](./infineon_psoc6_software_update.md) diff --git a/docs/guides/infineon_psoc6_software_update.md b/docs/platforms/infineon/infineon_psoc6_software_update.md similarity index 100% rename from docs/guides/infineon_psoc6_software_update.md rename to docs/platforms/infineon/infineon_psoc6_software_update.md diff --git a/docs/guides/infineon_trustm_provisioning.md b/docs/platforms/infineon/infineon_trustm_provisioning.md similarity index 100% rename from docs/guides/infineon_trustm_provisioning.md rename to docs/platforms/infineon/infineon_trustm_provisioning.md diff --git a/docs/guides/images/matter_mbedos_overview_simplified.png b/docs/platforms/mbedos/images/matter_mbedos_overview_simplified.png similarity index 100% rename from docs/guides/images/matter_mbedos_overview_simplified.png rename to docs/platforms/mbedos/images/matter_mbedos_overview_simplified.png diff --git a/docs/platforms/mbedos/index.md b/docs/platforms/mbedos/index.md new file mode 100644 index 0000000000..5c29ab774d --- /dev/null +++ b/docs/platforms/mbedos/index.md @@ -0,0 +1,13 @@ +# MbedOS + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Add new target](./mbedos_add_new_target.md) +[Commissioning](./mbedos_commissioning.md) +[Platform overview](./mbedos_platform_overview.md) diff --git a/docs/guides/mbedos_add_new_target.md b/docs/platforms/mbedos/mbedos_add_new_target.md similarity index 100% rename from docs/guides/mbedos_add_new_target.md rename to docs/platforms/mbedos/mbedos_add_new_target.md diff --git a/docs/guides/mbedos_commissioning.md b/docs/platforms/mbedos/mbedos_commissioning.md similarity index 96% rename from docs/guides/mbedos_commissioning.md rename to docs/platforms/mbedos/mbedos_commissioning.md index 8b6987878a..1d6dc7243c 100644 --- a/docs/guides/mbedos_commissioning.md +++ b/docs/platforms/mbedos/mbedos_commissioning.md @@ -58,7 +58,7 @@ To make provisioning possible and to control the Matter device from your Android based smartphone, you must first build and install the CHIPTool application. To build the CHIPTool application for your smartphone, read -[Android building guide](android_building.md). +[Android building guide](../android/android_building.md). After building, install the application by completing the following steps: @@ -154,7 +154,7 @@ brightness between 0-255. If **Lighting LED** is available then brightness change can be observed. > For more details about Android CHIPTool please visit -> [CHIPTool](../../examples/android/CHIPTool/README.md) +> [CHIPTool](../../../examples/android/CHIPTool/README.md) ## POSIX CLI CHIPTool @@ -164,7 +164,7 @@ To make provisioning possible and to control the Matter device from Linux-based device, you can build and run the Matter Client example application on it. To build the POSIX CLI CHIPTool application check the guide -[POSIX CLI guide](../../examples/chip-tool/README.md). +[POSIX CLI guide](../../../examples/chip-tool/README.md). ### Device commissioning for CLI @@ -196,7 +196,7 @@ For example: The client will send a single command packet and then exit. > For more details about POSIX CLI CHIPTool please visit -> [POSIX CLI CHIPTool](../../examples/chip-tool/README.md) +> [POSIX CLI CHIPTool](../../../examples/chip-tool/README.md) ## Python Device Controller @@ -206,7 +206,7 @@ To make provisioning possible and to control the Matter device with Python application, you can build and run the Python CHIP controller. To build and install the Python Device Controller application check the guide -[Python Device Controller guide](python_chip_controller_building.md). +[Python Device Controller guide](../../development_controllers/chip-repl/python_chip_controller_building.md). ### Device commissioning for Python Device Controller diff --git a/docs/guides/mbedos_platform_overview.md b/docs/platforms/mbedos/mbedos_platform_overview.md similarity index 95% rename from docs/guides/mbedos_platform_overview.md rename to docs/platforms/mbedos/mbedos_platform_overview.md index b70d5ed89c..8cdce2c20c 100644 --- a/docs/guides/mbedos_platform_overview.md +++ b/docs/platforms/mbedos/mbedos_platform_overview.md @@ -85,11 +85,11 @@ needed to perform communication through the Matter stack. Sample Matter applications are provided for the Mbed OS platform. They can be used to speed up development: -- [shell](../../examples/shell/mbed/README.md) -- [all-clusters-app](../../examples/all-clusters-app/mbed/README.md) -- [lock-app](../../examples/lock-app/mbed/README.md) -- [lighting-app](../../examples/lighting-app/mbed/README.md) -- [pigweed-app](../../examples/pigweed-app/mbed/README.md) +- [shell](../../../examples/shell/mbed/README.md) +- [all-clusters-app](../../../examples/all-clusters-app/mbed/README.md) +- [lock-app](../../../examples/lock-app/mbed/README.md) +- [lighting-app](../../../examples/lighting-app/mbed/README.md) +- [pigweed-app](../../../examples/pigweed-app/mbed/README.md) ### Example configuration diff --git a/docs/guides/images/CHIPTool_device_commissioned.png b/docs/platforms/nrf/images/CHIPTool_device_commissioned.png similarity index 100% rename from docs/guides/images/CHIPTool_device_commissioned.png rename to docs/platforms/nrf/images/CHIPTool_device_commissioned.png diff --git a/docs/guides/images/matter_nrfconnect_overview_simplified_ncs.svg b/docs/platforms/nrf/images/matter_nrfconnect_overview_simplified_ncs.svg similarity index 100% rename from docs/guides/images/matter_nrfconnect_overview_simplified_ncs.svg rename to docs/platforms/nrf/images/matter_nrfconnect_overview_simplified_ncs.svg diff --git a/docs/guides/images/nrfconnect_android_connectivity.png b/docs/platforms/nrf/images/nrfconnect_android_connectivity.png similarity index 100% rename from docs/guides/images/nrfconnect_android_connectivity.png rename to docs/platforms/nrf/images/nrfconnect_android_connectivity.png diff --git a/docs/platforms/nrf/index.md b/docs/platforms/nrf/index.md new file mode 100644 index 0000000000..bf74c43fcc --- /dev/null +++ b/docs/platforms/nrf/index.md @@ -0,0 +1,16 @@ +# NRF + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Android Commissioning](./nrfconnect_android_commissioning.md) +[Examples CLI](./nrfconnect_examples_cli.md) +[Examples configuration](./nrfconnect_examples_configuration.md) +[Examples Software update](./nrfconnect_examples_software_update.md) +[Factory data](./nrfconnect_factory_data_configuration.md) +[Platform overview](./nrfconnect_platform_overview.md) diff --git a/docs/guides/nrfconnect_android_commissioning.md b/docs/platforms/nrf/nrfconnect_android_commissioning.md similarity index 94% rename from docs/guides/nrfconnect_android_commissioning.md rename to docs/platforms/nrf/nrfconnect_android_commissioning.md index 0c93f45792..9c6358d501 100644 --- a/docs/guides/nrfconnect_android_commissioning.md +++ b/docs/platforms/nrf/nrfconnect_android_commissioning.md @@ -1,7 +1,7 @@ # Commissioning nRF Connect Accessory using Android CHIPTool -You can use [CHIPTool](android_building.md) for Android smartphones to -commission a Nordic Semiconductor's development kit programmed with a Matter +You can use [CHIPTool](../android/android_building.md) for Android smartphones +to commission a Nordic Semiconductor's development kit programmed with a Matter example for the nRF Connect platform into a Matter fabric. This guide references the nRF52840 DK and Matter nRF Connect Lighting Example @@ -86,9 +86,10 @@ accessory using Android CHIPTool: > _Note:_ This step is only needed if you're testing a Thread device. Skip it if > the tested device operates in a Wi-Fi network. -Follow the [OpenThread Border Router](openthread_border_router_pi.md) article to -set up OpenThread Border Router on the Raspberry Pi, with either the nRF52840 DK -or the nRF52840 Dongle acting as the +Follow the +[OpenThread Border Router](../openthread/openthread_border_router_pi.md) article +to set up OpenThread Border Router on the Raspberry Pi, with either the nRF52840 +DK or the nRF52840 Dongle acting as the [OpenThread Radio Co-Processor](https://openthread.io/platforms/co-processor). During the setup, make sure that the Raspberry Pi is connected to your Wi-Fi Access Point. @@ -107,7 +108,7 @@ Application to learn how to build and program the example onto an nRF52840 DK. ## Building and installing Android CHIPTool To build the CHIPTool application for your smartphone, read the -[Building Android](android_building.md) guide. +[Building Android](../android/android_building.md) guide. After building, install the application by completing the following steps: diff --git a/docs/guides/nrfconnect_examples_cli.md b/docs/platforms/nrf/nrfconnect_examples_cli.md similarity index 100% rename from docs/guides/nrfconnect_examples_cli.md rename to docs/platforms/nrf/nrfconnect_examples_cli.md diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/platforms/nrf/nrfconnect_examples_configuration.md similarity index 100% rename from docs/guides/nrfconnect_examples_configuration.md rename to docs/platforms/nrf/nrfconnect_examples_configuration.md diff --git a/docs/guides/nrfconnect_examples_software_update.md b/docs/platforms/nrf/nrfconnect_examples_software_update.md similarity index 99% rename from docs/guides/nrfconnect_examples_software_update.md rename to docs/platforms/nrf/nrfconnect_examples_software_update.md index d295bae476..5f3ab2055d 100644 --- a/docs/guides/nrfconnect_examples_software_update.md +++ b/docs/platforms/nrf/nrfconnect_examples_software_update.md @@ -17,7 +17,7 @@ protocols: > **_NOTE:_** The procedure presented below requires that you have OpenThread > Border Router (OTBR) set up either in Docker or on a Raspberry Pi. Read -> [Setup OpenThread Border Router on Raspberry Pi](openthread_border_router_pi.md) +> [Setup OpenThread Border Router on Raspberry Pi](../openthread/openthread_border_router_pi.md) > to learn how to install the OTBR on a Raspberry Pi. The DFU over Matter involves two kinds of nodes: @@ -94,7 +94,6 @@ To test the DFU over Matter, you need to complete the following steps: 10. Initiate the DFU procedure in one of the following ways: - - If you have built the device firmware with `-DCONFIG_CHIP_LIB_SHELL=y` option, which enables Matter shell commands, run the following command on the device shell: diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/platforms/nrf/nrfconnect_factory_data_configuration.md similarity index 99% rename from docs/guides/nrfconnect_factory_data_configuration.md rename to docs/platforms/nrf/nrfconnect_factory_data_configuration.md index 886acc9b30..0c3f6c1d47 100644 --- a/docs/guides/nrfconnect_factory_data_configuration.md +++ b/docs/platforms/nrf/nrfconnect_factory_data_configuration.md @@ -813,8 +813,8 @@ Alternatively, you can add the relevant Kconfig option lines to the example's You can edit all configuration options using the interactive Kconfig interface. See the -[Configuring nRF Connect examples](../guides/nrfconnect_examples_configuration.md) -page for information about how to configure Kconfig options. +[Configuring nRF Connect examples](./nrfconnect_examples_configuration.md) page +for information about how to configure Kconfig options. In the configuration window, expand the items `Modules -> connectedhomeip (/home/arbl/matter/connectedhomeip/config/nrfconnect/chip-module) -> Connected Home over IP protocol stack`. diff --git a/docs/guides/nrfconnect_platform_overview.md b/docs/platforms/nrf/nrfconnect_platform_overview.md similarity index 100% rename from docs/guides/nrfconnect_platform_overview.md rename to docs/platforms/nrf/nrfconnect_platform_overview.md diff --git a/docs/guides/nxp/README.md b/docs/platforms/nxp/index.md similarity index 100% rename from docs/guides/nxp/README.md rename to docs/platforms/nxp/index.md diff --git a/docs/guides/nxp/nxp_imx8m_linux_examples.md b/docs/platforms/nxp/nxp_imx8m_linux_examples.md similarity index 100% rename from docs/guides/nxp/nxp_imx8m_linux_examples.md rename to docs/platforms/nxp/nxp_imx8m_linux_examples.md diff --git a/docs/guides/nxp/nxp_k32w0_ota_guide.md b/docs/platforms/nxp/nxp_k32w0_ota_guide.md similarity index 100% rename from docs/guides/nxp/nxp_k32w0_ota_guide.md rename to docs/platforms/nxp/nxp_k32w0_ota_guide.md diff --git a/docs/guides/nxp/nxp_k32w_android_commissioning.md b/docs/platforms/nxp/nxp_k32w_android_commissioning.md similarity index 100% rename from docs/guides/nxp/nxp_k32w_android_commissioning.md rename to docs/platforms/nxp/nxp_k32w_android_commissioning.md diff --git a/docs/guides/nxp/nxp_manufacturing_flow.md b/docs/platforms/nxp/nxp_manufacturing_flow.md similarity index 100% rename from docs/guides/nxp/nxp_manufacturing_flow.md rename to docs/platforms/nxp/nxp_manufacturing_flow.md diff --git a/docs/guides/nxp/nxp_mcxw71_ota_guide.md b/docs/platforms/nxp/nxp_mcxw71_ota_guide.md similarity index 100% rename from docs/guides/nxp/nxp_mcxw71_ota_guide.md rename to docs/platforms/nxp/nxp_mcxw71_ota_guide.md diff --git a/docs/guides/nxp/nxp_otbr_guide.md b/docs/platforms/nxp/nxp_otbr_guide.md similarity index 100% rename from docs/guides/nxp/nxp_otbr_guide.md rename to docs/platforms/nxp/nxp_otbr_guide.md diff --git a/docs/guides/nxp/nxp_rw61x_ota_software_update.md b/docs/platforms/nxp/nxp_rw61x_ota_software_update.md similarity index 100% rename from docs/guides/nxp/nxp_rw61x_ota_software_update.md rename to docs/platforms/nxp/nxp_rw61x_ota_software_update.md diff --git a/docs/guides/nxp/nxp_zephyr_ota_software_update.md b/docs/platforms/nxp/nxp_zephyr_ota_software_update.md similarity index 100% rename from docs/guides/nxp/nxp_zephyr_ota_software_update.md rename to docs/platforms/nxp/nxp_zephyr_ota_software_update.md diff --git a/docs/platforms/openiotsdk/index.md b/docs/platforms/openiotsdk/index.md new file mode 100644 index 0000000000..8bd73c46e1 --- /dev/null +++ b/docs/platforms/openiotsdk/index.md @@ -0,0 +1,15 @@ +# OpenIoTSDK + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Commissioning](./openiotsdk_commissioning.md) +[Examples software update](./openiotsdk_examples_software_update.md) +[Examples](./openiotsdk_examples.md) +[Platform overview](./openiotsdk_platform_overview.md) +[Unit tests](./openiotsdk_unit_tests.md) diff --git a/docs/guides/openiotsdk_commissioning.md b/docs/platforms/openiotsdk/openiotsdk_commissioning.md similarity index 90% rename from docs/guides/openiotsdk_commissioning.md rename to docs/platforms/openiotsdk/openiotsdk_commissioning.md index 520cff033d..969b304228 100644 --- a/docs/guides/openiotsdk_commissioning.md +++ b/docs/platforms/openiotsdk/openiotsdk_commissioning.md @@ -9,11 +9,11 @@ connected to the IP network and do not require credentials provisioning. ## Building Matter controller -The [Matter controller](../../src/controller/README.md) is a client application -that allows commission and control of the Matter node. +The [Matter controller](../../../src/controller/README.md) is a client +application that allows commission and control of the Matter node. -The [POSIX CLI chip-tool](../../examples/chip-tool/README.md) is the recommended -Matter controller to use with Open IoT SDK devices. +The [POSIX CLI chip-tool](../../../examples/chip-tool/README.md) is the +recommended Matter controller to use with Open IoT SDK devices. To build `chip-tool` execute command: diff --git a/docs/guides/openiotsdk_examples.md b/docs/platforms/openiotsdk/openiotsdk_examples.md similarity index 98% rename from docs/guides/openiotsdk_examples.md rename to docs/platforms/openiotsdk/openiotsdk_examples.md index b80ce6304f..c91863a1b7 100644 --- a/docs/guides/openiotsdk_examples.md +++ b/docs/platforms/openiotsdk/openiotsdk_examples.md @@ -22,7 +22,7 @@ You can use these examples as a reference for creating your own applications. The VSCode devcontainer has all the dependencies pre-installed. It is the recommended way to build, run and develop with the Open IoT SDK port of the Matter Project. Please read this -[VSCode development guide](../VSCODE_DEVELOPMENT.md) for more information. +[VSCode development guide](../../VSCODE_DEVELOPMENT.md) for more information. Before building the examples, check out the Matter repository and sync Open IoT SDK submodules using the following command: @@ -347,11 +347,11 @@ provides the `-K,--kvsfile` option to use the persistence options listed above. Open IoT SDK port supports two crypto backend implementations: -- [Mbed TLS](../guides/openiotsdk_platform_overview.md#mbed-tls) - it's the - default option +- [Mbed TLS](./openiotsdk_platform_overview.md#mbed-tls) - it's the default + option - [PSA crypto service](https://tf-m-user-guide.trustedfirmware.org/integration_guide/services/tfm_crypto_integration_guide.html) from the - [TrustedFirmware-M (TF-M)](../guides/openiotsdk_platform_overview.md#trusted-firmware-m) + [TrustedFirmware-M (TF-M)](./openiotsdk_platform_overview.md#trusted-firmware-m) component The CMake variable `CONFIG_CHIP_CRYPTO` controls how cryptographic operations diff --git a/docs/guides/openiotsdk_examples_software_update.md b/docs/platforms/openiotsdk/openiotsdk_examples_software_update.md similarity index 95% rename from docs/guides/openiotsdk_examples_software_update.md rename to docs/platforms/openiotsdk/openiotsdk_examples_software_update.md index 73129b84e5..686d95b8b7 100644 --- a/docs/guides/openiotsdk_examples_software_update.md +++ b/docs/platforms/openiotsdk/openiotsdk_examples_software_update.md @@ -19,12 +19,12 @@ The last required element is a Matter controller. This application controls both nodes and manages the entire software update process. In the procedure described below, the `OTA Provider` will be a -[Linux application](../../examples/ota-provider-app/linux/README.md) and the +[Linux application](../../../examples/ota-provider-app/linux/README.md) and the Open IoT SDK example with [DFU support](./openiotsdk_examples.md#device-firmware-update) will work as the -OTA Requestor. The [chip-tool](../../examples/chip-tool/README.md) application -used as the Matter controller. Each application should be launched in a separate -terminal. +OTA Requestor. The [chip-tool](../../../examples/chip-tool/README.md) +application used as the Matter controller. Each application should be launched +in a separate terminal. List of `OIS` examples that currently support the `DFU` over Matter: @@ -41,7 +41,7 @@ List of `OIS` examples that currently support the `DFU` over Matter: ``` More details about the `OTA provider` application can be found - [here](../../examples/ota-provider-app/linux/README.md). + [here](../../../examples/ota-provider-app/linux/README.md). 3. Build `chip-tool`: @@ -50,7 +50,7 @@ List of `OIS` examples that currently support the `DFU` over Matter: ``` More details about the `chip-tool` application can be found - [here](../../examples/chip-tool/README.md). + [here](../../../examples/chip-tool/README.md). 4. Build `OIS` example application diff --git a/docs/guides/openiotsdk_platform_overview.md b/docs/platforms/openiotsdk/openiotsdk_platform_overview.md similarity index 100% rename from docs/guides/openiotsdk_platform_overview.md rename to docs/platforms/openiotsdk/openiotsdk_platform_overview.md diff --git a/docs/guides/openiotsdk_unit_tests.md b/docs/platforms/openiotsdk/openiotsdk_unit_tests.md similarity index 100% rename from docs/guides/openiotsdk_unit_tests.md rename to docs/platforms/openiotsdk/openiotsdk_unit_tests.md diff --git a/docs/platforms/openthread/index.md b/docs/platforms/openthread/index.md new file mode 100644 index 0000000000..a4926817e2 --- /dev/null +++ b/docs/platforms/openthread/index.md @@ -0,0 +1,12 @@ +# OpenThread + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Border Router](./openthread_border_router_pi.md) +[NRF dongle](./openthread_rcp_nrf_dongle.md) diff --git a/docs/guides/openthread_border_router_pi.md b/docs/platforms/openthread/openthread_border_router_pi.md similarity index 100% rename from docs/guides/openthread_border_router_pi.md rename to docs/platforms/openthread/openthread_border_router_pi.md diff --git a/docs/guides/openthread_rcp_nrf_dongle.md b/docs/platforms/openthread/openthread_rcp_nrf_dongle.md similarity index 100% rename from docs/guides/openthread_rcp_nrf_dongle.md rename to docs/platforms/openthread/openthread_rcp_nrf_dongle.md diff --git a/docs/guides/images/silabs_logo.png b/docs/platforms/silabs/images/silabs_logo.png similarity index 100% rename from docs/guides/images/silabs_logo.png rename to docs/platforms/silabs/images/silabs_logo.png diff --git a/docs/platforms/silabs/index.md b/docs/platforms/silabs/index.md new file mode 100644 index 0000000000..3e743df0cb --- /dev/null +++ b/docs/platforms/silabs/index.md @@ -0,0 +1,14 @@ +# Silabs + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[CLI guide](./silabs_cli_guide.md) +[Common app behavior](./silabs_common_app_behavior.md) +[EFR32 software update](./silabs_efr32_software_update.md) +[Getting Started](./silabs_getting_started.md) diff --git a/docs/guides/silabs_cli_guide.md b/docs/platforms/silabs/silabs_cli_guide.md similarity index 100% rename from docs/guides/silabs_cli_guide.md rename to docs/platforms/silabs/silabs_cli_guide.md diff --git a/docs/guides/silabs_common_app_behavior.md b/docs/platforms/silabs/silabs_common_app_behavior.md similarity index 100% rename from docs/guides/silabs_common_app_behavior.md rename to docs/platforms/silabs/silabs_common_app_behavior.md diff --git a/docs/guides/silabs_efr32_software_update.md b/docs/platforms/silabs/silabs_efr32_software_update.md similarity index 98% rename from docs/guides/silabs_efr32_software_update.md rename to docs/platforms/silabs/silabs_efr32_software_update.md index 9f94753aa7..6bdce3d40d 100644 --- a/docs/guides/silabs_efr32_software_update.md +++ b/docs/platforms/silabs/silabs_efr32_software_update.md @@ -118,7 +118,7 @@ to 2). Starting the ota-provider-app with the --otaImageList command line option allows the user to supply a JSON file specifying the Software Version, Vendor and Product ID that identify the image served by the Provider, see -[ota-provider-app](../../examples/ota-provider-app/linux/README.md) +[ota-provider-app](../../../examples/ota-provider-app/linux/README.md) Example provider configuration file: diff --git a/docs/guides/silabs_getting_started.md b/docs/platforms/silabs/silabs_getting_started.md similarity index 100% rename from docs/guides/silabs_getting_started.md rename to docs/platforms/silabs/silabs_getting_started.md diff --git a/docs/platforms/stm32/index.md b/docs/platforms/stm32/index.md new file mode 100644 index 0000000000..7b0d56ce3e --- /dev/null +++ b/docs/platforms/stm32/index.md @@ -0,0 +1,11 @@ +# ESP32 + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +``` + +[Getting Started Guide](./stm32_getting_started_guide.md) diff --git a/docs/guides/stm32_getting_started_guide.md b/docs/platforms/stm32/stm32_getting_started_guide.md similarity index 98% rename from docs/guides/stm32_getting_started_guide.md rename to docs/platforms/stm32/stm32_getting_started_guide.md index 55f856cbc0..954dde35c0 100644 --- a/docs/guides/stm32_getting_started_guide.md +++ b/docs/platforms/stm32/stm32_getting_started_guide.md @@ -28,7 +28,7 @@ subfolder. ## Building the Example Application -- [Set Up Matter Environment](./BUILDING.md) +- [Set Up Matter Environment](../../guides/BUILDING.md) - Set up STLINK tools diff --git a/docs/guides/images/matter_ti_overview_simplified.png b/docs/platforms/ti/images/matter_ti_overview_simplified.png similarity index 100% rename from docs/guides/images/matter_ti_overview_simplified.png rename to docs/platforms/ti/images/matter_ti_overview_simplified.png diff --git a/docs/guides/images/matter_ti_overview_wifi.png b/docs/platforms/ti/images/matter_ti_overview_wifi.png similarity index 100% rename from docs/guides/images/matter_ti_overview_wifi.png rename to docs/platforms/ti/images/matter_ti_overview_wifi.png diff --git a/docs/platforms/ti/index.md b/docs/platforms/ti/index.md new file mode 100644 index 0000000000..aa49ab94d1 --- /dev/null +++ b/docs/platforms/ti/index.md @@ -0,0 +1,17 @@ +# TI + +```{toctree} +:glob: +:maxdepth: 1 +:hidden: + +* +matter-migration-guide/* +matter-syscfg/* +matter-users-guide/* +``` + +- [Overview](./ti_matter_overview.md) +- [Matter migration guide](./matter-migration-guide/) +- [Syscfg](./matter-syscfg/) +- [User guide](./matter-users-guide/) diff --git a/docs/guides/ti/matter-migration-guide/matter_cc2674_migration.md b/docs/platforms/ti/matter-migration-guide/matter_cc2674_migration.md similarity index 100% rename from docs/guides/ti/matter-migration-guide/matter_cc2674_migration.md rename to docs/platforms/ti/matter-migration-guide/matter_cc2674_migration.md diff --git a/docs/guides/ti/matter-syscfg/getting-started.md b/docs/platforms/ti/matter-syscfg/getting-started.md similarity index 100% rename from docs/guides/ti/matter-syscfg/getting-started.md rename to docs/platforms/ti/matter-syscfg/getting-started.md diff --git a/docs/guides/ti/matter-syscfg/images/board_view.png b/docs/platforms/ti/matter-syscfg/images/board_view.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/board_view.png rename to docs/platforms/ti/matter-syscfg/images/board_view.png diff --git a/docs/guides/ti/matter-syscfg/images/generated_files_ble.png b/docs/platforms/ti/matter-syscfg/images/generated_files_ble.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/generated_files_ble.png rename to docs/platforms/ti/matter-syscfg/images/generated_files_ble.png diff --git a/docs/guides/ti/matter-syscfg/images/hardware_view.png b/docs/platforms/ti/matter-syscfg/images/hardware_view.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/hardware_view.png rename to docs/platforms/ti/matter-syscfg/images/hardware_view.png diff --git a/docs/guides/ti/matter-syscfg/images/reserve-gpio.png b/docs/platforms/ti/matter-syscfg/images/reserve-gpio.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/reserve-gpio.png rename to docs/platforms/ti/matter-syscfg/images/reserve-gpio.png diff --git a/docs/guides/ti/matter-syscfg/images/reserve-peripheral-panel.png b/docs/platforms/ti/matter-syscfg/images/reserve-peripheral-panel.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/reserve-peripheral-panel.png rename to docs/platforms/ti/matter-syscfg/images/reserve-peripheral-panel.png diff --git a/docs/guides/ti/matter-syscfg/images/show_generated_files_tab.png b/docs/platforms/ti/matter-syscfg/images/show_generated_files_tab.png similarity index 100% rename from docs/guides/ti/matter-syscfg/images/show_generated_files_tab.png rename to docs/platforms/ti/matter-syscfg/images/show_generated_files_tab.png diff --git a/docs/guides/ti/matter-syscfg/sysconfig-board.md b/docs/platforms/ti/matter-syscfg/sysconfig-board.md similarity index 100% rename from docs/guides/ti/matter-syscfg/sysconfig-board.md rename to docs/platforms/ti/matter-syscfg/sysconfig-board.md diff --git a/docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md b/docs/platforms/ti/matter-users-guide/enabling_icd_on_ti_devices.md similarity index 100% rename from docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md rename to docs/platforms/ti/matter-users-guide/enabling_icd_on_ti_devices.md diff --git a/docs/guides/ti/matter-users-guide/images/cc13x4_memmap.png b/docs/platforms/ti/matter-users-guide/images/cc13x4_memmap.png similarity index 100% rename from docs/guides/ti/matter-users-guide/images/cc13x4_memmap.png rename to docs/platforms/ti/matter-users-guide/images/cc13x4_memmap.png diff --git a/docs/guides/ti/matter-users-guide/images/factory_data_overview.png b/docs/platforms/ti/matter-users-guide/images/factory_data_overview.png similarity index 100% rename from docs/guides/ti/matter-users-guide/images/factory_data_overview.png rename to docs/platforms/ti/matter-users-guide/images/factory_data_overview.png diff --git a/docs/guides/ti/matter-users-guide/ti_factory_data_user_guide.md b/docs/platforms/ti/matter-users-guide/ti_factory_data_user_guide.md similarity index 100% rename from docs/guides/ti/matter-users-guide/ti_factory_data_user_guide.md rename to docs/platforms/ti/matter-users-guide/ti_factory_data_user_guide.md diff --git a/docs/guides/ti/matter-users-guide/ti_openthread_library_usage.md b/docs/platforms/ti/matter-users-guide/ti_openthread_library_usage.md similarity index 100% rename from docs/guides/ti/matter-users-guide/ti_openthread_library_usage.md rename to docs/platforms/ti/matter-users-guide/ti_openthread_library_usage.md diff --git a/docs/guides/ti/ti_matter_overview.md b/docs/platforms/ti/ti_matter_overview.md similarity index 99% rename from docs/guides/ti/ti_matter_overview.md rename to docs/platforms/ti/ti_matter_overview.md index 44943fa46b..176ea26d95 100644 --- a/docs/guides/ti/ti_matter_overview.md +++ b/docs/platforms/ti/ti_matter_overview.md @@ -103,7 +103,7 @@ by the platform implementation files. Below are several resources available for Matter development: - [Matter Protocol Overview](https://handbook.buildwithmatter.com/howitworks/roles/) -- [Matter Build Guide](../BUILDING.md) +- [Matter Build Guide](../../guides/BUILDING.md) - [Matter over Thread Getting Started](https://dev.ti.com/tirex/explore/node?node=A__AciOYyNq9gli.nsvJzBtQg__com.ti.SIMPLELINK_ACADEMY_CC13XX_CC26XX_SDK__AfkT0vQ__LATEST) - [TI Matter over Wi-Fi Getting Started](https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1122413/faq-cc3235sf-matter----getting-started-guide) - [TI Matter Application Development](https://dev.ti.com/tirex/explore/node?node=A__AXNOPYikmtBCHJ-L6eRivA__com.ti.SIMPLELINK_ACADEMY_CC13XX_CC26XX_SDK__AfkT0vQ__LATEST) diff --git a/docs/testing/python.md b/docs/testing/python.md index a186e9bf20..4541871dcb 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -25,7 +25,7 @@ Python tests located in src/python_testing section should include various parameters and their respective values, which will guide the test runner on how to execute the tests. - All test classes inherit from `MatterBaseTest` in - [matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) + [matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) - Support for commissioning using the python controller - Default controller (`self.default_controller`) of type `ChipDeviceCtrl` - `MatterBaseTest` inherits from the Mobly BaseTestClass @@ -38,7 +38,7 @@ Python tests located in src/python_testing decorated with the @async_test_body decorator - Use `ChipDeviceCtrl` to interact with the DUT - Controller API is in `ChipDeviceCtrl.py` (see API doc in file) - - Some support methods in `matter_testing_support.py` + - Some support methods in `matter_testing.py` - Use Mobly assertions for failing tests - `self.step()` along with a `steps_*` method to mark test plan steps for cert tests @@ -61,7 +61,7 @@ Python tests located in src/python_testing # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -379,7 +379,7 @@ pai = await dev_ctrl.SendCommand(nodeid, 0, Clusters.OperationalCredentials.Comm ## Mobly helpers The test system is based on Mobly, and the -[matter_testing_support.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_support.py) +[matter_testing.py](https://github.com/project-chip/connectedhomeip/blob/master/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py) class provides some helpers for Mobly integration. - `default_matter_test_main` @@ -561,11 +561,11 @@ these steps to set this up: ## Other support utilities -- `basic_composition_support` +- `basic_composition` - wildcard read, whole device analysis - `CommissioningFlowBlocks` - various commissioning support for core tests -- `spec_parsing_support` +- `spec_parsing` - parsing data model XML into python readable format # Running tests locally @@ -594,7 +594,7 @@ Next build the python wheels and create / activate a venv (called `pyenv` here, but any name may be used) ``` -./scripts/build_python.sh -i pyenv +./scripts/build_python.sh -i out/python_env source pyenv/bin/activate ``` @@ -627,7 +627,9 @@ for the CI). These arguments can be passed as sets of key/value pairs using the `./scripts/tests/run_python_test.py` is a convenient script that starts an example DUT on the host and includes factory reset support -`./scripts/tests/run_python_test.py --factoryreset --app --app-args "whatever" --script --script-args "whatever"` +```shell +./scripts/tests/run_python_test.py --factory-reset --app --app-args "whatever" --script --script-args "whatever" +``` # Running tests in CI @@ -678,7 +680,7 @@ for that run, e.g.: # app: ${TYPE_OF_APP} # app-args: # script-args: -# factoryreset: +# factory-reset: # quiet: # === END CI TEST ARGUMENTS === ``` @@ -692,7 +694,7 @@ for that run, e.g.: - Example: `${TYPE_OF_APP}` -- `factoryreset`: Determines whether a factory reset should be performed +- `factory-reset`: Determines whether a factory reset should be performed before the test. - Example: `true` diff --git a/docs/testing/yaml.md b/docs/testing/yaml.md index 9f65b1fed4..e3736d6272 100644 --- a/docs/testing/yaml.md +++ b/docs/testing/yaml.md @@ -334,7 +334,7 @@ Next build the python wheels and create a venv (called `py` here, but any name may be used) ``` -./scripts/build_python.sh -i py +./scripts/build_python.sh -i out/python_env source py/bin/activate ``` diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 1250a60b71..b37e8b2b8b 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -129,7 +129,10 @@ Generally regenerate using one of: | 1294 | 0x50E | AccountLogin | | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | +| 1360 | 0x550 | ZoneManagement | +| 1361 | 0x551 | CameraAvStreamManagement | | 1363 | 0x553 | WebRTCTransportProvider | +| 1364 | 0x554 | WebRTCTransportRequestor | | 1366 | 0x556 | Chime | | 1872 | 0x750 | EcosystemInformation | | 1873 | 0x751 | CommissionerControl | 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 index dbcd306f44..95cd8bc2d0 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/air-purifier-app/linux/README.md b/examples/air-purifier-app/linux/README.md index 2d771bdf5b..377d53a096 100644 --- a/examples/air-purifier-app/linux/README.md +++ b/examples/air-purifier-app/linux/README.md @@ -11,7 +11,7 @@ Temperature Sensor and Endpoint 5 is a Thermostat. 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
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 dd9a87d59d..b9da1aef24 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 @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/air-quality-sensor-app/linux/README.md b/examples/air-quality-sensor-app/linux/README.md index ef90a4bd23..158cd0d2de 100644 --- a/examples/air-quality-sensor-app/linux/README.md +++ b/examples/air-quality-sensor-app/linux/README.md @@ -7,7 +7,7 @@ for Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/air-quality-sensor-app/silabs/README.md b/examples/air-quality-sensor-app/silabs/README.md index d0e89d363d..7279e23457 100644 --- a/examples/air-quality-sensor-app/silabs/README.md +++ b/examples/air-quality-sensor-app/silabs/README.md @@ -330,7 +330,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options 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 2d5c20aee4..45e58fffca 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 @@ -1642,6 +1642,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/all-clusters-app/asr/README.md b/examples/all-clusters-app/asr/README.md index bde062feab..6e31c18ac2 100755 --- a/examples/all-clusters-app/asr/README.md +++ b/examples/all-clusters-app/asr/README.md @@ -15,7 +15,7 @@ control on ASR platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index 0a3145dbc2..8e6ef5a61d 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -4,16 +4,16 @@ A prototype application that demonstrates device commissioning and cluster control. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- - [Cluster control](#cluster-control) -- [Matter OTA guide](../../../docs/guides/esp32/ota.md) -- [RPC console and Device Tracing](../../../docs/guides/esp32/rpc_console.md) +- [Matter OTA guide](../../../docs/platforms/esp32/ota.md) +- [RPC console and Device Tracing](../../../docs/platforms/esp32/rpc_console.md) - [Multiple Network Interfaces](#multiple-network-interfaces) --- diff --git a/examples/all-clusters-app/infineon/psoc6/README.md b/examples/all-clusters-app/infineon/psoc6/README.md index 138f132f7a..b4faa2e9ea 100644 --- a/examples/all-clusters-app/infineon/psoc6/README.md +++ b/examples/all-clusters-app/infineon/psoc6/README.md @@ -126,4 +126,4 @@ commands. These power cycle the BlueTooth hardware and disable BR/EDR mode. For the description of Software Update process with infineon PSoC6 example applications see -[Infineon PSoC6 OTA Software Update](../../../../docs/guides/infineon_psoc6_software_update.md) +[Infineon PSoC6 OTA Software Update](../../../../docs/platforms/infineon/infineon_psoc6_software_update.md) diff --git a/examples/all-clusters-app/mbed/README.md b/examples/all-clusters-app/mbed/README.md index 0952e18914..f5d0a78b29 100644 --- a/examples/all-clusters-app/mbed/README.md +++ b/examples/all-clusters-app/mbed/README.md @@ -225,7 +225,8 @@ the terminal. #### CHIP Tools -Read the [MbedCommissioning](../../../docs/guides/mbedos_commissioning.md) to +Read the +[MbedCommissioning](../../../docs/platforms/mbedos/mbedos_commissioning.md) to see how to use different CHIP tools to commission and control the application within a WiFi network. @@ -239,7 +240,7 @@ within a WiFi network. - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `all-clusters-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/all-clusters-app/nrfconnect/README.md b/examples/all-clusters-app/nrfconnect/README.md index 3a58e448d7..4c51e52a1f 100644 --- a/examples/all-clusters-app/nrfconnect/README.md +++ b/examples/all-clusters-app/nrfconnect/README.md @@ -43,7 +43,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -183,7 +183,7 @@ following states are possible: **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md).
@@ -379,7 +379,7 @@ depending on the selected board: those platforms support the DFU. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -414,19 +414,20 @@ to read more about flashing on the nRF52840 Dongle. ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread network. diff --git a/examples/all-clusters-app/nxp/linux-imx/imx8m/README.md b/examples/all-clusters-app/nxp/linux-imx/imx8m/README.md index e20ff1065d..01941f58e7 100644 --- a/examples/all-clusters-app/nxp/linux-imx/imx8m/README.md +++ b/examples/all-clusters-app/nxp/linux-imx/imx8m/README.md @@ -1,4 +1,4 @@ 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/nxp_imx8m_linux_examples.md) +[README document](../../../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details. diff --git a/examples/all-clusters-app/nxp/rt/rw61x/README.md b/examples/all-clusters-app/nxp/rt/rw61x/README.md index 61d3f00869..df760e864e 100644 --- a/examples/all-clusters-app/nxp/rt/rw61x/README.md +++ b/examples/all-clusters-app/nxp/rt/rw61x/README.md @@ -149,7 +149,7 @@ out/debug/chip-rw61x-all-cluster-example. Optional GN options that can be added when building an application: - To enable the - [secondary network commissioning interface](../../../../../docs/guides/nxp/nxp_otbr_guide.md#using-the-secondary-network-commissioning-interface), + [secondary network commissioning interface](../../../../../docs/platforms/nxp/nxp_otbr_guide.md#using-the-secondary-network-commissioning-interface), the arguments `chip_enable_secondary_nwk_if=true` and `chip_device_config_thread_network_endpoint_id=2` must be added to the _gn gen_ command. Note that this is only supported when building the Matter over @@ -167,16 +167,16 @@ Optional GN options that can be added when building an application: - 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/nxp_manufacturing_flow.md). + [Guide for writing manufacturing data on NXP devices](../../../../../docs/platforms/nxp/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](../../../../../docs/guides/nxp/nxp_rw61x_ota_software_update.md) + [OTA Requestor README](../../../../../docs/platforms/nxp/nxp_rw61x_ota_software_update.md) ## Manufacturing data See -[Guide for writing manufacturing data on NXP devices](../../../../../docs/guides/nxp/nxp_manufacturing_flow.md) +[Guide for writing manufacturing data on NXP devices](../../../../../docs/platforms/nxp/nxp_manufacturing_flow.md) Other comments: @@ -252,7 +252,7 @@ Right click on the Project -> Debug -> As->SEGGER JLink probes -> OK -> Select e 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). +[CHIP Tool guide](../../../../../docs/development_controllers/chip-tool/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 @@ -281,7 +281,7 @@ The "ble-thread" pairing method can be used in order to commission the device. In order to create or join a Thread network on the Matter Border Router, the TBR management cluster or the `otcli` commands from the matter CLI can be used. For more information about using the TBR management cluster follow instructions from -['Using the TBR management cluster'](../../../../../docs/guides/nxp/nxp_otbr_guide.md#using-the-thread-border-router-management-cluster). +['Using the TBR management cluster'](../../../../../docs/platforms/nxp/nxp_otbr_guide.md#using-the-thread-border-router-management-cluster). For more information about using the matter shell, follow instructions from ['Testing the all-clusters application with Matter CLI'](#testing-the-all-clusters-application-with-matter-cli-enabled). @@ -407,7 +407,7 @@ Done 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/nxp_rw61x_ota_software_update.md). +['Matter Over-The-Air Software Update with NXP RW61x example applications'](../../../../../docs/platforms/nxp/nxp_rw61x_ota_software_update.md). @@ -417,4 +417,4 @@ To enable Thread Border Router support see the [build](README.md#building) section. The complete Border Router guide is located -[here](../../../../../docs/guides/nxp/nxp_otbr_guide.md). +[here](../../../../../docs/platforms/nxp/nxp_otbr_guide.md). diff --git a/examples/all-clusters-app/nxp/zephyr/README.md b/examples/all-clusters-app/nxp/zephyr/README.md index 54a06c62c6..d9038b02dd 100644 --- a/examples/all-clusters-app/nxp/zephyr/README.md +++ b/examples/all-clusters-app/nxp/zephyr/README.md @@ -201,14 +201,14 @@ the partition address: please refer to `factory_partition` defined in #### Manually See -[Guide for writing manufacturing data on NXP devices](../../../../docs/guides/nxp/nxp_manufacturing_flow.md) +[Guide for writing manufacturing data on NXP devices](../../../../docs/platforms/nxp/nxp_manufacturing_flow.md) ## OTA Software Update See -[Guide for OTA Software Update on NXP devices using Zephyr SDK](../../../../docs/guides/nxp/nxp_zephyr_ota_software_update.md) +[Guide for OTA Software Update on NXP devices using Zephyr SDK](../../../../docs/platforms/nxp/nxp_zephyr_ota_software_update.md) diff --git a/examples/all-clusters-app/openiotsdk/README.md b/examples/all-clusters-app/openiotsdk/README.md index 269411f9f5..661c331f37 100644 --- a/examples/all-clusters-app/openiotsdk/README.md +++ b/examples/all-clusters-app/openiotsdk/README.md @@ -11,7 +11,7 @@ You can use this example as a reference for creating your own application. For information on how to build, run, test and debug this example and further information about the platform it is run on see -[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). +[Open IoT SDK examples](../../../docs/platforms/openiotsdk/openiotsdk_examples.md). The example name to use in the scripts is `all-clusters-app`. @@ -31,7 +31,7 @@ follow traces in the terminal. ### Commissioning Read the -[Open IoT SDK commissioning guide](../../../docs/guides/openiotsdk_commissioning.md) +[Open IoT SDK commissioning guide](../../../docs/platforms/openiotsdk/openiotsdk_commissioning.md) to see how to use the Matter controller to commission and control the application. 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 3fa32d226a..630f3a6d2e 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 @@ -1557,6 +1557,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/all-clusters-minimal-app/asr/README.md b/examples/all-clusters-minimal-app/asr/README.md index 5160ef5d4d..2a411c728a 100755 --- a/examples/all-clusters-minimal-app/asr/README.md +++ b/examples/all-clusters-minimal-app/asr/README.md @@ -14,7 +14,7 @@ control on ASR platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/all-clusters-minimal-app/esp32/README.md b/examples/all-clusters-minimal-app/esp32/README.md index 6cb3f9093d..4b5ca4ea72 100644 --- a/examples/all-clusters-minimal-app/esp32/README.md +++ b/examples/all-clusters-minimal-app/esp32/README.md @@ -4,16 +4,16 @@ A prototype application that demonstrates device commissioning and cluster control. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- - [Cluster control](#cluster-control) -- [Matter OTA guide](../../../docs/guides/esp32/ota.md) -- [RPC console and Device Tracing](../../../docs/guides/esp32/rpc_console.md) +- [Matter OTA guide](../../../docs/platforms/esp32/ota.md) +- [RPC console and Device Tracing](../../../docs/platforms/esp32/rpc_console.md) --- diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/README.md b/examples/all-clusters-minimal-app/infineon/psoc6/README.md index 80b8e1ceb6..7dc9fccf00 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/README.md +++ b/examples/all-clusters-minimal-app/infineon/psoc6/README.md @@ -126,4 +126,4 @@ commands. These power cycle the BlueTooth hardware and disable BR/EDR mode. For the description of Software Update process with infineon PSoC6 example applications see -[Infineon PSoC6 OTA Software Update](../../../../docs/guides/infineon_psoc6_software_update.md) +[Infineon PSoC6 OTA Software Update](../../../../docs/platforms/infineon/infineon_psoc6_software_update.md) diff --git a/examples/all-clusters-minimal-app/mbed/README.md b/examples/all-clusters-minimal-app/mbed/README.md index d4096cbde2..86226548a9 100644 --- a/examples/all-clusters-minimal-app/mbed/README.md +++ b/examples/all-clusters-minimal-app/mbed/README.md @@ -225,7 +225,8 @@ traces in the terminal. ### CHIP Tools -Read the [MbedCommissioning](../../../docs/guides/mbedos_commissioning.md) to +Read the +[MbedCommissioning](../../../docs/platforms/mbedos/mbedos_commissioning.md) to see how to use different CHIP tools to commission and control the application within a WiFi network. @@ -239,7 +240,7 @@ within a WiFi network. - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `all-clusters-minimal-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be diff --git a/examples/all-clusters-minimal-app/nrfconnect/README.md b/examples/all-clusters-minimal-app/nrfconnect/README.md index 932db10a2f..b9d44a889f 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/README.md +++ b/examples/all-clusters-minimal-app/nrfconnect/README.md @@ -41,7 +41,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -144,7 +144,7 @@ for the predefined period of time (15 minutes by default). **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md).
@@ -371,7 +371,7 @@ depending on the selected board: those platforms support the DFU. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -406,19 +406,20 @@ to read more about flashing on the nRF52840 Dongle. ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread network. diff --git a/examples/all-clusters-minimal-app/nxp/linux-imx/imx8m/README.md b/examples/all-clusters-minimal-app/nxp/linux-imx/imx8m/README.md index e20ff1065d..01941f58e7 100644 --- a/examples/all-clusters-minimal-app/nxp/linux-imx/imx8m/README.md +++ b/examples/all-clusters-minimal-app/nxp/linux-imx/imx8m/README.md @@ -1,4 +1,4 @@ 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/nxp_imx8m_linux_examples.md) +[README document](../../../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details. diff --git a/examples/all-clusters-minimal-app/tizen/BUILD.gn b/examples/all-clusters-minimal-app/tizen/BUILD.gn deleted file mode 100644 index 99f857e863..0000000000 --- a/examples/all-clusters-minimal-app/tizen/BUILD.gn +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") -import("//build_overrides/tizen.gni") - -import("${chip_root}/build/chip/tools.gni") -import("${chip_root}/src/app/common_flags.gni") - -import("${tizen_sdk_build_root}/tizen_sdk.gni") -assert(chip_build_tools) - -source_set("chip-all-clusters-common") { - sources = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", - ] - - deps = [ - "${chip_root}/examples/all-clusters-minimal-app/all-clusters-common", - "${chip_root}/examples/platform/tizen:app-main", - "${chip_root}/src/lib/shell:shell_core", - ] - - include_dirs = - [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include" ] -} - -executable("chip-all-clusters-minimal-app") { - sources = [ - "include/CHIPProjectAppConfig.h", - "src/main.cpp", - ] - - deps = [ - ":chip-all-clusters-common", - "${chip_root}/examples/all-clusters-minimal-app/all-clusters-common", - "${chip_root}/examples/platform/tizen:app-main", - "${chip_root}/src/lib", - ] - - include_dirs = [ - "${chip_root}/examples/all-clusters-app/all-clusters-common/include", - "include", - ] - - output_dir = root_out_dir -} - -tizen_sdk_package("chip-all-clusters-minimal-app:tpk") { - deps = [ - ":chip-all-clusters-minimal-app", - "${chip_root}/examples/platform/tizen:author-certificate-CHIP", - ] - manifest = "tizen-manifest.xml" - sign_security_profile = "CHIP" -} - -group("tizen") { - deps = [ ":chip-all-clusters-minimal-app" ] -} - -group("tizen:tpk") { - deps = [ ":chip-all-clusters-minimal-app:tpk" ] -} - -group("default") { - deps = [ ":tizen" ] -} diff --git a/examples/all-clusters-minimal-app/tizen/src/main.cpp b/examples/all-clusters-minimal-app/tizen/src/main.cpp deleted file mode 100644 index 2d37747fe8..0000000000 --- a/examples/all-clusters-minimal-app/tizen/src/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using namespace chip; -using namespace chip::app; -using namespace chip::DeviceLayer; - -// Network commissioning -namespace { -constexpr EndpointId kNetworkCommissioningEndpointMain = 0; -constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; - -NetworkCommissioning::TizenEthernetDriver sEthernetDriver; -Clusters::ModeSelect::StaticSupportedModesManager sStaticSupportedModesManager; -Clusters::NetworkCommissioning::Instance sEthernetNetworkCommissioningInstance(kNetworkCommissioningEndpointMain, &sEthernetDriver); -} // namespace - -void ApplicationInit() -{ - // Enable secondary endpoint only when we need it. - emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); - - sEthernetNetworkCommissioningInstance.Init(); - Clusters::ModeSelect::setSupportedModesManager(&sStaticSupportedModesManager); -} - -void ApplicationShutdown(){}; - -int main(int argc, char * argv[]) -{ - TizenServiceAppMain app; - VerifyOrDie(app.Init(argc, argv) == 0); - - VerifyOrDie(InitBindingHandlers() == CHIP_NO_ERROR); - - return app.RunMainLoop(); -} diff --git a/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml b/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml deleted file mode 100644 index cbd365aec7..0000000000 --- a/examples/all-clusters-minimal-app/tizen/tizen-manifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - http://tizen.org/privilege/bluetooth - http://tizen.org/privilege/internet - http://tizen.org/privilege/network.get - http://tizen.org/privilege/network.set - http://tizen.org/privilege/network.profile - - true - true - true - true - true - diff --git a/examples/android/CHIPTool/README.md b/examples/android/CHIPTool/README.md index cbd0caa598..415dc467d8 100644 --- a/examples/android/CHIPTool/README.md +++ b/examples/android/CHIPTool/README.md @@ -15,4 +15,5 @@ CHIPTool offers the following features: > pairing is implemented. For information about how to build the application, see the -[Building Android CHIPTool](../../../docs/guides/android_building.md) guide. +[Building Android CHIPTool](../../../docs/platforms/android/android_building.md) +guide. diff --git a/examples/bridge-app/asr/README.md b/examples/bridge-app/asr/README.md index 1986037085..1d29b4f5e3 100755 --- a/examples/bridge-app/asr/README.md +++ b/examples/bridge-app/asr/README.md @@ -26,7 +26,7 @@ cluster have been added as endpoints ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 89941b6f60..6241e8c635 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1192,6 +1192,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2677,7 +2678,7 @@ endpoint 2 { } server cluster LevelControl { - persist attribute currentLevel default = 0x00; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 5b820fd57c..bf78875444 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -5079,7 +5079,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/bridge-app/esp32/README.md b/examples/bridge-app/esp32/README.md index ac22c7f8b3..1d34ac6da4 100644 --- a/examples/bridge-app/esp32/README.md +++ b/examples/bridge-app/esp32/README.md @@ -1,9 +1,9 @@ # Matter ESP32 Bridge App Example Please -[setup ESP-IDF and Matter Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and Matter Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- diff --git a/examples/chef/common/chef-concentration-measurement.cpp b/examples/chef/common/chef-concentration-measurement.cpp index d168b797b9..a23e66561d 100644 --- a/examples/chef/common/chef-concentration-measurement.cpp +++ b/examples/chef/common/chef-concentration-measurement.cpp @@ -76,17 +76,8 @@ Protocols::InteractionModel::Status chefConcentrationMeasurementWriteCallback( if (attributeId == measuredValueId) { - float newValue = 0; - uint16_t tlvLen = *(uint16_t *) buffer; - chip::TLV::TLVReader reader; - reader.Init(buffer + sizeof(uint16_t), tlvLen); - reader.Next(); - reader.Get(newValue); - - ChipLogDetail(DeviceLayer, "TLV Type %d, Length %d \n", static_cast(reader.GetType()), tlvLen); - // 2 bytes buf length + 5 bytes TLV for float - ChipLogDetail(DeviceLayer, "buffer: %02x%02x%02x%02x%02x%02x%02x \n", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], - buffer[5], buffer[6]); + float newValue; + std::memcpy(&newValue, buffer, sizeof(float)); // Copy buffer content to float CHIP_ERROR err = clusterInstance->SetMeasuredValue(MakeNullable(newValue)); if (CHIP_NO_ERROR == err) diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index b2a08e643c..9a91b17a2a 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2270,7 +2271,7 @@ endpoint 1 { } server cluster LevelControl { - ram attribute currentLevel default = 0x01; + ram attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 5f2e2bd0eb..c72734d55c 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -4206,7 +4206,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index c6d30a8265..6dc1faa51f 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -811,6 +811,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 0069c9881f..8271fefe26 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 @@ -662,6 +662,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index e810c5332a..cfdae69816 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 20a5e81798..0bf91385a5 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -936,6 +936,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 871fc21daa..5f0c6496f8 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2299,7 +2300,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x00; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x1; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 24f3246bce..fc2f45d22b 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -2885,7 +2885,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 772daa2010..77375d8443 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index a25cc32ae1..5265088575 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1096,6 +1096,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 62df14dd5c..57166f3ba4 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2081,7 +2082,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index 78ea7d8764..2e215aa472 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -2943,7 +2943,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 788fdf8d74..44865e71f3 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2242,7 +2243,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap index 4fa09375fd..3ba91647fa 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap @@ -2991,7 +2991,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index fdbb4868a3..8f49c108e2 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -700,6 +700,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 4655c61d4d..c461e7324c 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -998,6 +998,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 95ba0c27de..71363c84a7 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2342,7 +2343,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 19288d4d83..c5008df0c2 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -2911,7 +2911,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index de277d25e7..d772e29c3c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index ce817d5365..466dbe2c41 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 88f1d2389d..ba63c3ee07 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -844,6 +844,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 18764919ac..60699fd679 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -844,6 +844,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 32e64fc401..36a655d47d 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 11390f7cc5..e633b0f2be 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_laundrydryer_01796fe396.matter b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter index 4c5010e278..b917fa102e 100644 --- a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter +++ b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter @@ -700,6 +700,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 4ab9ad0064..e595c866c2 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index fdeb9a209c..32528515cf 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index bb47238f4c..04cf5fb646 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index f755ba75a5..c4cc8357d9 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2014,7 +2015,7 @@ endpoint 13 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index d77eca38e6..36b41b59f1 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -2911,7 +2911,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 3fa6833ee3..f7db9d69ae 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1034,6 +1034,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2046,7 +2047,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index bf7bb8efdf..23543f053d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -2911,7 +2911,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 8eeb66e2e5..81fb81958f 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -909,6 +909,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 7251ede5ed..94414ae316 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -909,6 +909,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 993bc43a5a..43e8de7b5f 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index aee0aa7b2e..8ea352ca7c 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -683,6 +683,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 84d57e7d21..5b2371526d 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -683,6 +683,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 00bf68f859..80faecb735 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index 1306114cc1..b4094e13d8 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 4910c3b699..3ebdc0a231 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -734,6 +734,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index b685a6740f..1f6e1c17b7 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index c2b2056aae..c5a1ccc522 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 64a2449991..6199388887 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 8303eef5ee..7993032488 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -898,6 +898,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_waterleakdetector_0b067acfa3.matter b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter index a2cf704eaa..bd89a85312 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter @@ -921,6 +921,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_waterleakdetector_0b067acfa3.zap b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap index 11ebd3c2e3..34e2b90f20 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.zap @@ -3062,4 +3062,4 @@ "parentEndpointIdentifier": 0 } ] -} +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter index 139d5dc6a2..cf3009d291 100644 --- a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter +++ b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter @@ -861,6 +861,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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_watervalve_6bb39f1f67.zap b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.zap index 6650dbe1d5..ba64c26fcf 100644 --- a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.zap +++ b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.zap @@ -2983,4 +2983,4 @@ "parentEndpointIdentifier": 0 } ] -} +} \ 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 62c95a2df6..0f1d25c571 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -837,6 +837,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index 7ad3cf5148..421ab3e37c 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -4522,7 +4522,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -4554,7 +4554,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "0x01", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chip-tool/README.md b/examples/chip-tool/README.md index f702e202ac..b9d5f148df 100644 --- a/examples/chip-tool/README.md +++ b/examples/chip-tool/README.md @@ -599,4 +599,4 @@ Usage: To learn more about the tool, how to build it, use its commands and advanced features, read the following guide: -- [Working with the CHIP Tool](https://github.com/project-chip/connectedhomeip/tree/master/docs/guides/chip_tool_guide.md) +- [Working with the CHIP Tool](https://github.com/project-chip/connectedhomeip/tree/master/docs/development_controllers/chip-tool/chip_tool_guide.md) diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h index e6a392cbee..e514e34321 100644 --- a/examples/chip-tool/commands/common/Commands.h +++ b/examples/chip-tool/commands/common/Commands.h @@ -29,7 +29,7 @@ class Commands { public: - using CommandsVector = ::std::vector>; + using CommandsVector = std::vector>; void RegisterCluster(const char * clusterName, commands_list commandsList) { diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py index 68effa7bb3..733672dc79 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py @@ -155,6 +155,7 @@ class Converter(): def __init__(self, specifications): self.__specs = specifications self.__converters = [ + DarwinAnyFormatConverter(), StructFieldsNameConverter(), FloatConverter(), OctetStringConverter() @@ -252,6 +253,43 @@ def maybe_convert(self, typename: str, value): return value +class DarwinAnyFormatConverter(BaseConverter): + """ + Darwin payloads format for *ById commands is different from the base + format used for other commands. + """ + + def run(self, specs, value, cluster_name: str, typename: str, array: bool): + if isinstance(value, list) and len(value) >= 1 and isinstance(value[0], dict) and value[0].get('data') is not None: + value = [self.__convert(item_value) for item_value in value] + return value + + def __convert(self, value): + if not isinstance(value, dict): + return value + + data = value.get('data') + if not isinstance(data, dict): + return value + + value = data.get('value') + if not isinstance(value, list): + return value + + value_type = data.get('type') + + if value_type == 'Structure': + struct = {} + for field in value: + context_tag = field.get('contextTag') + struct[str(context_tag)] = self.__convert(field) + value = struct + elif value_type == 'Array': + value = [self.__convert(item_value) for item_value in value] + + return value + + class FloatConverter(BaseConverter): """ Jsoncpp stores floats as double. @@ -348,7 +386,14 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool): del value[key_name] elif isinstance(value, list) and array: - value = [self.run(specs, v, cluster_name, typename, False) + # Instead of using `False` for the last parameter (array), `isinstance(v, list)` is used. + # While the data model specification does not include lists of lists, the format returned + # by the Matter.framework for *ById APIs may contain them. + # For example, the command: + # darwin-framework-tool any read-by-id 29 0 0x12344321 65535 + # returns value such as: + # [[{'DeviceType': 17, 'Revision': 1}, {'DeviceType': 22, 'Revision': 1}], ...] + value = [self.run(specs, v, cluster_name, typename, isinstance(v, list)) for v in value] return value diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 252d23c037..6b1bf1a6e0 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -510,7 +510,16 @@ def __get_alias(self, cluster_name: str, command_name: str = None, argument_name if aliases is None or aliases.get(argument_name) is None: return None - return aliases.get(argument_name) + value = aliases.get(argument_name) + + if cluster_name == '*' and self.__is_darwin_framework_tool: + if argument_name == 'AttributeId': + return 'attribute-id' + elif argument_name == 'ClusterId': + return 'cluster-id' + elif argument_name == 'Value': + return 'attribute-value' + return value def _supports_endpoint(self, request): return self._has_support(request, 'has_endpoint') diff --git a/examples/common/pigweed/protos/attributes_service.proto b/examples/common/pigweed/protos/attributes_service.proto index 927f10a8aa..ef34448f93 100644 --- a/examples/common/pigweed/protos/attributes_service.proto +++ b/examples/common/pigweed/protos/attributes_service.proto @@ -219,6 +219,7 @@ message AttributeData { int32 data_int8 = 6; int32 data_int16 = 7; int32 data_int32 = 8; + float data_single = 10; }; optional bytes tlv_data = 9; } diff --git a/examples/common/pigweed/rpc_services/Attributes.h b/examples/common/pigweed/rpc_services/Attributes.h index e246c5361b..e4ced64a51 100644 --- a/examples/common/pigweed/rpc_services/Attributes.h +++ b/examples/common/pigweed/rpc_services/Attributes.h @@ -22,6 +22,7 @@ #include "pigweed/rpc_services/internal/StatusUtils.h" #include +#include #include #include #include @@ -32,6 +33,13 @@ #include #include +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +#include +#include +#include +#include +#endif + namespace chip { namespace rpc { @@ -70,6 +78,9 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service case chip_rpc_AttributeData_data_bytes_tag: data = &request.data.data.data_bytes; break; + case chip_rpc_AttributeData_data_single_tag: + data = &request.data.data.data_single; + break; default: return pw::Status::InvalidArgument(); } @@ -125,6 +136,10 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service PW_TRY(TlvBufferGetData(tlvBuffer, TLV::kTLVType_SignedInteger, response.data.data_int32)); response.which_data = chip_rpc_AttributeData_data_int32_tag; break; + case chip_rpc_AttributeType_ZCL_SINGLE_ATTRIBUTE_TYPE: + PW_TRY(TlvBufferGetData(tlvBuffer, TLV::kTLVType_FloatingPointNumber, response.data.data_single)); + response.which_data = chip_rpc_AttributeData_data_single_tag; + break; case chip_rpc_AttributeType_ZCL_BITMAP8_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_BITMAP16_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_BITMAP32_ATTRIBUTE_TYPE: @@ -140,7 +155,6 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service case chip_rpc_AttributeType_ZCL_INT48S_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_INT56S_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_INT64S_ATTRIBUTE_TYPE: - case chip_rpc_AttributeType_ZCL_SINGLE_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_DOUBLE_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_OCTET_STRING_ATTRIBUTE_TYPE: case chip_rpc_AttributeType_ZCL_CHAR_STRING_ATTRIBUTE_TYPE: @@ -202,7 +216,37 @@ class Attributes : public pw_rpc::nanopb::Attributes::Service writer.Init(tlvBuffer); PW_TRY(ChipErrorToPwStatus(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer))); PW_TRY(ChipErrorToPwStatus(attributeReports.Init(&writer, kReportContextTag))); + +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + // TODO: this assumes a singleton data model provider + app::DataModel::Provider * provider = app::InteractionModelEngine::GetInstance()->GetDataModelProvider(); + + app::DataModel::ReadAttributeRequest request; + request.path = path; + request.operationFlags.Set(app::DataModel::OperationFlags::kInternal); + request.subjectDescriptor = subjectDescriptor; + + std::optional info = provider->GetClusterInfo(path); + if (!info.has_value()) + { + return ::pw::Status::NotFound(); + } + + app::AttributeValueEncoder encoder(attributeReports, subjectDescriptor, path, info->dataVersion, + false /* isFabricFiltered */, nullptr /* attributeEncodingState */); + app::DataModel::ActionReturnStatus result = provider->ReadAttribute(request, encoder); + + if (!result.IsSuccess()) + { + app::DataModel::ActionReturnStatus::StringStorage storage; + ChipLogError(Support, "Failed to read data: %s", result.c_str(storage)); + return ::pw::Status::Internal(); + } + +#else PW_TRY(ChipErrorToPwStatus(app::ReadSingleClusterData(subjectDescriptor, false, path, attributeReports, nullptr))); +#endif + attributeReports.EndOfContainer(); PW_TRY(ChipErrorToPwStatus(writer.EndContainer(outer))); PW_TRY(ChipErrorToPwStatus(writer.Finalize())); 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 38c1707110..55820ca537 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 @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/contact-sensor-app/linux/README.md b/examples/contact-sensor-app/linux/README.md index e71ea89feb..ca5ca7b63a 100644 --- a/examples/contact-sensor-app/linux/README.md +++ b/examples/contact-sensor-app/linux/README.md @@ -7,7 +7,7 @@ document is tested on **Ubuntu for Raspberry Pi Server 20.04 LTS (aarch64)** and To cross-compile this example on an x64 host and run it on **NXP i.MX 8M Mini** **EVK**, see the associated -[README document](../../../docs/guides/nxp/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/contact-sensor-app/nxp/README.md b/examples/contact-sensor-app/nxp/README.md index 20474bea76..803f067ce3 100644 --- a/examples/contact-sensor-app/nxp/README.md +++ b/examples/contact-sensor-app/nxp/README.md @@ -136,7 +136,7 @@ corresponding to data model target. Use `chip_with_factory_data=1` in the gn build command to enable factory data. For a full guide on manufacturing flow, please see -[Guide for writing manufacturing data on NXP devices](../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../docs/platforms/nxp/nxp_manufacturing_flow.md). ### Long Idle Time ICD Support diff --git a/examples/contact-sensor-app/nxp/k32w0/README.md b/examples/contact-sensor-app/nxp/k32w0/README.md index 305aa0b176..bc39009afc 100644 --- a/examples/contact-sensor-app/nxp/k32w0/README.md +++ b/examples/contact-sensor-app/nxp/k32w0/README.md @@ -351,7 +351,7 @@ Please use the following build args: ## Manufacturing data See -[Guide for writing manufacturing data on NXP devices](../../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../../docs/platforms/nxp/nxp_manufacturing_flow.md). There are factory data generated binaries available in `third_party/nxp/nxp_matter_support/examples/platform/k32w0/scripts/demo_generated_factory_data` @@ -618,7 +618,7 @@ internal flash space can be found in the The steps for building the SSBL binary with appropriate configuration and writing to the board the binary and other OTA related configurations are described in the -[K32W0x1 OTA guide](../../../../docs/guides/nxp/nxp_k32w0_ota_guide.md). +[K32W0x1 OTA guide](../../../../docs/platforms/nxp/nxp_k32w0_ota_guide.md). Note that the application needs to be built using the `chip_enable_ota_requestor=true` option. This is enabled in the configuration by diff --git a/examples/contact-sensor-app/nxp/k32w1/README.md b/examples/contact-sensor-app/nxp/k32w1/README.md index 5f47979e2d..20feba0c01 100644 --- a/examples/contact-sensor-app/nxp/k32w1/README.md +++ b/examples/contact-sensor-app/nxp/k32w1/README.md @@ -165,4 +165,4 @@ Run -> Debug Configurations... -> C/C++ Application ## OTA Please see -[k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[k32w1 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/contact-sensor-app/nxp/mcxw71/README.md b/examples/contact-sensor-app/nxp/mcxw71/README.md index 50d33e10e1..d5b1927722 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/README.md +++ b/examples/contact-sensor-app/nxp/mcxw71/README.md @@ -191,4 +191,4 @@ Run -> Debug Configurations... -> C/C++ Application ## OTA Please see -[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[mcxw71 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index aeb4a47927..a5e91d91f1 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap index f2e73f974c..dfbd44ad6e 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap @@ -4315,4 +4315,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index bbf9333d9b..36db43dcb6 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -739,6 +739,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 665dccf484..0d1e142f10 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -43,6 +43,9 @@ declare_args() { # Disable generating compiler database by default generate_compilation_database = false + + # Enable automatic leak checks before the application exits + enable_leak_checking = false } sdk = "macosx" @@ -187,10 +190,16 @@ executable("darwin-framework-tool") { "commands/common/CHIPCommandBridge.mm", "commands/common/CHIPCommandStorageDelegate.mm", "commands/common/CHIPToolKeypair.mm", + "commands/common/CertificateIssuer.h", + "commands/common/CertificateIssuer.mm", + "commands/common/ControllerStorage.h", + "commands/common/ControllerStorage.mm", "commands/common/MTRDevice_Externs.h", "commands/common/MTRError.mm", "commands/common/MTRError_Utils.h", "commands/common/MTRLogging.h", + "commands/common/PreferencesStorage.h", + "commands/common/PreferencesStorage.mm", "commands/common/RemoteDataModelLogger.h", "commands/common/RemoteDataModelLogger.mm", "commands/configuration/Commands.h", @@ -206,6 +215,11 @@ executable("darwin-framework-tool") { "commands/discover/Commands.h", "commands/discover/DiscoverCommissionablesCommand.h", "commands/discover/DiscoverCommissionablesCommand.mm", + "commands/memory/Commands.h", + "commands/memory/DumpMemoryGraphCommand.h", + "commands/memory/DumpMemoryGraphCommand.mm", + "commands/memory/LeaksTool.h", + "commands/memory/LeaksTool.mm", "commands/pairing/Commands.h", "commands/pairing/DeviceControllerDelegateBridge.mm", "commands/pairing/GetCommissionerNodeIdCommand.h", @@ -219,6 +233,7 @@ executable("darwin-framework-tool") { "commands/provider/OTASoftwareUpdateInteractive.mm", "commands/storage/Commands.h", "commands/storage/StorageManagementCommand.mm", + "debug/LeakChecker.mm", "logging/logging.mm", "main.mm", ] @@ -280,6 +295,10 @@ executable("darwin-framework-tool") { defines += [ "MTR_ENABLE_PROVISIONAL=1" ] } + if (enable_leak_checking) { + defines += [ "DFT_ENABLE_LEAK_CHECKING=1" ] + } + public_configs = [ ":config" ] output_dir = root_out_dir diff --git a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h index 4512bf219a..7bf34f11a6 100644 --- a/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ClusterCommandBridge.h @@ -73,10 +73,13 @@ class ClusterCommand : public ModelCommand { uint16_t __block responsesNeeded = repeatCount; dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(clusterId); + __auto_type * command = @(commandId); while (repeatCount--) { - [device invokeCommandWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:clusterId] - commandID:[NSNumber numberWithUnsignedInteger:commandId] + [device invokeCommandWithEndpointID:endpoint + clusterID:cluster + commandID:command commandFields:commandFields timedInvokeTimeout:mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] @@ -88,6 +91,9 @@ class ClusterCommand : public ModelCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(endpoint, cluster, command, error); + } else { + RemoteDataModelLogger::LogCommandAsJSON(endpoint, cluster, command, values); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); diff --git a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h index c0cbdab840..1a2612b7e3 100644 --- a/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ReportCommandBridge.h @@ -57,20 +57,26 @@ class ReadAttribute : public ModelCommand { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } + + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); [device - readAttributesWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:mClusterId] - attributeID:[NSNumber numberWithUnsignedInteger:mAttributeId] + readAttributesWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute params:params queue:callbackQueue completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { if (error != nil) { LogNSError("Error reading attribute", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); }]; @@ -137,16 +143,23 @@ class SubscribeAttribute : public ModelCommand { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [device subscribeToAttributesWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:mClusterId] - attributeID:[NSNumber numberWithUnsignedInteger:mAttributeId] + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); + [device subscribeToAttributesWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute params:params queue:callbackQueue reportHandler:^(NSArray *> * _Nullable values, NSError * _Nullable error) { + if (error != nil) { + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); + } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); } diff --git a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h index e771316adf..66003042cc 100644 --- a/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/WriteAttributeCommandBridge.h @@ -74,10 +74,13 @@ class WriteAttribute : public ModelCommand { { dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * endpoint = @(endpointId); + __auto_type * cluster = @(mClusterId); + __auto_type * attribute = @(mAttributeId); [device - writeAttributeWithEndpointID:[NSNumber numberWithUnsignedShort:endpointId] - clusterID:[NSNumber numberWithUnsignedInteger:clusterId] - attributeID:[NSNumber numberWithUnsignedInteger:attributeId] + writeAttributeWithEndpointID:endpoint + clusterID:cluster + attributeID:attribute value:value timedWriteTimeout:mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] @@ -86,11 +89,13 @@ class WriteAttribute : public ModelCommand { completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { if (error != nil) { LogNSError("Error writing attribute", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(endpoint, cluster, attribute, error); } if (values) { for (id item in values) { NSLog(@"Response Item: %@", [item description]); } + RemoteDataModelLogger::LogAttributeAsJSON(endpoint, cluster, attribute, values); } SetCommandExitStatus(error); }]; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index 9458d304db..f58251bff4 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -41,6 +41,8 @@ class CHIPCommandBridge : public Command { "Sets the commissioner node ID of the given " "commissioner-name. Interactive mode will only set a single commissioner on the inital command. " "The commissioner node ID will be persisted until a different one is specified."); + AddArgument("commissioner-shared-storage", 0, 1, &mCommissionerSharedStorage, + "Use a shared storage instance instead of individual storage for each commissioner. Default is true."); AddArgument("paa-trust-store-path", &mPaaTrustStorePath, "Path to directory holding PAA certificate information. Can be absolute or relative to the current working " "directory."); @@ -87,6 +89,7 @@ class CHIPCommandBridge : public Command { // This method returns the commissioner instance to be used for running the command. MTRDeviceController * CurrentCommissioner(); + NSNumber * CurrentCommissionerFabricId(); MTRDeviceController * GetCommissioner(const char * identity); @@ -130,6 +133,8 @@ class CHIPCommandBridge : public Command { void StopWaiting(); CHIP_ERROR MaybeSetUpStack(); + CHIP_ERROR SetUpStackWithSharedStorage(NSArray * productAttestationAuthorityCertificates); + CHIP_ERROR SetUpStackWithPerControllerStorage(NSArray * productAttestationAuthorityCertificates); void MaybeTearDownStack(); CHIP_ERROR GetPAACertsFromFolder(NSArray * __autoreleasing * paaCertsResult); @@ -140,6 +145,9 @@ class CHIPCommandBridge : public Command { // The current controller; the one the current command should be using. MTRDeviceController * mCurrentController; + static bool sUseSharedStorage; + chip::Optional mCommissionerSharedStorage; + std::condition_variable cvWaitingForResponse; std::mutex cvWaitingForResponseMutex; chip::Optional mCommissionerName; @@ -148,4 +156,5 @@ class CHIPCommandBridge : public Command { static dispatch_queue_t mOTAProviderCallbackQueue; chip::Optional mPaaTrustStorePath; chip::Optional mCommissionerVendorId; + std::string mCurrentIdentity; }; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 8b9a5d3e9f..724a9a20c3 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -23,7 +23,11 @@ #include #include +#include // for chip::kTestControllerNodeId +#import "CHIPCommandStorageDelegate.h" +#import "CertificateIssuer.h" +#import "ControllerStorage.h" #include "MTRError_Utils.h" #include @@ -34,37 +38,45 @@ std::map CHIPCommandBridge::mControllers; dispatch_queue_t CHIPCommandBridge::mOTAProviderCallbackQueue; OTAProviderDelegate * CHIPCommandBridge::mOTADelegate; +bool CHIPCommandBridge::sUseSharedStorage = true; constexpr char kTrustStorePathVariable[] = "PAA_TRUST_STORE_PATH"; -CHIPToolKeypair * gNocSigner = [[CHIPToolKeypair alloc] init]; - CHIP_ERROR CHIPCommandBridge::Run() { - ChipLogProgress(chipTool, "Running Command"); - ReturnErrorOnFailure(MaybeSetUpStack()); - SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); + // In interactive mode, we want to avoid memory accumulating in the main autorelease pool, + // so we clear it after each command. + @autoreleasepool { + ChipLogProgress(chipTool, "Running Command"); + // Although the body of `Run` is within its own autorelease pool, this code block is further wrapped + // in an additional autorelease pool. This ensures that when the memory dump graph command is used directly, + // we can verify there’s no additional noise from the autorelease pools—a kind of sanity check. + @autoreleasepool { + ReturnErrorOnFailure(MaybeSetUpStack()); + } + SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); - { - std::lock_guard lk(cvWaitingForResponseMutex); - mWaitingForResponse = YES; - } + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = YES; + } - ReturnLogErrorOnFailure(RunCommand()); + ReturnLogErrorOnFailure(RunCommand()); - auto err = StartWaiting(GetWaitDuration()); + auto err = StartWaiting(GetWaitDuration()); - bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); + bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); - Shutdown(); + Shutdown(); - if (deferCleanup) { - sDeferredCleanups.insert(this); - } else { - Cleanup(); - } - MaybeTearDownStack(); + if (deferCleanup) { + sDeferredCleanups.insert(this); + } else { + Cleanup(); + } + MaybeTearDownStack(); - return err; + return err; + } } CHIP_ERROR CHIPCommandBridge::GetPAACertsFromFolder(NSArray * __autoreleasing * paaCertsResult) @@ -111,61 +123,113 @@ CHIP_ERROR CHIPCommandBridge::MaybeSetUpStack() { - if (IsInteractive()) { - return CHIP_NO_ERROR; - } - NSData * ipk; - gNocSigner = [[CHIPToolKeypair alloc] init]; - storage = [[CHIPToolPersistentStorageDelegate alloc] init]; + VerifyOrReturnError(!IsInteractive(), CHIP_NO_ERROR); mOTADelegate = [[OTAProviderDelegate alloc] init]; + storage = [[CHIPToolPersistentStorageDelegate alloc] init]; - auto factory = [MTRDeviceControllerFactory sharedInstance]; - if (factory == nil) { - ChipLogError(chipTool, "Controller factory is nil"); - return CHIP_ERROR_INTERNAL; + NSError * error; + __auto_type * certificateIssuer = [CertificateIssuer sharedInstance]; + [certificateIssuer startWithStorage:storage error:&error]; + VerifyOrReturnError(nil == error, MTRErrorToCHIPErrorCode(error), ChipLogError(chipTool, "Can not start the certificate issuer: %@", error)); + + NSArray * productAttestationAuthorityCertificates = nil; + ReturnLogErrorOnFailure(GetPAACertsFromFolder(&productAttestationAuthorityCertificates)); + if ([productAttestationAuthorityCertificates count] == 0) { + productAttestationAuthorityCertificates = nil; } - auto params = [[MTRDeviceControllerFactoryParams alloc] initWithStorage:storage]; - params.shouldStartServer = YES; - params.otaProviderDelegate = mOTADelegate; - NSArray * paaCertResults; - ReturnLogErrorOnFailure(GetPAACertsFromFolder(&paaCertResults)); - if ([paaCertResults count] > 0) { - params.productAttestationAuthorityCertificates = paaCertResults; + sUseSharedStorage = mCommissionerSharedStorage.ValueOr(true); + if (sUseSharedStorage) { + return SetUpStackWithSharedStorage(productAttestationAuthorityCertificates); } - NSError * error; - if ([factory startControllerFactory:params error:&error] == NO) { - ChipLogError(chipTool, "Controller factory startup failed"); - return MTRErrorToCHIPErrorCode(error); + return SetUpStackWithPerControllerStorage(productAttestationAuthorityCertificates); +} + +CHIP_ERROR CHIPCommandBridge::SetUpStackWithPerControllerStorage(NSArray * productAttestationAuthorityCertificates) +{ + __auto_type * certificateIssuer = [CertificateIssuer sharedInstance]; + + constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; + std::string commissionerName = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha; + for (size_t i = 0; i < ArraySize(identities); ++i) { + __auto_type * uuidString = [NSString stringWithFormat:@"%@%@", @"8DCADB14-AF1F-45D0-B084-00000000000", @(i)]; + __auto_type * controllerId = [[NSUUID alloc] initWithUUIDString:uuidString]; + __auto_type * vendorId = @(mCommissionerVendorId.ValueOr(chip::VendorId::TestVendor1)); + __auto_type * fabricId = @(i + 1); + __auto_type * nodeId = @(chip::kTestControllerNodeId); + + if (commissionerName.compare(identities[i]) == 0 && mCommissionerNodeId.HasValue()) { + nodeId = @(mCommissionerNodeId.Value()); + } + + __auto_type * controllerStorage = [[ControllerStorage alloc] initWithControllerID:controllerId]; + + NSError * error; + __auto_type * operationalKeypair = [certificateIssuer issueOperationalKeypairWithControllerStorage:controllerStorage error:&error]; + __auto_type * operational = [certificateIssuer issueOperationalCertificateForNodeID:nodeId + fabricID:fabricId + publicKey:operationalKeypair.publicKey + error:&error]; + VerifyOrReturnError(nil == error, MTRErrorToCHIPErrorCode(error), ChipLogError(chipTool, "Can not issue an operational certificate: %@", error)); + + __auto_type * controllerStorageQueue = dispatch_queue_create("com.chip.storage", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * params = [[MTRDeviceControllerExternalCertificateParameters alloc] initWithStorageDelegate:controllerStorage + storageDelegateQueue:controllerStorageQueue + uniqueIdentifier:controllerId + ipk:certificateIssuer.ipk + vendorID:vendorId + operationalKeypair:operationalKeypair + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:certificateIssuer.rootCertificate]; + [params setOperationalCertificateIssuer:certificateIssuer queue:controllerStorageQueue]; + params.productAttestationAuthorityCertificates = productAttestationAuthorityCertificates; + + __auto_type * controller = [[MTRDeviceController alloc] initWithParameters:params error:&error]; + VerifyOrReturnError(nil != controller, MTRErrorToCHIPErrorCode(error), ChipLogError(chipTool, "Controller startup failure: %@", error)); + mControllers[identities[i]] = controller; } - ReturnLogErrorOnFailure([gNocSigner createOrLoadKeys:storage]); + return CHIP_NO_ERROR; +} + +CHIP_ERROR CHIPCommandBridge::SetUpStackWithSharedStorage(NSArray * productAttestationAuthorityCertificates) +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + VerifyOrReturnError(nil != factory, CHIP_ERROR_INTERNAL, ChipLogError(chipTool, "Controller factory is nil")); + + auto factoryParams = [[MTRDeviceControllerFactoryParams alloc] initWithStorage:storage]; + factoryParams.shouldStartServer = YES; + factoryParams.otaProviderDelegate = mOTADelegate; + factoryParams.productAttestationAuthorityCertificates = productAttestationAuthorityCertificates; - ipk = [gNocSigner getIPK]; + NSError * error; + auto started = [factory startControllerFactory:factoryParams error:&error]; + VerifyOrReturnError(started, MTRErrorToCHIPErrorCode(error), ChipLogError(chipTool, "Controller factory startup failed")); + + __auto_type * certificateIssuer = [CertificateIssuer sharedInstance]; constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; std::string commissionerName = mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha; for (size_t i = 0; i < ArraySize(identities); ++i) { - auto controllerParams = [[MTRDeviceControllerStartupParams alloc] initWithIPK:ipk fabricID:@(i + 1) nocSigner:gNocSigner]; - + __auto_type * fabricId = @(i + 1); + __auto_type * params = [[MTRDeviceControllerStartupParams alloc] initWithIPK:certificateIssuer.ipk + fabricID:fabricId + nocSigner:certificateIssuer.signingKey]; if (commissionerName.compare(identities[i]) == 0 && mCommissionerNodeId.HasValue()) { - controllerParams.nodeId = @(mCommissionerNodeId.Value()); + params.nodeId = @(mCommissionerNodeId.Value()); } - // We're not sure whether we're creating a new fabric or using an - // existing one, so just try both. - auto controller = [factory createControllerOnExistingFabric:controllerParams error:&error]; + + // We're not sure whether we're creating a new fabric or using an existing one, so just try both. + auto controller = [factory createControllerOnExistingFabric:params error:&error]; if (controller == nil) { // Maybe we didn't have this fabric yet. - controllerParams.vendorID = @(mCommissionerVendorId.ValueOr(chip::VendorId::TestVendor1)); - controller = [factory createControllerOnNewFabric:controllerParams error:&error]; + params.vendorID = @(mCommissionerVendorId.ValueOr(chip::VendorId::TestVendor1)); + controller = [factory createControllerOnNewFabric:params error:&error]; } - if (controller == nil) { - ChipLogError(chipTool, "Controller startup failure."); - return MTRErrorToCHIPErrorCode(error); - } - + VerifyOrReturnError(nil != controller, MTRErrorToCHIPErrorCode(error), ChipLogError(chipTool, "Controller startup failure: %@", error)); mControllers[identities[i]] = controller; } @@ -188,11 +252,29 @@ kIdentityBeta, kIdentityGamma); chipDie(); } + mCurrentIdentity = name; mCurrentController = mControllers[name]; } MTRDeviceController * CHIPCommandBridge::CurrentCommissioner() { return mCurrentController; } +NSNumber * CHIPCommandBridge::CurrentCommissionerFabricId() +{ + if (mCurrentIdentity.compare(kIdentityAlpha) == 0) { + return @(1); + } else if (mCurrentIdentity.compare(kIdentityBeta) == 0) { + return @(2); + } else if (mCurrentIdentity.compare(kIdentityGamma) == 0) { + return @(3); + } else { + ChipLogError(chipTool, "Unknown commissioner name: %s. Supported names are [%s, %s, %s]", mCurrentIdentity.c_str(), kIdentityAlpha, + kIdentityBeta, kIdentityGamma); + chipDie(); + } + + return @(0); // This should never happens. +} + MTRDeviceController * CHIPCommandBridge::GetCommissioner(const char * identity) { return mControllers[identity]; } MTRBaseDevice * CHIPCommandBridge::BaseDeviceWithNodeId(chip::NodeId nodeId) @@ -214,15 +296,25 @@ { StopCommissioners(); - auto factory = [MTRDeviceControllerFactory sharedInstance]; - NSData * ipk = [gNocSigner getIPK]; + if (sUseSharedStorage) { + auto factory = [MTRDeviceControllerFactory sharedInstance]; - constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; - for (size_t i = 0; i < ArraySize(identities); ++i) { - auto controllerParams = [[MTRDeviceControllerStartupParams alloc] initWithIPK:ipk fabricID:@(i + 1) nocSigner:gNocSigner]; + constexpr const char * identities[] = { kIdentityAlpha, kIdentityBeta, kIdentityGamma }; + for (size_t i = 0; i < ArraySize(identities); ++i) { + __auto_type * certificateIssuer = [CertificateIssuer sharedInstance]; + auto controllerParams = [[MTRDeviceControllerStartupParams alloc] initWithIPK:certificateIssuer.ipk fabricID:@(i + 1) nocSigner:certificateIssuer.signingKey]; - auto controller = [factory createControllerOnExistingFabric:controllerParams error:nil]; - mControllers[identities[i]] = controller; + auto controller = [factory createControllerOnExistingFabric:controllerParams error:nil]; + mControllers[identities[i]] = controller; + } + } else { + NSArray * productAttestationAuthorityCertificates = nil; + ReturnOnFailure(GetPAACertsFromFolder(&productAttestationAuthorityCertificates)); + if ([productAttestationAuthorityCertificates count] == 0) { + productAttestationAuthorityCertificates = nil; + } + + ReturnOnFailure(SetUpStackWithPerControllerStorage(productAttestationAuthorityCertificates)); } } diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.h b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.h index d5f743d576..1da1b6b105 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.h @@ -1,8 +1,28 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + #import #import NS_ASSUME_NONNULL_BEGIN +extern NSString * const kDarwinFrameworkToolCertificatesDomain; + @interface CHIPToolPersistentStorageDelegate : NSObject - (nullable NSData *)storageDataForKey:(NSString *)key; - (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key; diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm index 7cbdce8500..3ec3dda55e 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandStorageDelegate.mm @@ -1,89 +1,70 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + #include "CHIPCommandStorageDelegate.h" #import -#define LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE 0 - -NSString * const kCHIPToolDefaultsDomain = @"com.apple.chiptool"; +#import "PreferencesStorage.h" -id MTRGetDomainValueForKey(NSString * domain, NSString * key) -{ - id value = (id) CFBridgingRelease(CFPreferencesCopyAppValue((CFStringRef) key, (CFStringRef) domain)); - if (value) { - return value; - } - return nil; -} +NSString * const kDarwinFrameworkToolCertificatesDomain = @"com.apple.chiptool"; -BOOL MTRSetDomainValueForKey(NSString * domain, NSString * key, id value) -{ - CFPreferencesSetAppValue((CFStringRef) key, (__bridge CFPropertyListRef _Nullable)(value), (CFStringRef) domain); - return CFPreferencesAppSynchronize((CFStringRef) domain) == true; -} +@interface CHIPToolPersistentStorageDelegate () +@property (nonatomic, readonly) PreferencesStorage * storage; +@end -BOOL MTRRemoveDomainValueForKey(NSString * domain, NSString * key) -{ - CFPreferencesSetAppValue((CFStringRef) key, nullptr, (CFStringRef) domain); - return CFPreferencesAppSynchronize((CFStringRef) domain) == true; -} +@implementation CHIPToolPersistentStorageDelegate -id CHIPGetDomainKeyList(NSString * domain) +- (instancetype)init { - id value - = (id) CFBridgingRelease(CFPreferencesCopyKeyList((CFStringRef) domain, kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); - if (value) { - return value; + if (!(self = [super init])) { + return nil; } - return nil; -} -BOOL CHIPClearAllDomain(NSString * domain) -{ - - NSArray * allKeys = CHIPGetDomainKeyList(domain); -#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE - NSLog(@"Removing keys: %@ %@", allKeys, domain); -#endif - for (id key in allKeys) { -#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE - NSLog(@"Removing key: %@", key); -#endif - if (!MTRRemoveDomainValueForKey(domain, (NSString *) key)) { - return NO; - } - } - return YES; + _storage = [[PreferencesStorage alloc] initWithDomain:kDarwinFrameworkToolCertificatesDomain]; + return self; } -@implementation CHIPToolPersistentStorageDelegate - - (BOOL)deleteAllStorage { - return CHIPClearAllDomain(kCHIPToolDefaultsDomain); + return [_storage reset]; } // MARK: CHIPPersistentStorageDelegate - (nullable NSData *)storageDataForKey:(NSString *)key { - NSData * value = MTRGetDomainValueForKey(kCHIPToolDefaultsDomain, key); -#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE - NSLog(@"CHIPPersistentStorageDelegate Get Value for Key: %@, value %@", key, value); -#endif - return value; + return _storage[key]; } - (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key { - return MTRSetDomainValueForKey(kCHIPToolDefaultsDomain, key, value); + _storage[key] = value; + return YES; } - (BOOL)removeStorageDataForKey:(NSString *)key { - if (MTRGetDomainValueForKey(kCHIPToolDefaultsDomain, key) == nil) { + if (_storage[key] == nil) { return NO; } - return MTRRemoveDomainValueForKey(kCHIPToolDefaultsDomain, key); + _storage[key] = nil; + return YES; } @end diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h index a58d2e8e70..f0ee3f8db6 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h +++ b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.h @@ -1,4 +1,21 @@ -#include "CHIPCommandStorageDelegate.h" +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + #import #include @@ -8,7 +25,7 @@ - (SecKeyRef)publicKey; - (CHIP_ERROR)Serialize:(chip::Crypto::P256SerializedKeypair &)output; - (CHIP_ERROR)Deserialize:(chip::Crypto::P256SerializedKeypair &)input; -- (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage; +- (CHIP_ERROR)createOrLoadKeys:(id)storage; - (NSData *)getIPK; @end diff --git a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm index 4d6f53de9a..ce0ef5819b 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPToolKeypair.mm @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + #import "CHIPToolKeypair.h" #import #include @@ -5,6 +23,9 @@ #include #include +#import "CHIPCommandStorageDelegate.h" +#import "ControllerStorage.h" + #define CHIPPlugin_CAKeyTag "com.apple.matter.commissioner.ca.issuer.id" #define Public_KeySize "256" @@ -76,12 +97,10 @@ - (NSData *)getIPK return _ipk; } -- (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage +- (CHIP_ERROR)createOrLoadKeys:(id)storage { chip::ASN1::ASN1UniversalTime effectiveTime; chip::Crypto::P256SerializedKeypair serializedKey; - NSData * value; - CHIP_ERROR err = CHIP_NO_ERROR; // Initializing the default start validity to start of 2021. The default validity duration is 10 years. CHIP_ZERO_AT(effectiveTime); @@ -90,8 +109,8 @@ - (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage effectiveTime.Day = 1; ReturnErrorOnFailure(chip::Credentials::ASN1ToChipEpochTime(effectiveTime, _mNow)); - value = [storage storageDataForKey:kOperationalCredentialsIssuerKeypairStorage]; - err = [self initSerializedKeyFromValue:value serializedKey:serializedKey]; + __auto_type * value = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage]; + __auto_type err = [self initSerializedKeyFromValue:value serializedKey:serializedKey]; if (err != CHIP_NO_ERROR) { // Storage doesn't have an existing keypair. Let's create one and add it to the storage. @@ -101,12 +120,12 @@ - (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage ReturnErrorOnFailure([self Serialize:serializedKey]); NSData * valueData = [NSData dataWithBytes:serializedKey.Bytes() length:serializedKey.Length()]; - [storage setStorageData:valueData forKey:kOperationalCredentialsIssuerKeypairStorage]; + [self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIssuerKeypairStorage value:valueData]; } else { ReturnErrorOnFailure([self Deserialize:serializedKey]); } - NSData * ipk = [storage storageDataForKey:kOperationalCredentialsIPK]; + NSData * ipk = [self _getValueForKeyWithStorage:storage key:kOperationalCredentialsIPK]; if (ipk == nil) { err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; } @@ -116,7 +135,7 @@ - (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage ReturnLogErrorOnFailure(chip::Crypto::DRBG_get_bytes(tempIPK, sizeof(tempIPK))); _ipk = [NSData dataWithBytes:tempIPK length:sizeof(tempIPK)]; - [storage setStorageData:_ipk forKey:kOperationalCredentialsIPK]; + [self _setValueForKeyWithStorage:storage key:kOperationalCredentialsIPK value:_ipk]; } else { _ipk = ipk; } @@ -124,6 +143,25 @@ - (CHIP_ERROR)createOrLoadKeys:(CHIPToolPersistentStorageDelegate *)storage return CHIP_NO_ERROR; } +- (NSData *)_getValueForKeyWithStorage:(id)storage key:(NSString *)key +{ + if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { + return [storage storageDataForKey:key]; + } else if ([storage isKindOfClass:[ControllerStorage class]]) { + return [storage valueForKey:key]; + } + return nil; +} + +- (void)_setValueForKeyWithStorage:(id)storage key:(NSString *)key value:(NSData *)value +{ + if ([storage isKindOfClass:[CHIPToolPersistentStorageDelegate class]]) { + [storage setStorageData:value forKey:key]; + } else if ([storage isKindOfClass:[ControllerStorage class]]) { + [storage storeValue:value forKey:key]; + } +} + - (CHIP_ERROR)initSerializedKeyFromValue:(NSData *)value serializedKey:(chip::Crypto::P256SerializedKeypair &)serializedKey { if (value == nil) { diff --git a/examples/darwin-framework-tool/commands/common/CertificateIssuer.h b/examples/darwin-framework-tool/commands/common/CertificateIssuer.h new file mode 100644 index 0000000000..0034f28be2 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/CertificateIssuer.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +#import "ControllerStorage.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface CertificateIssuer : NSObject +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + ++ (CertificateIssuer *)sharedInstance; + +- (void)startWithStorage:(id)storage + error:(NSError * _Nullable __autoreleasing * _Nonnull)error; + +- (id)issueOperationalKeypairWithControllerStorage:(ControllerStorage *)storage error:(NSError * _Nullable __autoreleasing * _Nonnull)error; + +- (MTRCertificateDERBytes _Nullable)issueOperationalCertificateForNodeID:(NSNumber *)nodeID + fabricID:(NSNumber *)fabricID + publicKey:(SecKeyRef)publicKey + error:(NSError * _Nullable __autoreleasing * _Nonnull)error; + +@property (nonatomic, readonly) MTRCertificateDERBytes rootCertificate; +@property (nonatomic, readonly) id signingKey; +@property (nonatomic, readonly) NSData * ipk; + +@property (nonatomic, nullable) NSNumber * fabricID; +@property (nonatomic, nullable) NSNumber * nextNodeID; +@property (nonatomic, readonly) BOOL shouldSkipAttestationCertificateValidation; + +@end + +NS_ASSUME_NONNULL_END diff --git a/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm b/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm new file mode 100644 index 0000000000..bd12878c6a --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/CertificateIssuer.mm @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "CertificateIssuer.h" +#import "CHIPToolKeypair.h" + +#include + +@interface CertificateIssuer () +- (MTRCertificateDERBytes _Nullable)issueOperationalCertificateForNodeID:(NSNumber *)nodeID + fabricID:(NSNumber *)fabricID + publicKey:(SecKeyRef)publicKey + error:(NSError * _Nullable __autoreleasing * _Nonnull)error; +@end + +@implementation CertificateIssuer + ++ (CertificateIssuer *)sharedInstance +{ + static CertificateIssuer * certificateIssuer = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + certificateIssuer = [[CertificateIssuer alloc] init]; + }); + return certificateIssuer; +} + +- (instancetype)init +{ + if (!(self = [super init])) { + return nil; + } + + _rootCertificate = nil; + _ipk = nil; + _signingKey = nil; + _fabricID = nil; + _nextNodeID = nil; + _shouldSkipAttestationCertificateValidation = NO; + + return self; +} + +- (void)startWithStorage:(id)storage + error:(NSError * _Nullable __autoreleasing * _Nonnull)error +{ + __auto_type * signingKey = [[CHIPToolKeypair alloc] init]; + + __auto_type err = [signingKey createOrLoadKeys:storage]; + if (CHIP_NO_ERROR != err) { + *error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating or loading keys" }]; + return; + } + + __auto_type * rootCertificate = [MTRCertificates createRootCertificate:signingKey issuerID:nil fabricID:nil error:error]; + if (nil == rootCertificate) { + *error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating root certificate" }]; + return; + } + + _rootCertificate = rootCertificate; + _signingKey = signingKey; + _ipk = [signingKey getIPK]; +} + +- (id)issueOperationalKeypairWithControllerStorage:(ControllerStorage *)storage error:(NSError * _Nullable __autoreleasing * _Nonnull)error +{ + __auto_type * keypair = [[CHIPToolKeypair alloc] init]; + + __auto_type err = [keypair createOrLoadKeys:storage]; + if (CHIP_NO_ERROR != err) { + *error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"Error creating or loading keys" }]; + return nil; + } + + return keypair; +} + +- (void)issueOperationalCertificateForRequest:(MTROperationalCSRInfo *)csrInfo + attestationInfo:(MTRDeviceAttestationInfo *)attestationInfo + controller:(MTRDeviceController *)controller + completion:(void (^)(MTROperationalCertificateChain * _Nullable info, + NSError * _Nullable error))completion +{ + NSError * error = nil; + + if (self.nextNodeID == nil) { + error = [NSError errorWithDomain:@"Error" code:0 userInfo:@{ @"reason" : @"nextNodeID is nil" }]; + completion(nil, error); + return; + } + + __auto_type * csr = csrInfo.csr; + __auto_type * rawPublicKey = [MTRCertificates publicKeyFromCSR:csr error:&error]; + if (error != nil) { + completion(nil, error); + return; + } + + NSDictionary * attributes = @{ + (__bridge NSString *) kSecAttrKeyType : (__bridge NSString *) kSecAttrKeyTypeECSECPrimeRandom, + (__bridge NSString *) kSecAttrKeyClass : (__bridge NSString *) kSecAttrKeyClassPublic + }; + CFErrorRef keyCreationError = NULL; + SecKeyRef publicKey + = SecKeyCreateWithData((__bridge CFDataRef) rawPublicKey, (__bridge CFDictionaryRef) attributes, &keyCreationError); + + __auto_type * operationalCert = [self issueOperationalCertificateForNodeID:self.nextNodeID + fabricID:self.fabricID + publicKey:publicKey + error:&error]; + + // Release no-longer-needed key before we do anything else. + CFRelease(publicKey); + + if (error != nil) { + completion(nil, error); + return; + } + + __auto_type * certChain = [[MTROperationalCertificateChain alloc] initWithOperationalCertificate:operationalCert + intermediateCertificate:nil + rootCertificate:self.rootCertificate + adminSubject:nil]; + completion(certChain, nil); +} + +- (MTRCertificateDERBytes _Nullable)issueOperationalCertificateForNodeID:(NSNumber *)nodeID + fabricID:(NSNumber *)fabricID + publicKey:(SecKeyRef)publicKey + error:(NSError * _Nullable __autoreleasing * _Nonnull)error +{ + __auto_type * operationalCert = [MTRCertificates createOperationalCertificate:self.signingKey + signingCertificate:self.rootCertificate + operationalPublicKey:publicKey + fabricID:fabricID + nodeID:nodeID + caseAuthenticatedTags:nil + error:error]; + return operationalCert; +} + +@end diff --git a/examples/darwin-framework-tool/commands/common/ControllerStorage.h b/examples/darwin-framework-tool/commands/common/ControllerStorage.h new file mode 100644 index 0000000000..f70081fee0 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/ControllerStorage.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString * const kDarwinFrameworkToolControllerDomain; + +@interface ControllerStorage : NSObject +- (instancetype)initWithControllerID:(NSUUID *)controllerID; +@property (nonatomic, readonly) NSUUID * controllerID; + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +- (NSDictionary> *)valuesForController:(MTRDeviceController *)controller securityLevel:(MTRStorageSecurityLevel)securityLevel sharingType:(MTRStorageSharingType)sharingType; +- (BOOL)controller:(MTRDeviceController *)controller storeValues:(NSDictionary> *)values securityLevel:(MTRStorageSecurityLevel)securityLevel sharingType:(MTRStorageSharingType)sharingType; + +- (NSData *)valueForKey:(NSString *)key; +- (void)storeValue:(NSData *)value forKey:key; +@end + +NS_ASSUME_NONNULL_END diff --git a/examples/darwin-framework-tool/commands/common/ControllerStorage.mm b/examples/darwin-framework-tool/commands/common/ControllerStorage.mm new file mode 100644 index 0000000000..058f00a6b3 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/ControllerStorage.mm @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "ControllerStorage.h" +#import "PreferencesStorage.h" + +#include + +NSString * const kDarwinFrameworkToolControllerDomain = @"com.apple.darwin-framework-tool.controller"; + +@interface ControllerStorage () +@property (nonatomic, readonly) PreferencesStorage * storage; +@property (nonatomic, readonly) NSString * keyScopingPrefix; + +- (NSString *)_keyToControllerScopedKey:(NSString *)key; +- (NSString *)_controllerScopedKeyToKey:(NSString *)controllerKey; +- (BOOL)_isControllerScopedKey:(NSString *)controllerKey; +@end + +@implementation ControllerStorage +- (instancetype)initWithControllerID:(NSUUID *)controllerID +{ + if (!(self = [super init])) { + return nil; + } + + _storage = [[PreferencesStorage alloc] initWithDomain:kDarwinFrameworkToolControllerDomain]; + _controllerID = controllerID; + _keyScopingPrefix = [NSString stringWithFormat:@"%@/", [_controllerID UUIDString]]; + return self; +} + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ +#ifdef LOG_DEBUG_CONTROLLER_STORAGE + ChipLogError(chipTool, "Controller(%@) Storage - Get value for %@", controller, key); +#endif // LOG_DEBUG_CONTROLLER_STORAGE + + __auto_type * controllerKey = [self _keyToControllerScopedKey:key]; + __auto_type * data = self.storage[controllerKey]; + if (data == nil) { + return data; + } + + NSError * error; + id value = [NSKeyedUnarchiver unarchivedObjectOfClasses:MTRDeviceControllerStorageClasses() fromData:data error:&error]; + return value; +} + +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ +#ifdef LOG_DEBUG_CONTROLLER_STORAGE + ChipLogError(chipTool, "Controller(%@) Storage - Set value for %@", controller, key); +#endif // LOG_DEBUG_CONTROLLER_STORAGE + NSError * error; + NSData * data = [NSKeyedArchiver archivedDataWithRootObject:value requiringSecureCoding:YES error:&error]; + + __auto_type * controllerKey = [self _keyToControllerScopedKey:key]; + self.storage[controllerKey] = data; + return YES; +} + +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ +#ifdef LOG_DEBUG_CONTROLLER_STORAGE + ChipLogError(chipTool, "Controller(%@) Storage - Remove value for %@", controller, key); +#endif // LOG_DEBUG_CONTROLLER_STORAGE + + __auto_type * controllerKey = [self _keyToControllerScopedKey:key]; + self.storage[controllerKey] = nil; + return YES; +} + +- (NSDictionary> *)valuesForController:(MTRDeviceController *)controller securityLevel:(MTRStorageSecurityLevel)securityLevel sharingType:(MTRStorageSharingType)sharingType +{ +#ifdef LOG_DEBUG_CONTROLLER_STORAGE + ChipLogError(chipTool, "Controller(%@) Storage - Get all values", controller); +#endif // LOG_DEBUG_CONTROLLER_STORAGE + + NSMutableDictionary * valuesToReturn = [NSMutableDictionary dictionary]; + for (NSString * controllerKey in self.storage) { + if (![self _isControllerScopedKey:controllerKey]) { + continue; + } + __auto_type * key = [self _controllerScopedKeyToKey:controllerKey]; + valuesToReturn[key] = [self controller:controller valueForKey:key securityLevel:securityLevel sharingType:sharingType]; + } + + if (!valuesToReturn.count) { + return nil; + } + + return valuesToReturn; +} + +- (BOOL)controller:(MTRDeviceController *)controller storeValues:(NSDictionary> *)values securityLevel:(MTRStorageSecurityLevel)securityLevel sharingType:(MTRStorageSharingType)sharingType +{ +#ifdef LOG_DEBUG_CONTROLLER_STORAGE + ChipLogError(chipTool, "Controller(%@) Storage - store values", controller); +#endif // LOG_DEBUG_CONTROLLER_STORAGE + + for (NSString * key in values) { + [self controller:controller storeValue:values[key] forKey:key securityLevel:securityLevel sharingType:sharingType]; + } + + return YES; +} + +- (NSData *)valueForKey:(NSString *)key +{ + __auto_type * controllerKey = [self _keyToControllerScopedKey:key]; + return self.storage[controllerKey]; +} + +- (void)storeValue:(NSData *)value forKey:key +{ + __auto_type * controllerKey = [self _keyToControllerScopedKey:key]; + self.storage[controllerKey] = value; +} + +- (NSString *)_keyToControllerScopedKey:(NSString *)key +{ + return [NSString stringWithFormat:@"%@%@", _keyScopingPrefix, key]; +} + +- (NSString *)_controllerScopedKeyToKey:(NSString *)controllerKey +{ + return [controllerKey substringFromIndex:_keyScopingPrefix.length]; +} + +- (BOOL)_isControllerScopedKey:(NSString *)controllerKey +{ + return [controllerKey hasPrefix:_keyScopingPrefix]; +} +@end diff --git a/examples/darwin-framework-tool/commands/common/PreferencesStorage.h b/examples/darwin-framework-tool/commands/common/PreferencesStorage.h new file mode 100644 index 0000000000..85c1203276 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/PreferencesStorage.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +@interface PreferencesStorage : NSObject + +@property (nonatomic, strong) NSString * domain; + +- (instancetype)initWithDomain:(NSString *)domain; +- (NSData *)objectForKeyedSubscript:(NSString *)key; +- (void)setObject:(id)obj forKeyedSubscript:(NSString *)key; +- (NSArray *)allKeys; +- (bool)reset; +- (void)print; + +@end diff --git a/examples/darwin-framework-tool/commands/common/PreferencesStorage.mm b/examples/darwin-framework-tool/commands/common/PreferencesStorage.mm new file mode 100644 index 0000000000..e7ddba1313 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/PreferencesStorage.mm @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import "PreferencesStorage.h" + +@implementation PreferencesStorage +- (instancetype)initWithDomain:(NSString *)domain +{ + self = [super init]; + if (self) { + _domain = domain; + } + + return self; +} + +- (NSData *)objectForKeyedSubscript:(NSString *)key +{ + __auto_type domainRef = (__bridge CFStringRef) self.domain; + __auto_type keyRef = (__bridge CFStringRef) key; + __auto_type value = CFPreferencesCopyAppValue(keyRef, domainRef); + if (value) { + id obj = (__bridge_transfer id) value; + return obj; + } + return nil; +} + +- (void)setObject:(id)obj forKeyedSubscript:(NSString *)key +{ + __auto_type domainRef = (__bridge CFStringRef) self.domain; + __auto_type keyRef = (__bridge CFStringRef) key; + __auto_type value = (__bridge CFPropertyListRef) obj; + + CFPreferencesSetAppValue(keyRef, value, domainRef); + CFPreferencesAppSynchronize(domainRef); +} + +- (NSArray *)allKeys +{ + __auto_type domainRef = (__bridge CFStringRef) self.domain; + __auto_type keys = CFPreferencesCopyKeyList(domainRef, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + + if (!keys) { + return @[]; + } + + return (__bridge_transfer NSArray *) keys; +} + +- (bool)reset +{ + __auto_type * keys = [self allKeys]; + __auto_type domainRef = (__bridge CFStringRef) self.domain; + + for (NSString * key in keys) { + __auto_type keyRef = (__bridge CFStringRef) key; + CFPreferencesSetAppValue(keyRef, NULL, domainRef); + } + + return CFPreferencesAppSynchronize(domainRef); +} + +- (void)print +{ + NSLog(@"%@:", self.domain); + NSArray * keys = [self allKeys]; + for (NSString * key in keys) { + __auto_type * data = [self objectForKeyedSubscript:key]; + NSLog(@" * %@: %@", key, data); + } +} + +#pragma mark - NSFastEnumeration + +- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id _Nullable __unsafe_unretained[])buffer count:(NSUInteger)len +{ + __auto_type * keys = [self allKeys]; + if (state->state >= keys.count) { + return 0; + } + + state->itemsPtr = buffer; + state->mutationsPtr = &state->extra[0]; + + NSUInteger count = 0; + while (state->state < keys.count && count < len) { + buffer[count] = keys[state->state]; + state->state++; + count++; + } + return count; +} + +@end diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm index ff12cdc022..50d446b780 100644 --- a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm @@ -27,6 +27,8 @@ #include +constexpr char kAttributePathKey[] = "attributePath"; +constexpr char kCommandPathKey[] = "commandPath"; constexpr char kClusterIdKey[] = "clusterId"; constexpr char kEndpointIdKey[] = "endpointId"; constexpr char kAttributeIdKey[] = "attributeId"; @@ -142,8 +144,45 @@ CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNum Json::Value jsonValue; VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); - value[kValueKey] = jsonValue; + // When using the *-by-id commands, the return format is always encapsulated + // within an array. If the attribute itself is an empty array, the result will + // appear as follows: + // + //[ + // { + // attributePath = ""; + // data = { + // type = Array; + // value = ( + // ); + // }; + // } + //] + bool hasData = false; + if (jsonValue.isArray() && !jsonValue.empty()) { + for (Json::ArrayIndex i = 0; i < jsonValue.size(); i++) { + if (jsonValue[i].isObject()) { + if (jsonValue[i].isMember(kAttributePathKey)) { + jsonValue[i].removeMember(kAttributePathKey); + } + + if (!jsonValue[i].empty()) { + hasData = true; + } + } else { + hasData = true; + } + } + } else { + hasData = true; + } + + if (!hasData) { + return CHIP_NO_ERROR; + } + + value[kValueKey] = jsonValue; auto valueStr = JsonToString(value); return gDelegate->LogJSON(valueStr.c_str()); } @@ -159,8 +198,31 @@ CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumbe Json::Value jsonValue; VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); - value[kValueKey] = jsonValue; + bool hasData = false; + if (jsonValue.isArray()) { + for (Json::ArrayIndex i = 0; i < jsonValue.size(); i++) { + if (jsonValue[i].isObject()) { + if (jsonValue[i].isMember(kCommandPathKey)) { + jsonValue[i].removeMember(kCommandPathKey); + } + + if (!jsonValue[i].empty()) { + hasData = true; + } + } else { + hasData = true; + } + } + } else { + hasData = true; + } + + if (!hasData) { + return CHIP_NO_ERROR; + } + + value[kValueKey] = jsonValue; auto valueStr = JsonToString(value); return gDelegate->LogJSON(valueStr.c_str()); } diff --git a/examples/darwin-framework-tool/commands/memory/Commands.h b/examples/darwin-framework-tool/commands/memory/Commands.h new file mode 100644 index 0000000000..d58d62db1c --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/Commands.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "commands/common/Commands.h" +#include "commands/memory/DumpMemoryGraphCommand.h" + +void registerCommandsMemory(Commands & commands) +{ + const char * clusterName = "memory"; + commands_list clusterCommands = { + make_unique(), + }; + + commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for inspecting program memory."); +} diff --git a/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h new file mode 100644 index 0000000000..a4eedfe617 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "../common/CHIPCommandBridge.h" + +#include + +/** + * This command dump the memory graph of the program. + */ + +class DumpMemoryGraphCommand : public CHIPCommandBridge +{ +public: + DumpMemoryGraphCommand() : CHIPCommandBridge("dump-graph") + { + AddArgument("filepath", &mFilePath, + "An optional filepath to save the memory graph to. Defaults to 'darwin-framework-tool.memgraph"); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Milliseconds32(0); } + +private: + chip::Optional mFilePath; +}; diff --git a/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm new file mode 100644 index 0000000000..15bb462f4c --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/DumpMemoryGraphCommand.mm @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "DumpMemoryGraphCommand.h" + +#include "LeaksTool.h" + +CHIP_ERROR DumpMemoryGraphCommand::RunCommand() +{ + auto err = DumpMemoryGraph(mFilePath); + SetCommandExitStatus(err); + return err; +} diff --git a/examples/darwin-framework-tool/commands/memory/LeaksTool.h b/examples/darwin-framework-tool/commands/memory/LeaksTool.h new file mode 100644 index 0000000000..101b437932 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/LeaksTool.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include + +CHIP_ERROR DumpMemoryGraph(chip::Optional filePath); +CHIP_ERROR PrintPools(); diff --git a/examples/darwin-framework-tool/commands/memory/LeaksTool.mm b/examples/darwin-framework-tool/commands/memory/LeaksTool.mm new file mode 100644 index 0000000000..394a9083f5 --- /dev/null +++ b/examples/darwin-framework-tool/commands/memory/LeaksTool.mm @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "LeaksTool.h" + +#import +#include // For getpid() + +constexpr const char * kDefaultOutputGraphPath = "darwin-framework-tool.memgraph"; + +@interface LeaksTool : NSObject +- (BOOL)runWithArguments:(NSArray * _Nullable)arguments; +@end + +@implementation LeaksTool + +- (BOOL)runWithArguments:(NSArray * _Nullable)arguments +{ +#if TARGET_OS_OSX + pid_t pid = getpid(); + __auto_type * pidString = [NSString stringWithFormat:@"%d", pid]; + + __auto_type * task = [[NSTask alloc] init]; + task.launchPath = @"/usr/bin/leaks"; + task.arguments = @[ pidString ]; + if (arguments) { + task.arguments = [task.arguments arrayByAddingObjectsFromArray:arguments]; + } + + __auto_type * pipe = [NSPipe pipe]; + task.standardOutput = pipe; + task.standardError = pipe; + + __auto_type * fileHandle = [pipe fileHandleForReading]; + [task launch]; + [task waitUntilExit]; + + int exitCode = [task terminationStatus]; + if (exitCode != EXIT_SUCCESS) { + return NO; + } + + __auto_type * data = [fileHandle readDataToEndOfFile]; + __auto_type * output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"%@", output); + + return YES; +#else + NSLog(@"Running leaks as a task is supported on this platform."); + return NO; +#endif // TARGET_OS_OSX +} + +@end + +CHIP_ERROR DumpMemoryGraph(chip::Optional filePath) +{ + NSMutableString * outputGraphArgument = [NSMutableString stringWithFormat:@"--outputGraph=%s", kDefaultOutputGraphPath]; + if (filePath.HasValue()) { + outputGraphArgument = [NSMutableString stringWithFormat:@"--outputGraph=%s", filePath.Value()]; + } + + __auto_type * leaksTool = [[LeaksTool alloc] init]; + if (![leaksTool runWithArguments:@[ outputGraphArgument ]]) { + return CHIP_ERROR_INTERNAL; + } + + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm index 1a060819b5..3ec4aee9e2 100644 --- a/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/pairing/PairingCommandBridge.mm @@ -19,6 +19,7 @@ #import #include "../common/CHIPCommandBridge.h" +#include "../common/CertificateIssuer.h" #include "DeviceControllerDelegateBridge.h" #include "PairingCommandBridge.h" #include @@ -52,6 +53,12 @@ - (void)deviceAttestationCompletedForController:(MTRDeviceController *)controlle [deviceControllerDelegate setCommandBridge:this]; [deviceControllerDelegate setDeviceID:mNodeId]; + // With per-controller storage, the certificate issuer creates the operational certificate. + // When using shared storage, this step is a no-op. + auto * certificateIssuer = [CertificateIssuer sharedInstance]; + certificateIssuer.nextNodeID = @(mNodeId); + certificateIssuer.fabricID = CurrentCommissionerFabricId(); + if (mCommissioningType != CommissioningType::None) { MTRCommissioningParameters * params = [[MTRCommissioningParameters alloc] init]; switch (mCommissioningType) { diff --git a/examples/darwin-framework-tool/commands/storage/Commands.h b/examples/darwin-framework-tool/commands/storage/Commands.h index 65534272b8..983fb22f46 100644 --- a/examples/darwin-framework-tool/commands/storage/Commands.h +++ b/examples/darwin-framework-tool/commands/storage/Commands.h @@ -25,7 +25,10 @@ void registerCommandsStorage(Commands & commands) { const char * clusterName = "storage"; - commands_list clusterCommands = { make_unique() }; + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + }; commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for managing persistent data stored by darwin-framework-tool."); diff --git a/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.h b/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.h index c2abddf18d..8c3ed69184 100644 --- a/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.h +++ b/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.h @@ -29,3 +29,11 @@ class StorageClearAll : public Command CHIP_ERROR Run() override; }; + +class StorageViewAll : public Command +{ +public: + StorageViewAll() : Command("view-all") {} + + CHIP_ERROR Run() override; +}; diff --git a/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.mm b/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.mm index e0c1b18ec8..007d2821bd 100644 --- a/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.mm +++ b/examples/darwin-framework-tool/commands/storage/StorageManagementCommand.mm @@ -17,18 +17,43 @@ */ #include "../common/CHIPCommandStorageDelegate.h" +#include "../common/ControllerStorage.h" +#include "../common/PreferencesStorage.h" #include "StorageManagementCommand.h" #import -static CHIPToolPersistentStorageDelegate * storage = nil; +namespace { +NSArray * GetDomains() +{ + __auto_type * domains = @[ + kDarwinFrameworkToolCertificatesDomain, + kDarwinFrameworkToolControllerDomain + ]; + + return domains; +} +} CHIP_ERROR StorageClearAll::Run() { - storage = [[CHIPToolPersistentStorageDelegate alloc] init]; - if (![storage deleteAllStorage]) { - return CHIP_ERROR_INTERNAL; + __auto_type * domains = GetDomains(); + for (NSString * domain in domains) { + __auto_type * storage = [[PreferencesStorage alloc] initWithDomain:domain]; + VerifyOrReturnError([storage reset], CHIP_ERROR_INTERNAL); } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR StorageViewAll::Run() +{ + __auto_type * domains = GetDomains(); + for (NSString * domain in domains) { + __auto_type * storage = [[PreferencesStorage alloc] initWithDomain:domain]; + [storage print]; + } + return CHIP_NO_ERROR; } diff --git a/examples/darwin-framework-tool/debug/LeakChecker.h b/examples/darwin-framework-tool/debug/LeakChecker.h new file mode 100644 index 0000000000..c83ed64910 --- /dev/null +++ b/examples/darwin-framework-tool/debug/LeakChecker.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +/* + * This function performs a memory leak check if the build flag `enable_leak_checking` is set to true + * If leaks are detected, it overrides the provided exit code with `EXIT_FAILURE`. + * + * @param exitCode The initial exit code to return if no leaks are detected or if leak checking is disabled. + * @return `EXIT_FAILURE` if leaks are detected and leak checking is enabled; otherwise, the original `exitCode`. + */ +int ConditionalLeaksCheck(int exitCode); diff --git a/examples/darwin-framework-tool/debug/LeakChecker.mm b/examples/darwin-framework-tool/debug/LeakChecker.mm new file mode 100644 index 0000000000..e8d69739c5 --- /dev/null +++ b/examples/darwin-framework-tool/debug/LeakChecker.mm @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "LeakChecker.h" + +#import +#include // For getpid() + +@interface LeakChecker : NSObject +- (BOOL)hasMemoryLeaks; +@end + +@implementation LeakChecker + +- (BOOL)hasMemoryLeaks +{ +#if TARGET_OS_OSX + pid_t pid = getpid(); + auto * pidString = [NSString stringWithFormat:@"%d", pid]; + + auto * task = [[NSTask alloc] init]; + task.launchPath = @"/usr/bin/leaks"; + task.arguments = @[ pidString ]; + + auto * pipe = [NSPipe pipe]; + task.standardOutput = pipe; + task.standardError = pipe; + + NSFileHandle * fileHandle = [pipe fileHandleForReading]; + [task launch]; + [task waitUntilExit]; + + int exitCode = [task terminationStatus]; + if (exitCode) { + NSData * data = [fileHandle readDataToEndOfFile]; + NSString * output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"%@", output); + return YES; + } +#else + NSLog(@"Running leaks as a task is supported on this platform."); +#endif // TARGET_OS_OSX + + return NO; +} + +@end + +int ConditionalLeaksCheck(int exitCode) +{ +#ifdef DFT_ENABLE_LEAK_CHECKING + @autoreleasepool { + auto * leakChecker = [[LeakChecker alloc] init]; + if ([leakChecker hasMemoryLeaks]) { + return EXIT_FAILURE; + } + } +#endif // DFT_ENABLE_LEAK_CHECKING + + return exitCode; +} diff --git a/examples/darwin-framework-tool/main.mm b/examples/darwin-framework-tool/main.mm index 5f31cb6abf..e0c6e94224 100644 --- a/examples/darwin-framework-tool/main.mm +++ b/examples/darwin-framework-tool/main.mm @@ -18,6 +18,7 @@ #import +#import "debug/LeakChecker.h" #import "logging/logging.h" #include "commands/bdx/Commands.h" @@ -26,6 +27,7 @@ #include "commands/delay/Commands.h" #include "commands/discover/Commands.h" #include "commands/interactive/Commands.h" +#include "commands/memory/Commands.h" #include "commands/pairing/Commands.h" #include "commands/payload/Commands.h" #include "commands/provider/Commands.h" @@ -35,6 +37,7 @@ int main(int argc, const char * argv[]) { + int exitCode = EXIT_SUCCESS; @autoreleasepool { dft::logging::Setup(); @@ -44,11 +47,13 @@ int main(int argc, const char * argv[]) registerCommandsDelay(commands); registerCommandsDiscover(commands); registerCommandsInteractive(commands); + registerCommandsMemory(commands); registerCommandsPayload(commands); registerClusterOtaSoftwareUpdateProviderInteractive(commands); registerCommandsStorage(commands); registerCommandsConfiguration(commands); registerClusters(commands); - return commands.Run(argc, (char **) argv); + exitCode = commands.Run(argc, (char **) argv); } + return ConditionalLeaksCheck(exitCode); } diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index d71eb6e367..6ee107a38f 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -709,6 +709,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/dishwasher-app/linux/README.md b/examples/dishwasher-app/linux/README.md index 6b84961709..29432d43e8 100644 --- a/examples/dishwasher-app/linux/README.md +++ b/examples/dishwasher-app/linux/README.md @@ -7,7 +7,7 @@ for Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/dishwasher-app/silabs/.gn b/examples/dishwasher-app/silabs/.gn new file mode 100644 index 0000000000..b05216fc9d --- /dev/null +++ b/examples/dishwasher-app/silabs/.gn @@ -0,0 +1,29 @@ +# 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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/dishwasher-app/silabs/BUILD.gn b/examples/dishwasher-app/silabs/BUILD.gn new file mode 100644 index 0000000000..d024a5da95 --- /dev/null +++ b/examples/dishwasher-app/silabs/BUILD.gn @@ -0,0 +1,255 @@ +# 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/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/silabs_executable.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + +assert(current_os == "freertos") + +silabs_project_dir = "${chip_root}/examples/dishwasher-app/silabs" +examples_common_plat_dir = "${chip_root}/examples/platform/silabs" +example_enegy_management_dir = "${chip_root}/examples/energy-management-app" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +} + +import("${examples_common_plat_dir}/args.gni") + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false +} + +if (slc_generate) { + # Generate Project Specific config (Board, hardware used etc..) + print(exec_script("${chip_root}/third_party/silabs/slc_gen/run_slc.py", + [ + rebase_path(chip_root), + "${silabs_board}", + "${disable_lcd}", + "${use_wstk_buttons}", + "${use_wstk_leds}", + "${use_external_flash}", + "${silabs_mcu}", + rebase_path(slc_gen_path), + ], + "list lines")) +} + +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + if (use_wf200) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + # TODO efr32_sdk should not need a header from this location + include_dirs += [ + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} +silabs_executable("dishwasher_app") { + output_name = "matter-silabs-dishwasher-example.out" + defines = [] + include_dirs = [ + "include", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/include", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/include", + "${example_enegy_management_dir}/energy-management-common/common/include", + ] + + if (silabs_board == "BRD2704A") { + defines += [ "SL_STATUS_LED=0" ] + } + + sources = [ + "${example_enegy_management_dir}/energy-management-common/common/src/EnergyTimeUtils.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/DeviceEnergyManagementManager.cpp", + "${example_enegy_management_dir}/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/EnergyReportingEventTriggers.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/FakeReadings.cpp", + "${example_enegy_management_dir}/energy-management-common/energy-reporting/src/PowerTopologyDelegate.cpp", + "${examples_common_plat_dir}/main.cpp", + "src/AppTask.cpp", + "src/DataModelHelper.cpp", + "src/DeviceEnergyManager.cpp", + "src/DishwasherManager.cpp", + "src/ElectricalEnergyMeasurementInstance.cpp", + "src/ElectricalSensorManager.cpp", + "src/PowerTopologyDelegateImpl.cpp", + "src/ZclCallbacks.cpp", + "src/operational-state-delegate-impl.cpp", + ] + + deps = [ + ":sdk", + "${chip_root}/src/platform/logging:default", + app_data_model, + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DESCRIPTOR_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + "PW_RPC_OTCLI_SERVICE=1", + "PW_RPC_THREAD_SERVICE=1", + "PW_RPC_TRACING_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", + "${examples_common_plat_dir}/PigweedLogger.cpp", + "${examples_common_plat_dir}/Rpc.cpp", + ] + + deps += [ + "$dir_pw_hdlc:default_addresses", + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "$dir_pw_trace", + "$dir_pw_trace_tokenized", + "$dir_pw_trace_tokenized:trace_rpc_service", + "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs" ] + } + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/efr32", + ] + } + + ldscript = "${examples_common_plat_dir}/ldscripts/${silabs_family}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + # WiFi Settings + if (chip_enable_wifi) { + ldflags += [ + "-Wl,--defsym", + "-Wl,SILABS_WIFI=1", + ] + } + + output_dir = root_out_dir +} + +group("silabs") { + deps = [ ":dishwasher_app" ] +} + +group("default") { + deps = [ ":silabs" ] +} diff --git a/examples/dishwasher-app/silabs/README.md b/examples/dishwasher-app/silabs/README.md new file mode 100644 index 0000000000..9a8a102cbd --- /dev/null +++ b/examples/dishwasher-app/silabs/README.md @@ -0,0 +1,236 @@ +# Matter Silabs dishwasher Example + +An example showing the use of Matter on the Silicon Labs EFR32 MG24 boards. + +
+ +- [Matter Silabs dishwasher Example](#matter-silabs-dishwasher-example) + - [Introduction](#introduction) + - [Building](#building) + - [Flashing the Application](#flashing-the-application) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Complete Example](#running-the-complete-example) + +
+ +> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with +> frequent releases thoroughly tested and validated. Developers looking to +> develop matter products with silabs hardware are encouraged to use our latest +> release with added tools and documentation. +> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) + +## Introduction + +The Silabs dishwasher example provides a baseline demonstration of a dishwasher +control device, built using Matter and the Silicon Labs gecko SDK. It can be +controlled by a Chip controller over an Openthread or Wifi network.. + +The Silabs device can be commissioned over Bluetooth Low Energy where the device +and the Chip controller will exchange security information with the Rendez-vous +procedure. If using Thread, Thread Network credentials are then provided to the +Silabs device which will then join the Thread network. + +If the LCD is enabled, the LCD on the Silabs WSTK shows a QR Code containing the +needed commissioning information for the BLE connection and starting the +Rendez-vous procedure. + +The dishwasher example is intended to serve both as a means to explore the +workings of Matter as well as a template for creating real products based on the +Silicon Labs platform. + +## Building + +- Download the + [Simplicity Commander](https://www.silabs.com/mcu/programming-options) + command line tool, and ensure that `commander` is your shell search path. + (For Mac OS X, `commander` is located inside + `Commander.app/Contents/MacOS/`.) + +- Download and install a suitable ARM gcc tool chain: + [GNU Arm Embedded Toolchain 9-2019-q4-major](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads) + +- Install some additional tools (likely already present for CHIP developers): + + - Linux: `sudo apt-get install git ninja-build` + + - Mac OS X: `brew install ninja` + +- Supported hardware: + + - > For the latest supported hardware please refer to the + > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) + > in the Silicon Labs Matter Github Repo + + MG21 boards: Currently not supported due to RAM limitation. + + - BRD4180A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + + MG24 boards : + + - BRD2601B / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD2703A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4187C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD2703A / MG24 Explorer Kit + - BRD2704A / SparkFun Thing Plus MGM240P board + +- Build the example application: + + cd ~/connectedhomeip + ./scripts/examples/gn_silabs_example.sh ./silabs_examples/dishwasher-app/silabs/ ./out/dishwasher-app BRD4187C + +* To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip + $ rm -rf ./out/ + + OR use GN/Ninja directly + + $ cd ~/connectedhomeip/silabs_examples/dishwasher-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/dishwasher-app + $ ninja -C out/dishwasher-app + +* To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/silabs_examples/dishwasher-app/silabs + $ rm -rf out/ + +For more build options, help is provided when running the build script without +arguments + + ./scripts/examples/gn_silabs_example.sh + +## Flashing the Application + +- On the command line: + + $ python3 out/dishwasher-app/matter-silabs-dishwasher-example.flash.py + +- Or with the Ozone debugger, just load the .out file. + +All Silabs boards require a bootloader, see Silicon Labs documentation for more +info. Pre-built bootloader binaries are available in the Assets section of the +Releases page on +[Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) . + +## Viewing Logging Output + +The example application is built to use the SEGGER Real Time Transfer (RTT) +facility for log output. RTT is a feature built-in to the J-Link Interface MCU +on the WSTK development board. It allows bi-directional communication with an +embedded application without the need for a dedicated UART. + +Using the RTT facility requires downloading and installing the _SEGGER J-Link +Software and Documentation Pack_ +([web site](https://www.segger.com/downloads/jlink#J-LinkSoftwareAndDocumentationPack)). + +Alternatively, SEGGER Ozone J-Link debugger can be used to view RTT logs too +after flashing the .out file. + +- Download the J-Link installer by navigating to the appropriate URL and + agreeing to the license agreement. + +- [JLink_Linux_x86_64.deb](https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb) +- [JLink_MacOSX.pkg](https://www.segger.com/downloads/jlink/JLink_MacOSX.pkg) + +* Install the J-Link software + + $ cd ~/Downloads + $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + +* In Linux, grant the logged in user the ability to talk to the development + hardware via the linux tty device (/dev/ttyACMx) by adding them to the + dialout group. + + $ sudo usermod -a -G dialout ${USER} + +Once the above is complete, log output can be viewed using the JLinkExe tool in +combination with JLinkRTTClient as follows: + +- Run the JLinkExe tool with arguments to autoconnect to the WSTK board: + + For MG24 use: + + $ JLinkExe -device EFR32MG24AXXXF1024 -if SWD -speed 4000 -autoconnect 1 + +- In a second terminal, run the JLinkRTTClient to view logs: + + $ JLinkRTTClient + +## Running the Complete Example + +- It is assumed here that you already have an OpenThread border router + configured and running. If not see the following guide + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + for more information on how to setup a border router on a raspberryPi. + + Take note that the RCP code is available directly through + [Simplicity Studio 5](https://www.silabs.com/products/development-tools/software/simplicity-studio/simplicity-studio-5) + under File->New->Project Wizard->Examples->Thread : ot-rcp + +- User interface : **LCD** The LCD on Silabs WSTK shows a QR Code. This QR + Code is be scanned by the CHIP Tool app For the Rendez-vous procedure over + BLE + + * On devices that do not have or support the LCD Display like the BRD4166A Thunderboard Sense 2, + a URL can be found in the RTT logs. + + [SVR] Copy/paste the below URL in a browser to see the QR Code: + [SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0 + + **LED 0** shows the overall state of the device and its connectivity. The + following states are possible: + + - _Short Flash On (50 ms on/950 ms off)_ ; The device is in the + unprovisioned (unpaired) state and is waiting for a commissioning + application to connect. + + - _Rapid Even Flashing_ ; (100 ms on/100 ms off)_ — The device is in the + unprovisioned state and a commissioning application is connected through + Bluetooth LE. + + - _Short Flash Off_ ; (950ms on/50ms off)_ — The device is fully + provisioned, but does not yet have full Thread network or service + connectivity. + + - _Solid On_ ; The device is fully provisioned and has full Thread + network and service connectivity. + + **LED 1** Shows the dishwasher working state following states are possible: + + - _Solid On_ ; dishwasher is running + - _Slow_Blink_ ; dishwasher is paused + - _Off_ ; dishwasher is stopped + - _Fast_Blink_ ; dishwasher has encountered an error + + **Push Button 0** + + - _Press and Release_ : Start, or restart, BLE advertisement in fast mode. It will advertise in this mode + for 30 seconds. The device will then switch to a slower interval advertisement. + After 15 minutes, the advertisement stops. + + - _Pressed and hold for 6 s_ : Initiates the factory reset of the device. + Releasing the button within the 6-second window cancels the factory reset + procedure. **LEDs** blink in unison when the factory reset procedure is + initiated. + + **Push Button 1** Cycle the dishwasher operational states + Running/Paused/Stopped + +### Commissioning + +You can provision and control the Matter device using the python controller, +`chip-tool` standalone, Android, or iOS app. + +Silabs provides `chip-tool` as a wrapper function and more user-friendly method +of using [chip-tool](../../chip-tool/README.md) within the pre-built Raspberry +Pi image. For more info on using `chip-tool`, see +[Chiptool](../../../docs/development_controllers/chip-tool/chip_tool_guide.md). + +Here is an example using `chip-tool`: + + $ chip-tool pairing ble-thread 1 hex:0e080000000000010000000300001335060004001fffe002084fe76e9a8b5edaf50708fde46f999f0698e20510d47f5027a414ffeebaefa92285cc84fa030f4f70656e5468726561642d653439630102e49c0410b92f8c7fbb4f9f3e08492ee3915fbd2f0c0402a0fff8 20202021 3840 --ble-adapter 0 + $ chip-tool operationalstate start 1 1 diff --git a/examples/dishwasher-app/silabs/build_for_wifi_args.gni b/examples/dishwasher-app/silabs/build_for_wifi_args.gni new file mode 100644 index 0000000000..7e52816578 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_for_wifi_args.gni @@ -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}/config/standalone/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +chip_enable_openthread = false +import("${chip_root}/src/platform/silabs/wifi_args.gni") + +sl_enable_test_event_trigger = true +chip_enable_ota_requestor = true +app_data_model = + "${chip_root}/examples/dishwasher-app/silabs/data_model:silabs-dishwasher" diff --git a/examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn b/examples/dishwasher-app/silabs/build_for_wifi_gnfile.gn new file mode 100644 index 0000000000..d391814190 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_for_wifi_gnfile.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" + chip_enable_wifi = true + import("//build_for_wifi_args.gni") +} diff --git a/examples/dishwasher-app/silabs/build_overrides b/examples/dishwasher-app/silabs/build_overrides new file mode 120000 index 0000000000..f2758328a7 --- /dev/null +++ b/examples/dishwasher-app/silabs/build_overrides @@ -0,0 +1 @@ +../../../examples/build_overrides \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/data_model/BUILD.gn b/examples/dishwasher-app/silabs/data_model/BUILD.gn new file mode 100644 index 0000000000..d1ade242d1 --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/BUILD.gn @@ -0,0 +1,27 @@ +# 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") +import("${chip_root}/src/platform/device.gni") + +chip_data_model("silabs-dishwasher") { + if (chip_enable_wifi) { + zap_file = "dishwasher-wifi-app.zap" + } else { + zap_file = "dishwasher-thread-app.zap" + } + + is_server = true +} diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter new file mode 100644 index 0000000000..0d217ab47b --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter @@ -0,0 +1,2809 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +cluster Binding = 30 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + 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; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + 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 ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** 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 */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster TimeFormatLocalization = 44 { + revision 1; // NOTE: Default/not specifically set + + 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; + kUseActiveLocale = 255; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + kUseActiveLocale = 255; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute access(write: manage) HourFormatEnum hourFormat = 0; + attribute access(write: manage) optional CalendarTypeEnum activeCalendarType = 1; + readonly attribute optional 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. */ +cluster UnitLocalization = 45 { + revision 1; + + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute access(write: manage) optional 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 manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + 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; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + 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; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + 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. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster SoftwareDiagnostics = 52 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kWatermarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + int64u id = 0; + optional char_string name = 1; + optional octet_string faultRecording = 2; + } + + readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0; + readonly attribute optional int64u currentHeapFree = 1; + readonly attribute optional int64u currentHeapUsed = 2; + readonly attribute optional int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */ + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; +} + +/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ +cluster ThreadNetworkDiagnostics = 53 { + revision 2; + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kLinkDown = 1; + kHardwareFailure = 2; + kNetworkJammed = 3; + } + + enum RoutingRoleEnum : enum8 { + kUnspecified = 0; + kUnassigned = 1; + kSleepyEndDevice = 2; + kEndDevice = 3; + kREED = 4; + kRouter = 5; + kLeader = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + kMLECounts = 0x4; + kMACCounts = 0x8; + } + + struct NeighborTableStruct { + int64u extAddress = 0; + int32u age = 1; + int16u rloc16 = 2; + int32u linkFrameCounter = 3; + int32u mleFrameCounter = 4; + int8u lqi = 5; + nullable int8s averageRssi = 6; + nullable int8s lastRssi = 7; + int8u frameErrorRate = 8; + int8u messageErrorRate = 9; + boolean rxOnWhenIdle = 10; + boolean fullThreadDevice = 11; + boolean fullNetworkData = 12; + boolean isChild = 13; + } + + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + + struct RouteTableStruct { + int64u extAddress = 0; + int16u rloc16 = 1; + int8u routerId = 2; + int8u nextHop = 3; + int8u pathCost = 4; + int8u LQIIn = 5; + int8u LQIOut = 6; + int8u age = 7; + boolean allocated = 8; + boolean linkEstablished = 9; + } + + struct SecurityPolicy { + int16u rotationTime = 0; + int16u flags = 1; + } + + info event ConnectionStatus = 0 { + ConnectionStatusEnum connectionStatus = 0; + } + + info event NetworkFaultChange = 1 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + readonly attribute nullable int16u channel = 0; + readonly attribute nullable RoutingRoleEnum routingRole = 1; + readonly attribute nullable char_string<16> networkName = 2; + readonly attribute nullable int16u panId = 3; + readonly attribute nullable int64u extendedPanId = 4; + readonly attribute nullable octet_string<17> meshLocalPrefix = 5; + readonly attribute optional int64u overrunCount = 6; + readonly attribute NeighborTableStruct neighborTable[] = 7; + readonly attribute RouteTableStruct routeTable[] = 8; + readonly attribute nullable int32u partitionId = 9; + readonly attribute nullable int16u weighting = 10; + readonly attribute nullable int16u dataVersion = 11; + readonly attribute nullable int16u stableDataVersion = 12; + readonly attribute nullable int8u leaderRouterId = 13; + readonly attribute optional int16u detachedRoleCount = 14; + readonly attribute optional int16u childRoleCount = 15; + readonly attribute optional int16u routerRoleCount = 16; + readonly attribute optional int16u leaderRoleCount = 17; + readonly attribute optional int16u attachAttemptCount = 18; + readonly attribute optional int16u partitionIdChangeCount = 19; + readonly attribute optional int16u betterPartitionAttachAttemptCount = 20; + readonly attribute optional int16u parentChangeCount = 21; + readonly attribute optional int32u txTotalCount = 22; + readonly attribute optional int32u txUnicastCount = 23; + readonly attribute optional int32u txBroadcastCount = 24; + readonly attribute optional int32u txAckRequestedCount = 25; + readonly attribute optional int32u txAckedCount = 26; + readonly attribute optional int32u txNoAckRequestedCount = 27; + readonly attribute optional int32u txDataCount = 28; + readonly attribute optional int32u txDataPollCount = 29; + readonly attribute optional int32u txBeaconCount = 30; + readonly attribute optional int32u txBeaconRequestCount = 31; + readonly attribute optional int32u txOtherCount = 32; + readonly attribute optional int32u txRetryCount = 33; + readonly attribute optional int32u txDirectMaxRetryExpiryCount = 34; + readonly attribute optional int32u txIndirectMaxRetryExpiryCount = 35; + readonly attribute optional int32u txErrCcaCount = 36; + readonly attribute optional int32u txErrAbortCount = 37; + readonly attribute optional int32u txErrBusyChannelCount = 38; + readonly attribute optional int32u rxTotalCount = 39; + readonly attribute optional int32u rxUnicastCount = 40; + readonly attribute optional int32u rxBroadcastCount = 41; + readonly attribute optional int32u rxDataCount = 42; + readonly attribute optional int32u rxDataPollCount = 43; + readonly attribute optional int32u rxBeaconCount = 44; + readonly attribute optional int32u rxBeaconRequestCount = 45; + readonly attribute optional int32u rxOtherCount = 46; + readonly attribute optional int32u rxAddressFilteredCount = 47; + readonly attribute optional int32u rxDestAddrFilteredCount = 48; + readonly attribute optional int32u rxDuplicatedCount = 49; + readonly attribute optional int32u rxErrNoFrameCount = 50; + readonly attribute optional int32u rxErrUnknownNeighborCount = 51; + readonly attribute optional int32u rxErrInvalidSrcAddrCount = 52; + readonly attribute optional int32u rxErrSecCount = 53; + readonly attribute optional int32u rxErrFcsCount = 54; + readonly attribute optional int32u rxErrOtherCount = 55; + readonly attribute optional nullable int64u activeTimestamp = 56; + readonly attribute optional nullable int64u pendingTimestamp = 57; + readonly attribute optional nullable int32u delay = 58; + readonly attribute nullable SecurityPolicy securityPolicy = 59; + readonly attribute nullable octet_string<4> channelPage0Mask = 60; + readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61; + readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the OverrunCount attributes to 0 */ + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +cluster FixedLabel = 64 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster UserLabel = 65 { + revision 1; // NOTE: Default/not specifically set + + 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; +} + +/** 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. */ +cluster OperationalState = 96 { + revision 1; + + enum ErrorStateEnum : enum8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : enum8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + enum8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable char_string phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateEnum operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 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; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ +cluster ElectricalPowerMeasurement = 144 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + enum PowerModeEnum : enum8 { + kUnknown = 0; + kDC = 1; + kAC = 2; + } + + bitmap Feature : bitmap32 { + kDirectCurrent = 0x1; + kAlternatingCurrent = 0x2; + kPolyphasePower = 0x4; + kHarmonics = 0x8; + kPowerQuality = 0x10; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct HarmonicMeasurementStruct { + int8u order = 0; + nullable int64s measurement = 1; + } + + struct MeasurementRangeStruct { + MeasurementTypeEnum measurementType = 0; + int64s min = 1; + int64s max = 2; + optional epoch_s startTimestamp = 3; + optional epoch_s endTimestamp = 4; + optional epoch_s minTimestamp = 5; + optional epoch_s maxTimestamp = 6; + optional systime_ms startSystime = 7; + optional systime_ms endSystime = 8; + optional systime_ms minSystime = 9; + optional systime_ms maxSystime = 10; + } + + info event MeasurementPeriodRanges = 0 { + MeasurementRangeStruct ranges[] = 0; + } + + readonly attribute PowerModeEnum powerMode = 0; + readonly attribute int8u numberOfMeasurementTypes = 1; + readonly attribute MeasurementAccuracyStruct accuracy[] = 2; + readonly attribute optional MeasurementRangeStruct ranges[] = 3; + readonly attribute optional nullable voltage_mv voltage = 4; + readonly attribute optional nullable amperage_ma activeCurrent = 5; + readonly attribute optional nullable amperage_ma reactiveCurrent = 6; + readonly attribute optional nullable amperage_ma apparentCurrent = 7; + readonly attribute nullable power_mw activePower = 8; + readonly attribute optional nullable power_mw reactivePower = 9; + readonly attribute optional nullable power_mw apparentPower = 10; + readonly attribute optional nullable voltage_mv RMSVoltage = 11; + readonly attribute optional nullable amperage_ma RMSCurrent = 12; + readonly attribute optional nullable power_mw RMSPower = 13; + readonly attribute optional nullable int64s frequency = 14; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicCurrents[] = 15; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicPhases[] = 16; + readonly attribute optional nullable int64s powerFactor = 17; + readonly attribute optional nullable amperage_ma neutralCurrent = 18; + 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 a mechanism for querying data about the electrical energy imported or provided by the server. */ +cluster ElectricalEnergyMeasurement = 145 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + bitmap Feature : bitmap32 { + kImportedEnergy = 0x1; + kExportedEnergy = 0x2; + kCumulativeEnergy = 0x4; + kPeriodicEnergy = 0x8; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct CumulativeEnergyResetStruct { + optional nullable epoch_s importedResetTimestamp = 0; + optional nullable epoch_s exportedResetTimestamp = 1; + optional nullable systime_ms importedResetSystime = 2; + optional nullable systime_ms exportedResetSystime = 3; + } + + struct EnergyMeasurementStruct { + energy_mwh energy = 0; + optional epoch_s startTimestamp = 1; + optional epoch_s endTimestamp = 2; + optional systime_ms startSystime = 3; + optional systime_ms endSystime = 4; + } + + info event CumulativeEnergyMeasured = 0 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + info event PeriodicEnergyMeasured = 1 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + readonly attribute MeasurementAccuracyStruct accuracy = 0; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyImported = 1; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4; + readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 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; +} + +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 4; + + enum AdjustmentCauseEnum : enum8 { + kLocalOptimization = 0; + kGridOptimization = 1; + } + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + kCancelled = 4; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kPowerAdjustActive = 3; + kPaused = 4; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + enum ForecastUpdateReasonEnum : enum8 { + kInternalOptimization = 0; + kLocalOptimization = 1; + kGridOptimization = 2; + } + + enum OptOutStateEnum : enum8 { + kNoOptOut = 0; + kLocalOptOut = 1; + kGridOptOut = 2; + kOptOut = 3; + } + + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kStartTimeAdjustment = 0x8; + kPausable = 0x10; + kForecastAdjustment = 0x20; + kConstraintBasedAdjustment = 0x40; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + optional boolean slotIsPausable = 5; + optional elapsed_s minPauseDuration = 6; + optional elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int32u forecastID = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPausable = 6; + SlotStruct slots[] = 7; + ForecastUpdateReasonEnum forecastUpdateReason = 8; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + optional power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + CauseEnum cause = 0; + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute optional OptOutStateEnum optOutState = 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 PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct ModifyForecastRequestRequest { + int32u forecastID = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + AdjustmentCauseEnum cause = 1; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + command CancelRequest(): DefaultSuccess = 7; +} + +/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ +cluster PowerTopology = 156 { + revision 1; + + bitmap Feature : bitmap32 { + kNodeTopology = 0x1; + kTreeTopology = 0x2; + kSetTopology = 0x4; + kDynamicPowerFlow = 0x8; + } + + readonly attribute optional endpoint_no availableEndpoints[] = 0; + readonly attribute optional endpoint_no activeEndpoints[] = 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; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster DeviceEnergyManagementMode = 159 { + revision 1; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kNoOptimization = 16384; + kDeviceOptimization = 16385; + kLocalOptimization = 16386; + kGridOptimization = 16387; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 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 ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + 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; + } + + server cluster BasicInformation { + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateRequestor { + 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 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 = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute supportedThreadFeatures; + callback attribute threadVersion; + 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 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; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster SoftwareDiagnostics { + emits event SoftwareFault; + callback attribute threadMetrics; + callback attribute currentHeapFree; + callback attribute currentHeapUsed; + callback attribute currentHeapHighWatermark; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ResetWatermarks; + } + + server cluster ThreadNetworkDiagnostics { + callback attribute channel; + callback attribute routingRole; + callback attribute networkName; + callback attribute panId; + callback attribute extendedPanId; + callback attribute meshLocalPrefix; + callback attribute overrunCount; + callback attribute neighborTable; + callback attribute routeTable; + callback attribute partitionId; + callback attribute weighting; + callback attribute dataVersion; + callback attribute stableDataVersion; + callback attribute leaderRouterId; + callback attribute detachedRoleCount; + callback attribute childRoleCount; + callback attribute routerRoleCount; + callback attribute leaderRoleCount; + callback attribute attachAttemptCount; + callback attribute partitionIdChangeCount; + callback attribute betterPartitionAttachAttemptCount; + callback attribute parentChangeCount; + callback attribute txTotalCount; + callback attribute txUnicastCount; + callback attribute txBroadcastCount; + callback attribute txAckRequestedCount; + callback attribute txAckedCount; + callback attribute txNoAckRequestedCount; + callback attribute txDataCount; + callback attribute txDataPollCount; + callback attribute txBeaconCount; + callback attribute txBeaconRequestCount; + callback attribute txOtherCount; + callback attribute txRetryCount; + callback attribute txDirectMaxRetryExpiryCount; + callback attribute txIndirectMaxRetryExpiryCount; + callback attribute txErrCcaCount; + callback attribute txErrAbortCount; + callback attribute txErrBusyChannelCount; + callback attribute rxTotalCount; + callback attribute rxUnicastCount; + callback attribute rxBroadcastCount; + callback attribute rxDataCount; + callback attribute rxDataPollCount; + callback attribute rxBeaconCount; + callback attribute rxBeaconRequestCount; + callback attribute rxOtherCount; + callback attribute rxAddressFilteredCount; + callback attribute rxDestAddrFilteredCount; + callback attribute rxDuplicatedCount; + callback attribute rxErrNoFrameCount; + callback attribute rxErrUnknownNeighborCount; + callback attribute rxErrInvalidSrcAddrCount; + callback attribute rxErrSecCount; + callback attribute rxErrFcsCount; + callback attribute rxErrOtherCount; + callback attribute activeTimestamp; + callback attribute pendingTimestamp; + callback attribute delay; + callback attribute securityPolicy; + callback attribute channelPage0Mask; + callback attribute operationalDatasetComponents; + callback attribute activeNetworkFaultsList; + ram attribute featureMap default = 0x000F; + ram attribute clusterRevision default = 2; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command 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; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_dishwasher = 117, 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalState { + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command Pause; + handle command Stop; + handle command Start; + handle command Resume; + handle command OperationalCommandResponse; + } +} +endpoint 2 { + device type ma_electricalsensor = 1296, version 1; + + + 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster ElectricalPowerMeasurement { + emits event MeasurementPeriodRanges; + callback attribute powerMode; + callback attribute numberOfMeasurementTypes; + callback attribute accuracy; + callback attribute ranges; + callback attribute voltage; + callback attribute activeCurrent; + callback attribute reactiveCurrent; + callback attribute apparentCurrent; + callback attribute activePower; + callback attribute reactivePower; + callback attribute apparentPower; + callback attribute RMSVoltage; + callback attribute RMSCurrent; + callback attribute RMSPower; + callback attribute frequency; + callback attribute harmonicCurrents; + callback attribute harmonicPhases; + callback attribute powerFactor; + callback attribute neutralCurrent; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster ElectricalEnergyMeasurement { + emits event CumulativeEnergyMeasured; + callback attribute accuracy; + callback attribute cumulativeEnergyImported; + callback attribute cumulativeEnergyReset; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster PowerTopology { + callback attribute availableEndpoints; + callback attribute activeEndpoints; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } +} +endpoint 3 { + device type device_energy_management = 1293, version 1; + + + 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute optOutState; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 3; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; + handle command CancelRequest; + } + + server cluster DeviceEnergyManagementMode { + callback attribute supportedModes; + callback attribute currentMode; + ram attribute startUpMode; + ram attribute onMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } +} + + diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap new file mode 100644 index 0000000000..f7927d1a6a --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.zap @@ -0,0 +1,6002 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "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", + "category": "matter", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": "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": 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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedThreadFeatures", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "ThreadCapabilitiesBitmap", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ThreadVersion", + "code": 10, + "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": "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": "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 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "SoftwareFault", + "code": 0, + "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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-dishwasher", + "deviceTypeRef": { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + }, + "deviceTypes": [ + { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 117 + ], + "deviceTypeName": "MA-dishwasher", + "deviceTypeCode": 117, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "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": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 3, + "name": "MA-electricalsensor", + "deviceTypeRef": { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + }, + "deviceTypes": [ + { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1296 + ], + "deviceTypeName": "MA-electricalsensor", + "deviceTypeCode": 1296, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Power Measurement", + "code": 144, + "mfgCode": null, + "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "PowerMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerModeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfMeasurementTypes", + "code": 1, + "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": "Accuracy", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Ranges", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Voltage", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCurrent", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactiveCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentCurrent", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePower", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactivePower", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentPower", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSCurrent", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSPower", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Frequency", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicCurrents", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicPhases", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerFactor", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeutralCurrent", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "MeasurementPeriodRanges", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Electrical Energy Measurement", + "code": 145, + "mfgCode": null, + "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Accuracy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "MeasurementAccuracyStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyImported", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "EnergyMeasurementStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyReset", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "CumulativeEnergyResetStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "CumulativeEnergyMeasured", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "AvailableEndpoints", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveEndpoints", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "MA-deviceenergymanagement", + "deviceTypeRef": { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + }, + "deviceTypes": [ + { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1293 + ], + "deviceTypeName": "Device Energy Management", + "deviceTypeCode": 1293, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "PowerAdjustCapabilityStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OptOutState", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "OptOutStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Device Energy Management Mode", + "code": 159, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "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": "StartUpMode", + "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": "OnMode", + "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": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-dishwasher", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-electricalsensor", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-deviceenergymanagement", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter new file mode 100644 index 0000000000..3c8601d09b --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter @@ -0,0 +1,2669 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +cluster Binding = 30 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + 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; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + 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 ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** 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 */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster TimeFormatLocalization = 44 { + revision 1; // NOTE: Default/not specifically set + + 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; + kUseActiveLocale = 255; + } + + enum HourFormatEnum : enum8 { + k12hr = 0; + k24hr = 1; + kUseActiveLocale = 255; + } + + bitmap Feature : bitmap32 { + kCalendarFormat = 0x1; + } + + attribute access(write: manage) HourFormatEnum hourFormat = 0; + attribute access(write: manage) optional CalendarTypeEnum activeCalendarType = 1; + readonly attribute optional 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. */ +cluster UnitLocalization = 45 { + revision 1; + + enum TempUnitEnum : enum8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : bitmap32 { + kTemperatureUnit = 0x1; + } + + attribute access(write: manage) optional 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 manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + 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; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + 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; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + 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. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +cluster SoftwareDiagnostics = 52 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kWatermarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + int64u id = 0; + optional char_string name = 1; + optional octet_string faultRecording = 2; + } + + readonly attribute optional ThreadMetricsStruct threadMetrics[] = 0; + readonly attribute optional int64u currentHeapFree = 1; + readonly attribute optional int64u currentHeapUsed = 2; + readonly attribute optional int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the values: The StackFreeMinimum field of the ThreadMetrics attribute, CurrentHeapHighWaterMark attribute. */ + command access(invoke: manage) ResetWatermarks(): DefaultSuccess = 0; +} + +/** The 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. */ +cluster WiFiNetworkDiagnostics = 54 { + revision 1; // NOTE: Default/not specifically set + + 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 associationFailureCause = 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 optional nullable int32u beaconLostCount = 5; + readonly attribute optional nullable int32u beaconRxCount = 6; + readonly attribute optional nullable int32u packetMulticastRxCount = 7; + readonly attribute optional nullable int32u packetMulticastTxCount = 8; + readonly attribute optional nullable int32u packetUnicastRxCount = 9; + readonly attribute optional nullable int32u packetUnicastTxCount = 10; + readonly attribute optional nullable int64u currentMaxRate = 11; + readonly attribute optional 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; + + /** Reception of this command SHALL reset the Breacon and Packet related count attributes to 0 */ + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +cluster FixedLabel = 64 { + revision 1; // NOTE: Default/not specifically set + + 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. */ +cluster UserLabel = 65 { + revision 1; // NOTE: Default/not specifically set + + 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; +} + +/** 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. */ +cluster OperationalState = 96 { + revision 1; + + enum ErrorStateEnum : enum8 { + kNoError = 0; + kUnableToStartOrResume = 1; + kUnableToCompleteOperation = 2; + kCommandInvalidInState = 3; + } + + enum OperationalStateEnum : enum8 { + kStopped = 0; + kRunning = 1; + kPaused = 2; + kError = 3; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + enum8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable char_string phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute optional nullable elapsed_s countdownTime = 2; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute OperationalStateEnum operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 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; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + /** Upon receipt, the device SHALL pause its operation if it is possible based on the current function of the server. */ + command Pause(): OperationalCommandResponse = 0; + /** Upon receipt, the device SHALL stop its operation if it is at a position where it is safe to do so and/or permitted. */ + command Stop(): OperationalCommandResponse = 1; + /** Upon receipt, the device SHALL start its operation if it is safe to do so and the device is in an operational state from which it can be started. */ + command Start(): OperationalCommandResponse = 2; + /** Upon receipt, the device SHALL resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press). */ + command Resume(): OperationalCommandResponse = 3; +} + +/** This cluster provides a mechanism for querying data about electrical power as measured by the server. */ +cluster ElectricalPowerMeasurement = 144 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + enum PowerModeEnum : enum8 { + kUnknown = 0; + kDC = 1; + kAC = 2; + } + + bitmap Feature : bitmap32 { + kDirectCurrent = 0x1; + kAlternatingCurrent = 0x2; + kPolyphasePower = 0x4; + kHarmonics = 0x8; + kPowerQuality = 0x10; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct HarmonicMeasurementStruct { + int8u order = 0; + nullable int64s measurement = 1; + } + + struct MeasurementRangeStruct { + MeasurementTypeEnum measurementType = 0; + int64s min = 1; + int64s max = 2; + optional epoch_s startTimestamp = 3; + optional epoch_s endTimestamp = 4; + optional epoch_s minTimestamp = 5; + optional epoch_s maxTimestamp = 6; + optional systime_ms startSystime = 7; + optional systime_ms endSystime = 8; + optional systime_ms minSystime = 9; + optional systime_ms maxSystime = 10; + } + + info event MeasurementPeriodRanges = 0 { + MeasurementRangeStruct ranges[] = 0; + } + + readonly attribute PowerModeEnum powerMode = 0; + readonly attribute int8u numberOfMeasurementTypes = 1; + readonly attribute MeasurementAccuracyStruct accuracy[] = 2; + readonly attribute optional MeasurementRangeStruct ranges[] = 3; + readonly attribute optional nullable voltage_mv voltage = 4; + readonly attribute optional nullable amperage_ma activeCurrent = 5; + readonly attribute optional nullable amperage_ma reactiveCurrent = 6; + readonly attribute optional nullable amperage_ma apparentCurrent = 7; + readonly attribute nullable power_mw activePower = 8; + readonly attribute optional nullable power_mw reactivePower = 9; + readonly attribute optional nullable power_mw apparentPower = 10; + readonly attribute optional nullable voltage_mv RMSVoltage = 11; + readonly attribute optional nullable amperage_ma RMSCurrent = 12; + readonly attribute optional nullable power_mw RMSPower = 13; + readonly attribute optional nullable int64s frequency = 14; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicCurrents[] = 15; + readonly attribute optional nullable HarmonicMeasurementStruct harmonicPhases[] = 16; + readonly attribute optional nullable int64s powerFactor = 17; + readonly attribute optional nullable amperage_ma neutralCurrent = 18; + 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 a mechanism for querying data about the electrical energy imported or provided by the server. */ +cluster ElectricalEnergyMeasurement = 145 { + revision 1; + + enum MeasurementTypeEnum : enum16 { + kUnspecified = 0; + kVoltage = 1; + kActiveCurrent = 2; + kReactiveCurrent = 3; + kApparentCurrent = 4; + kActivePower = 5; + kReactivePower = 6; + kApparentPower = 7; + kRMSVoltage = 8; + kRMSCurrent = 9; + kRMSPower = 10; + kFrequency = 11; + kPowerFactor = 12; + kNeutralCurrent = 13; + kElectricalEnergy = 14; + } + + bitmap Feature : bitmap32 { + kImportedEnergy = 0x1; + kExportedEnergy = 0x2; + kCumulativeEnergy = 0x4; + kPeriodicEnergy = 0x8; + } + + struct MeasurementAccuracyRangeStruct { + int64s rangeMin = 0; + int64s rangeMax = 1; + optional percent100ths percentMax = 2; + optional percent100ths percentMin = 3; + optional percent100ths percentTypical = 4; + optional int64u fixedMax = 5; + optional int64u fixedMin = 6; + optional int64u fixedTypical = 7; + } + + struct MeasurementAccuracyStruct { + MeasurementTypeEnum measurementType = 0; + boolean measured = 1; + int64s minMeasuredValue = 2; + int64s maxMeasuredValue = 3; + MeasurementAccuracyRangeStruct accuracyRanges[] = 4; + } + + struct CumulativeEnergyResetStruct { + optional nullable epoch_s importedResetTimestamp = 0; + optional nullable epoch_s exportedResetTimestamp = 1; + optional nullable systime_ms importedResetSystime = 2; + optional nullable systime_ms exportedResetSystime = 3; + } + + struct EnergyMeasurementStruct { + energy_mwh energy = 0; + optional epoch_s startTimestamp = 1; + optional epoch_s endTimestamp = 2; + optional systime_ms startSystime = 3; + optional systime_ms endSystime = 4; + } + + info event CumulativeEnergyMeasured = 0 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + info event PeriodicEnergyMeasured = 1 { + optional EnergyMeasurementStruct energyImported = 0; + optional EnergyMeasurementStruct energyExported = 1; + } + + readonly attribute MeasurementAccuracyStruct accuracy = 0; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyImported = 1; + readonly attribute optional nullable EnergyMeasurementStruct cumulativeEnergyExported = 2; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyImported = 3; + readonly attribute optional nullable EnergyMeasurementStruct periodicEnergyExported = 4; + readonly attribute optional nullable CumulativeEnergyResetStruct cumulativeEnergyReset = 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; +} + +/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */ +provisional cluster DeviceEnergyManagement = 152 { + revision 4; + + enum AdjustmentCauseEnum : enum8 { + kLocalOptimization = 0; + kGridOptimization = 1; + } + + enum CauseEnum : enum8 { + kNormalCompletion = 0; + kOffline = 1; + kFault = 2; + kUserOptOut = 3; + kCancelled = 4; + } + + enum CostTypeEnum : enum8 { + kFinancial = 0; + kGHGEmissions = 1; + kComfort = 2; + kTemperature = 3; + } + + enum ESAStateEnum : enum8 { + kOffline = 0; + kOnline = 1; + kFault = 2; + kPowerAdjustActive = 3; + kPaused = 4; + } + + enum ESATypeEnum : enum8 { + kEVSE = 0; + kSpaceHeating = 1; + kWaterHeating = 2; + kSpaceCooling = 3; + kSpaceHeatingCooling = 4; + kBatteryStorage = 5; + kSolarPV = 6; + kFridgeFreezer = 7; + kWashingMachine = 8; + kDishwasher = 9; + kCooking = 10; + kHomeWaterPump = 11; + kIrrigationWaterPump = 12; + kPoolPump = 13; + kOther = 255; + } + + enum ForecastUpdateReasonEnum : enum8 { + kInternalOptimization = 0; + kLocalOptimization = 1; + kGridOptimization = 2; + } + + enum OptOutStateEnum : enum8 { + kNoOptOut = 0; + kLocalOptOut = 1; + kGridOptOut = 2; + kOptOut = 3; + } + + enum PowerAdjustReasonEnum : enum8 { + kNoAdjustment = 0; + kLocalOptimizationAdjustment = 1; + kGridOptimizationAdjustment = 2; + } + + bitmap Feature : bitmap32 { + kPowerAdjustment = 0x1; + kPowerForecastReporting = 0x2; + kStateForecastReporting = 0x4; + kStartTimeAdjustment = 0x8; + kPausable = 0x10; + kForecastAdjustment = 0x20; + kConstraintBasedAdjustment = 0x40; + } + + struct CostStruct { + CostTypeEnum costType = 0; + int32s value = 1; + int8u decimalPoints = 2; + optional int16u currency = 3; + } + + struct PowerAdjustStruct { + power_mw minPower = 0; + power_mw maxPower = 1; + elapsed_s minDuration = 2; + elapsed_s maxDuration = 3; + } + + struct PowerAdjustCapabilityStruct { + nullable PowerAdjustStruct powerAdjustCapability[] = 0; + PowerAdjustReasonEnum cause = 1; + } + + struct SlotStruct { + elapsed_s minDuration = 0; + elapsed_s maxDuration = 1; + elapsed_s defaultDuration = 2; + elapsed_s elapsedSlotTime = 3; + elapsed_s remainingSlotTime = 4; + optional boolean slotIsPausable = 5; + optional elapsed_s minPauseDuration = 6; + optional elapsed_s maxPauseDuration = 7; + optional int16u manufacturerESAState = 8; + optional power_mw nominalPower = 9; + optional power_mw minPower = 10; + optional power_mw maxPower = 11; + optional energy_mwh nominalEnergy = 12; + optional CostStruct costs[] = 13; + optional power_mw minPowerAdjustment = 14; + optional power_mw maxPowerAdjustment = 15; + optional elapsed_s minDurationAdjustment = 16; + optional elapsed_s maxDurationAdjustment = 17; + } + + struct ForecastStruct { + int32u forecastID = 0; + nullable int16u activeSlotNumber = 1; + epoch_s startTime = 2; + epoch_s endTime = 3; + optional nullable epoch_s earliestStartTime = 4; + optional epoch_s latestEndTime = 5; + boolean isPausable = 6; + SlotStruct slots[] = 7; + ForecastUpdateReasonEnum forecastUpdateReason = 8; + } + + struct ConstraintsStruct { + epoch_s startTime = 0; + elapsed_s duration = 1; + optional power_mw nominalPower = 2; + optional energy_mwh maximumEnergy = 3; + optional int8s loadControl = 4; + } + + struct SlotAdjustmentStruct { + int8u slotIndex = 0; + optional power_mw nominalPower = 1; + elapsed_s duration = 2; + } + + info event PowerAdjustStart = 0 { + } + + info event PowerAdjustEnd = 1 { + CauseEnum cause = 0; + elapsed_s duration = 1; + energy_mwh energyUse = 2; + } + + info event Paused = 2 { + } + + info event Resumed = 3 { + CauseEnum cause = 0; + } + + readonly attribute ESATypeEnum ESAType = 0; + readonly attribute boolean ESACanGenerate = 1; + readonly attribute ESAStateEnum ESAState = 2; + readonly attribute power_mw absMinPower = 3; + readonly attribute power_mw absMaxPower = 4; + readonly attribute optional nullable PowerAdjustCapabilityStruct powerAdjustmentCapability = 5; + readonly attribute optional nullable ForecastStruct forecast = 6; + readonly attribute optional OptOutStateEnum optOutState = 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 PowerAdjustRequestRequest { + power_mw power = 0; + elapsed_s duration = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct StartTimeAdjustRequestRequest { + epoch_s requestedStartTime = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct PauseRequestRequest { + elapsed_s duration = 0; + AdjustmentCauseEnum cause = 1; + } + + request struct ModifyForecastRequestRequest { + int32u forecastID = 0; + SlotAdjustmentStruct slotAdjustments[] = 1; + AdjustmentCauseEnum cause = 2; + } + + request struct RequestConstraintBasedForecastRequest { + ConstraintsStruct constraints[] = 0; + AdjustmentCauseEnum cause = 1; + } + + /** Allows a client to request an adjustment in the power consumption of an ESA for a specified duration. */ + command PowerAdjustRequest(PowerAdjustRequestRequest): DefaultSuccess = 0; + /** Allows a client to cancel an ongoing PowerAdjustmentRequest operation. */ + command CancelPowerAdjustRequest(): DefaultSuccess = 1; + /** Allows a client to adjust the start time of a Forecast sequence that has not yet started operation (i.e. where the current Forecast StartTime is in the future). */ + command StartTimeAdjustRequest(StartTimeAdjustRequestRequest): DefaultSuccess = 2; + /** Allows a client to temporarily pause an operation and reduce the ESAs energy demand. */ + command PauseRequest(PauseRequestRequest): DefaultSuccess = 3; + /** Allows a client to cancel the PauseRequest command and enable earlier resumption of operation. */ + command ResumeRequest(): DefaultSuccess = 4; + /** Allows a client to modify a Forecast within the limits allowed by the ESA. */ + command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; + /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ + command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + command CancelRequest(): DefaultSuccess = 7; +} + +/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ +cluster PowerTopology = 156 { + revision 1; + + bitmap Feature : bitmap32 { + kNodeTopology = 0x1; + kTreeTopology = 0x2; + kSetTopology = 0x4; + kDynamicPowerFlow = 0x8; + } + + readonly attribute optional endpoint_no availableEndpoints[] = 0; + readonly attribute optional endpoint_no activeEndpoints[] = 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; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +provisional cluster DeviceEnergyManagementMode = 159 { + revision 1; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kNoOptimization = 16384; + kDeviceOptimization = 16385; + kLocalOptimization = 16386; + kGridOptimization = 16387; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 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 ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string<64> statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + 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; + } + + server cluster BasicInformation { + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateRequestor { + 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 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 = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command ArmFailSafe; + handle command ArmFailSafeResponse; + handle command SetRegulatoryConfig; + handle command SetRegulatoryConfigResponse; + handle command CommissioningComplete; + handle command CommissioningCompleteResponse; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute supportedWiFiBands; + 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 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; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster SoftwareDiagnostics { + emits event SoftwareFault; + callback attribute threadMetrics; + callback attribute currentHeapFree; + callback attribute currentHeapUsed; + callback attribute currentHeapHighWatermark; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ResetWatermarks; + } + + server cluster WiFiNetworkDiagnostics { + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber; + callback attribute rssi; + callback attribute beaconLostCount; + callback attribute beaconRxCount; + callback attribute packetMulticastRxCount; + callback attribute packetMulticastTxCount; + callback attribute packetUnicastRxCount; + callback attribute packetUnicastTxCount; + callback attribute currentMaxRate; + callback attribute overrunCount; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command 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; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_dishwasher = 117, 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster Binding { + callback attribute binding; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalState { + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command Pause; + handle command Stop; + handle command Start; + handle command Resume; + handle command OperationalCommandResponse; + } +} +endpoint 2 { + device type ma_electricalsensor = 1296, version 1; + + + 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster ElectricalPowerMeasurement { + emits event MeasurementPeriodRanges; + callback attribute powerMode; + callback attribute numberOfMeasurementTypes; + callback attribute accuracy; + callback attribute ranges; + callback attribute voltage; + callback attribute activeCurrent; + callback attribute reactiveCurrent; + callback attribute apparentCurrent; + callback attribute activePower; + callback attribute reactivePower; + callback attribute apparentPower; + callback attribute RMSVoltage; + callback attribute RMSCurrent; + callback attribute RMSPower; + callback attribute frequency; + callback attribute harmonicCurrents; + callback attribute harmonicPhases; + callback attribute powerFactor; + callback attribute neutralCurrent; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster ElectricalEnergyMeasurement { + emits event CumulativeEnergyMeasured; + callback attribute accuracy; + callback attribute cumulativeEnergyImported; + callback attribute cumulativeEnergyReset; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + + server cluster PowerTopology { + callback attribute availableEndpoints; + callback attribute activeEndpoints; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } +} +endpoint 3 { + device type device_energy_management = 1293, version 1; + + + 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster DeviceEnergyManagement { + emits event PowerAdjustStart; + emits event PowerAdjustEnd; + emits event Paused; + emits event Resumed; + callback attribute ESAType; + callback attribute ESACanGenerate; + callback attribute ESAState; + callback attribute absMinPower; + callback attribute absMaxPower; + callback attribute powerAdjustmentCapability; + callback attribute forecast; + callback attribute optOutState; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 3; + + handle command PowerAdjustRequest; + handle command CancelPowerAdjustRequest; + handle command StartTimeAdjustRequest; + handle command PauseRequest; + handle command ResumeRequest; + handle command ModifyForecastRequest; + handle command RequestConstraintBasedForecast; + handle command CancelRequest; + } + + server cluster DeviceEnergyManagementMode { + callback attribute supportedModes; + callback attribute currentMode; + ram attribute startUpMode; + ram attribute onMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } +} + + diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap new file mode 100644 index 0000000000..61d3ad5f4c --- /dev/null +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.zap @@ -0,0 +1,5189 @@ +{ + "fileFormat": 2, + "featureLevel": 100, + "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", + "category": "matter", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "UpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": "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": 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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedWiFiBands", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "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 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "SoftwareFault", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-dishwasher", + "deviceTypeRef": { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + }, + "deviceTypes": [ + { + "code": 117, + "profileId": 259, + "label": "MA-dishwasher", + "name": "MA-dishwasher" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 117 + ], + "deviceTypeName": "MA-dishwasher", + "deviceTypeCode": 117, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "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": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 3, + "name": "MA-electricalsensor", + "deviceTypeRef": { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + }, + "deviceTypes": [ + { + "code": 1296, + "profileId": 259, + "label": "MA-electricalsensor", + "name": "MA-electricalsensor" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1296 + ], + "deviceTypeName": "MA-electricalsensor", + "deviceTypeCode": 1296, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Electrical Power Measurement", + "code": 144, + "mfgCode": null, + "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "PowerMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PowerModeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfMeasurementTypes", + "code": 1, + "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": "Accuracy", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Ranges", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Voltage", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCurrent", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactiveCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentCurrent", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePower", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReactivePower", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ApparentPower", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "voltage_mv", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSCurrent", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RMSPower", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Frequency", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicCurrents", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "HarmonicPhases", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerFactor", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int64s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeutralCurrent", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "amperage_ma", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "MeasurementPeriodRanges", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Electrical Energy Measurement", + "code": 145, + "mfgCode": null, + "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "Accuracy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "MeasurementAccuracyStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyImported", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "EnergyMeasurementStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CumulativeEnergyReset", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "CumulativeEnergyResetStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "CumulativeEnergyMeasured", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "attributes": [ + { + "name": "AvailableEndpoints", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveEndpoints", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 4, + "name": "MA-deviceenergymanagement", + "deviceTypeRef": { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + }, + "deviceTypes": [ + { + "code": 1293, + "profileId": 259, + "label": "Device Energy Management", + "name": "Device Energy Management" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 1293 + ], + "deviceTypeName": "Device Energy Management", + "deviceTypeCode": 1293, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "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": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Device Energy Management", + "code": 152, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "PowerAdjustRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPowerAdjustRequest", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartTimeAdjustRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "PauseRequest", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ResumeRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyForecastRequest", + "code": 5, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RequestConstraintBasedForecast", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "ESAType", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "ESATypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESACanGenerate", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ESAState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "ESAStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMinPower", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AbsMaxPower", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "power_mw", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PowerAdjustmentCapability", + "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": "Forecast", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "ForecastStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OptOutState", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "OptOutStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "PowerAdjustStart", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "PowerAdjustEnd", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Paused", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Resumed", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Device Energy Management Mode", + "code": 159, + "mfgCode": null, + "define": "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "apiMaturity": "provisional", + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "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": "StartUpMode", + "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": "OnMode", + "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": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "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 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-dishwasher", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-electricalsensor", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-deviceenergymanagement", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/dishwasher-app/silabs/include/AppConfig.h b/examples/dishwasher-app/silabs/include/AppConfig.h new file mode 100644 index 0000000000..c1633f454d --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppConfig.h @@ -0,0 +1,88 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "silabs_utils.h" + +// ---- Dishwasher Example App Config ---- + +#define APP_TASK_NAME "DishWasher" + +#define BLE_DEV_NAME "SL-Dishwasher" + +// Number of seconds between event and attribute updates for cumulative energy are emited +#define CUMULATIVE_REPORT_INTERVAL_SECONDS 60 + +// APP Logo, boolean only. must be 64x64 +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, \ + 0x00, 0xF0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1E, 0x1E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x1F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x0E, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFE, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x3F, 0xFC, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x1F, 0xFC, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x80, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ + 0x00, 0xF8, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define OFF_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, \ + 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x0F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0x07, 0xFE, 0x00, 0x00, 0x00, \ + 0x00, 0xF0, 0xFF, 0x07, 0xFC, 0x01, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x0F, 0xF8, 0x03, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, \ + 0xF0, 0x07, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x3F, 0xE0, 0x0F, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0x7F, 0xC0, 0x1F, 0x1F, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x80, 0x3F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0x7F, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x03, 0xFE, 0x0E, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xFC, 0x01, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xF8, 0x03, 0x00, \ + 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xF0, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0x0F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xC0, 0x1F, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0x07, 0x81, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x03, 0xFF, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x07, 0xFE, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x0F, 0xFC, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0x1F, 0xF8, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x3F, 0xF0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0x7F, 0xE0, 0xFF, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xC0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x81, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xFE, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF8, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x07, 0xF0, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x07, 0xE0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0xC0, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0x80, \ + 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xFF, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xFE, 0xE0, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x01, 0x00, 0xFC, 0xE1, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xF8, 0xE3, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, \ + 0xF0, 0xE7, 0xFF, 0xFF, 0x07, 0xFF, 0x01, 0x00, 0xE0, 0xEF, 0xFF, 0xFF, 0x07, 0xFF, 0x03, 0x40, 0xC0, 0xFF, 0xFF, 0xFF, \ + 0x07, 0xFF, 0x03, 0xE0, 0x80, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x0F, 0xF0, 0x01, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F, 0xF8, \ + 0x03, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, \ + 0x07, 0xFF, 0xFF, 0xFF, 0x1F, 0xF0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, \ + 0x7F, 0xC0, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, \ + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ + 0x00, 0x08, 0xF8, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x3E, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF diff --git a/examples/dishwasher-app/silabs/include/AppEvent.h b/examples/dishwasher-app/silabs/include/AppEvent.h new file mode 100644 index 0000000000..259034e1b5 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppEvent.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 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_Button = 0, + kEventType_Timer, + kEventType_Dishwasher, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } DishwasherEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/dishwasher-app/silabs/include/AppTask.h b/examples/dishwasher-app/silabs/include/AppTask.h new file mode 100644 index 0000000000..63cc97e849 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/AppTask.h @@ -0,0 +1,103 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/********************************************************** + * Includes + *********************************************************/ +#include +#include +#include +#include + +#include "BaseApplication.h" + +/********************************************************** + * Defines + *********************************************************/ + +// Application-defined error codes in the CHIP_ERROR space. +#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) +#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) +#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) +#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) +#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) +#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) + +/********************************************************** + * AppTask Declaration + *********************************************************/ +class AppTask : public BaseApplication +{ + +public: + AppTask() = default; + + static AppTask & GetAppTask() { return sAppTask; } + + /** + * @brief AppTask task main loop function + * + * @param pvParameter FreeRTOS task parameter + */ + static void AppTaskMain(void * pvParameter); + + CHIP_ERROR StartAppTask(); + + /** + * @brief Event handler when a button is pressed + * Function posts an event for button processing + * + * @param buttonHandle APP_CONTROL_BUTTON or APP_FUNCTION_BUTTON + * @param btnAction Button action - SL_SIMPLE_BUTTON_PRESSED, + * SL_SIMPLE_BUTTON_RELEASED or + * SL_SIMPLE_BUTTON_DISABLED + */ + static void ButtonEventHandler(uint8_t button, uint8_t btnAction); + +private: + static AppTask sAppTask; + /** + * @brief AppTask initialisation function + * + * @return CHIP_ERROR + */ + CHIP_ERROR Init(); + + /** + * @brief PB0 Button event processing function + * Press and hold will trigger a factory reset timer start + * Press and release will restart BLEAdvertising if not commisionned + * + * @param aEvent button event being processed + */ + static void ButtonHandler(AppEvent * aEvent); + + /** + * @brief PB1 Button event processing function + * Function triggers a switch action sent to the CHIP task + * + * @param aEvent button event being processed + */ + static void DishwasherActionEventHandler(AppEvent * aEvent); + + static void ActionInitiated(chip::app::Clusters::OperationalState::OperationalStateEnum action); + static void ActionCompleted(); +}; diff --git a/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h b/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h new file mode 100644 index 0000000000..57d85a4830 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/CHIPProjectConfig.h @@ -0,0 +1,102 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @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 + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// 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 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8005: example Dishwasher + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8005 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * CHIP_DEVICE_CONFIG_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_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * 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) + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) diff --git a/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h b/examples/dishwasher-app/silabs/include/DataModelHelper.h similarity index 63% rename from examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h rename to examples/dishwasher-app/silabs/include/DataModelHelper.h index cecc041dc2..df46629269 100644 --- a/examples/all-clusters-minimal-app/tizen/include/CHIPProjectAppConfig.h +++ b/examples/dishwasher-app/silabs/include/DataModelHelper.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2024 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,16 +16,12 @@ * 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 -// include the CHIPProjectConfig from config/standalone -#include +#include + +namespace DataModelHelper { + +chip::EndpointId GetEndpointIdFromCluster(chip::ClusterId clusterId); + +} // namespace DataModelHelper diff --git a/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h b/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h new file mode 100644 index 0000000000..9b9e1b548e --- /dev/null +++ b/examples/dishwasher-app/silabs/include/DeviceEnergyManager.h @@ -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. + */ + +#pragma once + +#include + +class DeviceEnergyManager +{ +public: + ~DeviceEnergyManager() { Shutdown(); } + + static DeviceEnergyManager & Instance(void) { return sDeviceEnergy; } + + chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate * GetDEMDelegate(); + + CHIP_ERROR Init(); + void Shutdown(); + +private: + static DeviceEnergyManager sDeviceEnergy; +}; diff --git a/examples/dishwasher-app/silabs/include/DishwasherManager.h b/examples/dishwasher-app/silabs/include/DishwasherManager.h new file mode 100644 index 0000000000..f832e6f0b5 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/DishwasherManager.h @@ -0,0 +1,99 @@ +/* + * + * 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 "AppEvent.h" +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace DeviceEnergyManagement { + +class DishwasherManager : public DEMManufacturerDelegate +{ + using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalStateEnum; + +public: + static constexpr int64_t kApproximateEnergyUsedByESA = 1800'000; // mW + + DishwasherManager(DeviceEnergyManagementManager * aDEMInstance) : mDEMInstance(aDEMInstance) {} + virtual ~DishwasherManager() {} + + CHIP_ERROR Init(); + void CycleOperationalState(); + void UpdateDishwasherLed(); + void UpdateOperationState(OperationalStateEnum state); + OperationalStateEnum GetOperationalState(); + + typedef void (*Callback_fn_initiated)(OperationalStateEnum action); + typedef void (*Callback_fn_completed)(); + void SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB); + + DeviceEnergyManagementDelegate * GetDEMDelegate() + { + if (mDEMInstance) + { + return mDEMInstance->GetDelegate(); + } + return nullptr; + } + + // The PowerAdjustEnd event needs to report the approximate energy used by the ESA during the session. + int64_t GetApproxEnergyDuringSession() override; + + CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, + AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion() override; + + CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, + AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion() override; + CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) override; + CHIP_ERROR HandleDeviceEnergyManagementCancelRequest() override; + CHIP_ERROR + HandleModifyForecastRequest(const uint32_t forecastID, + const DataModel::DecodableList & slotAdjustments, + AdjustmentCauseEnum cause) override; + CHIP_ERROR RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints, + AdjustmentCauseEnum cause) override; + +private: + OperationalStateEnum mState; + + Callback_fn_initiated mActionInitiated_CB; + Callback_fn_completed mActionCompleted_CB; + + // DEM Manufacturer Delegate + DeviceEnergyManagementManager * mDEMInstance; +}; + +DishwasherManager * GetDishwasherManager(); + +} // namespace DeviceEnergyManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h b/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h new file mode 100644 index 0000000000..dba13b3a51 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/ElectricalEnergyMeasurementInstance.h @@ -0,0 +1,75 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "AppConfig.h" +#include "AppEvent.h" +#include "ElectricalPowerMeasurementDelegate.h" +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ElectricalEnergyMeasurement { + +class ElectricalEnergyMeasurementInstance : public ElectricalEnergyMeasurementAttrAccess +{ +public: + static constexpr uint32_t kTimerPeriodms = 1000; // Timer period 1000 ms + static constexpr uint32_t kAttributeFrequency = + CUMULATIVE_REPORT_INTERVAL_SECONDS; // Number of seconds between reports for cumulative energy + + ElectricalEnergyMeasurementInstance(EndpointId aEndpointId, + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate & aEPMDelegate, + BitMask aFeature, BitMask aOptionalAttrs) : + ElectricalEnergyMeasurementAttrAccess::ElectricalEnergyMeasurementAttrAccess(aFeature, aOptionalAttrs), + mEndpointId(aEndpointId) + { + mEPMDelegate = &aEPMDelegate; + } + + // Delete copy constructor and assignment operator + ElectricalEnergyMeasurementInstance(const ElectricalEnergyMeasurementInstance &) = delete; + ElectricalEnergyMeasurementInstance(const ElectricalEnergyMeasurementInstance &&) = delete; + ElectricalEnergyMeasurementInstance & operator=(const ElectricalEnergyMeasurementInstance &) = delete; + + CHIP_ERROR Init(); + void Shutdown(); + + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * GetEPMDelegate() { return mEPMDelegate; } + + void StartTimer(uint32_t aTimeoutMs); + void CancelTimer(); + +private: + ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * mEPMDelegate; + EndpointId mEndpointId; + osTimerId_t mTimer; + + CHIP_ERROR InitTimer(); + + static void TimerEventHandler(void * timerCbArg); + static void UpdateEnergyAttributesAndNotify(AppEvent * aEvent); +}; + +} // namespace ElectricalEnergyMeasurement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h b/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h new file mode 100644 index 0000000000..3d1cfd234a --- /dev/null +++ b/examples/dishwasher-app/silabs/include/ElectricalSensorManager.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +class ElectricalSensorManager +{ + using OperationalStateEnum = chip::app::Clusters::OperationalState::OperationalStateEnum; + +public: + ~ElectricalSensorManager() { Shutdown(); } + + static ElectricalSensorManager & Instance(void) { return sElectricalSensor; } + + CHIP_ERROR Init(); + void Shutdown(); + + void UpdateEPMAttributes(OperationalStateEnum state); + +private: + static ElectricalSensorManager sElectricalSensor; +}; diff --git a/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h b/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h new file mode 100644 index 0000000000..c33729fc43 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/PowerTopologyDelegateImpl.h @@ -0,0 +1,50 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +class PowerTopologyDelegateImpl : public PowerTopologyDelegate +{ +public: + ~PowerTopologyDelegateImpl() = default; + + CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) override; + CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) override; + + CHIP_ERROR AddActiveEndpoint(EndpointId endpointId); + CHIP_ERROR RemoveActiveEndpoint(EndpointId endpointId); + + void InitAvailableEndpointList(); + +private: + EndpointId mAvailableEndpointIdList[MAX_ENDPOINT_COUNT]; + EndpointId mActiveEndpointIdList[MAX_ENDPOINT_COUNT]; +}; + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h b/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h new file mode 100644 index 0000000000..8b8d24e115 --- /dev/null +++ b/examples/dishwasher-app/silabs/include/operational-state-delegate-impl.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace OperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class OperationalStateDelegate : public Delegate +{ + +public: + /** + * Get the countdown time. This attribute is not used in this application. + * @return The current countdown time. + */ + DataModel::Nullable GetCountdownTime() override { return {}; } + + CHIP_ERROR GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) override; + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) override; + + void HandlePauseStateCallback(GenericOperationalError & err) override; + void HandleResumeStateCallback(GenericOperationalError & err) override; + void HandleStartStateCallback(GenericOperationalError & err) override; + void HandleStopStateCallback(GenericOperationalError & err) override; + + /** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ + + /** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ + void PostAttributeChangeCallback(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value); + + void SetEndpointId(EndpointId endpointId); + +private: + const GenericOperationalState rvcOpStateList[4] = { + GenericOperationalState(to_underlying(OperationalStateEnum::kStopped)), + GenericOperationalState(to_underlying(OperationalStateEnum::kRunning)), + GenericOperationalState(to_underlying(OperationalStateEnum::kPaused)), + GenericOperationalState(to_underlying(OperationalStateEnum::kError)), + }; + + EndpointId mEndpointId; + + DataModel::List mOperationalStateList = Span(rvcOpStateList); + const Span mOperationalPhaseList; +}; + +OperationalState::Instance * GetInstance(); +OperationalState::OperationalStateDelegate * GetDelegate(); +void Shutdown(); + +} // namespace OperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/dishwasher-app/silabs/openthread.gn b/examples/dishwasher-app/silabs/openthread.gn new file mode 100644 index 0000000000..b05216fc9d --- /dev/null +++ b/examples/dishwasher-app/silabs/openthread.gn @@ -0,0 +1,29 @@ +# 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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/dishwasher-app/silabs/openthread.gni b/examples/dishwasher-app/silabs/openthread.gni new file mode 100644 index 0000000000..6794214248 --- /dev/null +++ b/examples/dishwasher-app/silabs/openthread.gni @@ -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/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/silabs/efr32/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +app_data_model = + "${chip_root}/examples/dishwasher-app/silabs/data_model:silabs-dishwasher" +chip_enable_ota_requestor = true +chip_enable_openthread = true +sl_enable_test_event_trigger = true + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/dishwasher-app/silabs/src/AppTask.cpp b/examples/dishwasher-app/silabs/src/AppTask.cpp new file mode 100644 index 0000000000..948f1b590b --- /dev/null +++ b/examples/dishwasher-app/silabs/src/AppTask.cpp @@ -0,0 +1,237 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppEvent.h" +#include "AppTask.h" +#include "DeviceEnergyManager.h" +#include "DishwasherManager.h" +#include "ElectricalSensorManager.h" +#include "operational-state-delegate-impl.h" + +#include +#include + +#define APP_FUNCTION_BUTTON 0 +#define APP_CONTROL_BUTTON 1 + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::DeviceLayer; +using namespace chip::DeviceLayer::Silabs; +using namespace chip::TLV; + +AppTask AppTask::sAppTask; + +#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED +static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHandler; +static DeviceEnergyManagementTestEventTriggerHandler sDeviceEnergyManagementTestEventTriggerHandler; +#endif + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); + +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Dishwasher-App"); +#endif + + err = BaseApplication::Init(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("BaseApplication::Init() failed"); + appError(err); + } + + PlatformMgr().LockChipStack(); + err = DeviceEnergyManager::Instance().Init(); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("DeviceEnergyMgr.Init() failed"); + appError(err); + } + + PlatformMgr().LockChipStack(); + err = ElectricalSensorManager::Instance().Init(); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("ElectricalSensorMgr.Init() failed"); + appError(err); + } + +#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED + // Register DEM & Electrical Sensor Test Event Trigger + if (Server::GetInstance().GetTestEventTriggerDelegate() != nullptr) + { + Server::GetInstance().GetTestEventTriggerDelegate()->AddHandler(&sEnergyReportingTestEventTriggerHandler); + Server::GetInstance().GetTestEventTriggerDelegate()->AddHandler(&sDeviceEnergyManagementTestEventTriggerHandler); + } +#endif + + GetDishwasherManager()->SetCallbacks(ActionInitiated, ActionCompleted); + + // Set the initial state of the dishwasher + OperationalStateEnum state = static_cast(OperationalState::GetInstance()->GetCurrentOperationalState()); + GetDishwasherManager()->UpdateOperationState(state); + +// Update the LCD with the Stored value. Show QR Code if not provisioned +#ifdef DISPLAY_ENABLED + GetLCD().WriteDemoUI((GetDishwasherManager()->GetOperationalState() == OperationalStateEnum::kRunning)); +#ifdef QR_CODE_ENABLED +#ifdef SL_WIFI + if (!ConnectivityMgr().IsWiFiStationProvisioned()) +#else + if (!ConnectivityMgr().IsThreadProvisioned()) +#endif /* !SL_WIFI */ + { + GetLCD().ShowQRCode(true); + } +#endif // QR_CODE_ENABLED +#endif + + return err; +} + +CHIP_ERROR AppTask::StartAppTask() +{ + return BaseApplication::StartAppTask(AppTaskMain); +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + osMessageQueueId_t sAppEventQueue = *(static_cast(pvParameter)); + + CHIP_ERROR err = sAppTask.Init(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("AppTask.Init() failed"); + appError(err); + } + +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) + sAppTask.StartStatusLEDTimer(); +#endif + + SILABS_LOG("App Task started"); + + while (true) + { + osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + sAppTask.DispatchEvent(&event); + eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, 0); + } + } +} + +void AppTask::DishwasherActionEventHandler(AppEvent * aEvent) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if (aEvent->Type != AppEvent::kEventType_Button) + { + err = APP_ERROR_UNHANDLED_EVENT; + } + + if (CHIP_NO_ERROR == err) + { + GetDishwasherManager()->CycleOperationalState(); + } +} + +void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) +{ + AppEvent button_event = {}; + button_event.Type = AppEvent::kEventType_Button; + button_event.ButtonEvent.Action = btnAction; + + if ((button == APP_CONTROL_BUTTON) && (btnAction == static_cast(SilabsPlatform::ButtonAction::ButtonPressed))) + { + button_event.Handler = DishwasherActionEventHandler; + AppTask::GetAppTask().PostEvent(&button_event); + } + else if (button == APP_FUNCTION_BUTTON) + { + button_event.Handler = BaseApplication::ButtonHandler; + AppTask::GetAppTask().PostEvent(&button_event); + } +} + +void AppTask::ActionInitiated(OperationalStateEnum action) +{ + // Action initiated, update the dishwasher state led + if (action == OperationalStateEnum::kRunning) + { + SILABS_LOG("Starting dishwasher"); + } + else if (action == OperationalStateEnum::kStopped) + { + SILABS_LOG("Stoping dishwasher"); + } + else if (action == OperationalStateEnum::kPaused) + { + SILABS_LOG("Pausing dishwasher"); + } + else + { + SILABS_LOG("Action error"); + action = OperationalStateEnum::kError; + } + + PlatformMgr().LockChipStack(); + CHIP_ERROR err = Clusters::OperationalState::GetInstance()->SetOperationalState(to_underlying(action)); + PlatformMgr().UnlockChipStack(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("ERR: updating Operational state %x", err); + } + else + { + GetDishwasherManager()->UpdateOperationState(action); + ElectricalSensorManager::Instance().UpdateEPMAttributes(action); + } +} + +void AppTask::ActionCompleted() +{ +#ifdef DISPLAY_ENABLED + sAppTask.GetLCD().WriteDemoUI((GetDishwasherManager()->GetOperationalState() == OperationalStateEnum::kRunning)); +#endif +} diff --git a/examples/dishwasher-app/silabs/src/DataModelHelper.cpp b/examples/dishwasher-app/silabs/src/DataModelHelper.cpp new file mode 100644 index 0000000000..477699f17f --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DataModelHelper.cpp @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "DataModelHelper.h" + +using namespace chip; + +EndpointId DataModelHelper::GetEndpointIdFromCluster(ClusterId clusterId) +{ + for (uint16_t index = 0; index < emberAfEndpointCount(); index++) + { + if (emberAfEndpointIndexIsEnabled(index)) + { + EndpointId endpointId = emberAfEndpointFromIndex(index); + + if (emberAfContainsServer(endpointId, clusterId)) + { + return endpointId; + } + } + } + + return kInvalidEndpointId; +} diff --git a/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp b/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp new file mode 100644 index 0000000000..db7bdf853a --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DeviceEnergyManager.cpp @@ -0,0 +1,167 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppConfig.h" +#include "AppTask.h" + +#include "DataModelHelper.h" +#include "DeviceEnergyManagementDelegateImpl.h" +#include "DeviceEnergyManager.h" +#include "DishwasherManager.h" +#include "EnergyTimeUtils.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +DeviceEnergyManager DeviceEnergyManager::sDeviceEnergy; + +namespace { +std::unique_ptr gDEMDelegate; +std::unique_ptr gDEMInstance; +std::unique_ptr gDishwasherManager; +} // namespace + +DeviceEnergyManagement::DeviceEnergyManagementDelegate * GetDEMDelegate() +{ + VerifyOrDieWithMsg(gDEMDelegate.get() != nullptr, AppServer, "DEM Delegate is null"); + return gDEMDelegate.get(); +} + +DishwasherManager * DeviceEnergyManagement::GetDishwasherManager() +{ + VerifyOrDieWithMsg(gDEMDelegate.get() != nullptr, AppServer, "Dishwasher Manager is null"); + return gDishwasherManager.get(); +} + +/* + * @brief Creates a Delegate and Instance for DEM + * + * The Instance is a container around the Delegate, so + * create the Delegate first, then wrap it in the Instance + * Then call the Instance->Init() to register the attribute and command handlers + */ +CHIP_ERROR DeviceEnergyManagementInit() +{ + EndpointId DEMEndpointId = DataModelHelper::GetEndpointIdFromCluster(DeviceEnergyManagement::Id); + CHIP_ERROR err; + + VerifyOrReturnError((DEMEndpointId != kInvalidEndpointId), CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "DEM Cluster not configured")); + + // Initialize DEM (Device Energy Management) and DEMManufacturer (Device Energy Management Manufacturer) + VerifyOrReturnError(!gDEMDelegate && !gDEMInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "DEM Delegate or Instance already exist")); + + gDEMDelegate = std::make_unique(); + VerifyOrReturnError(gDEMDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for DEM Delegate")); + + // Manufacturer may optionally not support all features, commands & attributes + // DeviceEnergyManagement::Feature::kStateForecastReporting is removed from the specification [!PA].a,(STA|PAU|FA|CON),O + static uint32_t featureMap = static_cast(DeviceEnergyManagement::Feature::kPowerForecastReporting) + + static_cast(DeviceEnergyManagement::Feature::kStartTimeAdjustment) + + static_cast(DeviceEnergyManagement::Feature::kPausable); + BitMask fmap(featureMap); + + gDEMInstance = std::make_unique(DEMEndpointId, *gDEMDelegate, fmap); + + VerifyOrReturnError(gDEMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for DEM Instance"); + gDEMDelegate.reset()); + + gDEMDelegate->SetDeviceEnergyManagementInstance(*gDEMInstance); + + // Register Attribute & Command handlers + err = gDEMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gDEMInstance"); gDEMInstance.reset(); + gDEMDelegate.reset()); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManagementShutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + if (gDEMInstance) + { + /* deregister attribute & command handlers */ + gDEMInstance->Shutdown(); + gDEMInstance.reset(); + } + if (gDEMDelegate) + { + gDEMDelegate.reset(); + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR DeviceEnergyManager::Init() +{ + CHIP_ERROR err; + + err = DeviceEnergyManagementInit(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "DEM Init failed"); DeviceEnergyManagementShutdown();); + + // DEM Manufacturer + VerifyOrReturnError(!gDishwasherManager, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "Dishwasher manager already initialized");); + + gDishwasherManager = std::make_unique(gDEMInstance.get()); + VerifyOrReturnError(gDishwasherManager, CHIP_ERROR_NO_MEMORY, + ChipLogError(AppServer, "Failed to allocate memory for DEM ManufacturerDelegate")); + + err = gDishwasherManager->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gDishwasherManager")); + + gDEMDelegate->SetDEMManufacturerDelegate(*gDishwasherManager.get()); + + return CHIP_NO_ERROR; +} + +void DeviceEnergyManager::Shutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + + // Shutdown DEM + if (gDEMInstance) + { + // Deregister attribute & command handlers + gDEMInstance->Shutdown(); + gDEMInstance.reset(); + } + + if (gDEMDelegate) + { + gDEMDelegate.reset(); + } + + // Shutdown DEMManufacturer + if (gDishwasherManager) + { + gDishwasherManager.reset(); + } +} + +DeviceEnergyManagementDelegate * DeviceEnergyManager::GetDEMDelegate() +{ + return gDEMDelegate.get(); +}; diff --git a/examples/dishwasher-app/silabs/src/DishwasherManager.cpp b/examples/dishwasher-app/silabs/src/DishwasherManager.cpp new file mode 100644 index 0000000000..01f30e70f5 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/DishwasherManager.cpp @@ -0,0 +1,209 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "LEDWidget.h" + +#include "AppConfig.h" +#include "AppTask.h" +#include "DishwasherManager.h" +#include "operational-state-delegate-impl.h" + +#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT +#define DW_STATE_LED 1 +#else +#define DW_STATE_LED 0 +#endif + +namespace { +LEDWidget sDishwasherLED; +} + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::DeviceLayer; + +CHIP_ERROR DishwasherManager::Init() +{ + sDishwasherLED.Init(DW_STATE_LED); + AppTask::GetAppTask().LinkAppLed(&sDishwasherLED); + + chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate * dem = GetDEMDelegate(); + VerifyOrReturnLogError(dem != nullptr, CHIP_ERROR_UNINITIALIZED); + + /* For Device Energy Management we need the ESA to be Online and ready to accept commands */ + dem->SetESAState(ESAStateEnum::kOnline); + dem->SetESAType(ESATypeEnum::kDishwasher); + + // Set the abs min and max power + dem->SetAbsMinPower(1200000); // 1.2KW + dem->SetAbsMaxPower(7600000); // 7.6KW + + return CHIP_NO_ERROR; +} + +OperationalStateEnum DishwasherManager::GetOperationalState() +{ + return mState; +} + +void DishwasherManager::UpdateDishwasherLed() +{ + OperationalStateEnum opState = GetOperationalState(); + sDishwasherLED.Set(false); + + switch (opState) + { + case OperationalStateEnum::kRunning: + sDishwasherLED.Set(true); + break; + case OperationalStateEnum::kPaused: + sDishwasherLED.Blink(300, 700); + break; + case OperationalStateEnum::kError: + sDishwasherLED.Blink(100); + break; + default: + break; + } +} + +void DishwasherManager::SetCallbacks(Callback_fn_initiated aActionInitiated_CB, Callback_fn_completed aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +void DishwasherManager::CycleOperationalState() +{ + if (mActionInitiated_CB) + { + OperationalStateEnum action; + switch (mState) + { + case OperationalStateEnum::kRunning: + action = OperationalStateEnum::kPaused; + break; + case OperationalStateEnum::kPaused: + action = OperationalStateEnum::kStopped; + break; + case OperationalStateEnum::kStopped: + action = OperationalStateEnum::kRunning; + break; + case OperationalStateEnum::kError: + action = OperationalStateEnum::kStopped; + break; + default: + break; + } + mActionInitiated_CB(action); + } +} + +void DishwasherManager::UpdateOperationState(OperationalStateEnum state) +{ + mState = state; + UpdateDishwasherLed(); + + if (mActionCompleted_CB) + { + mActionCompleted_CB(); + } +} + +int64_t DishwasherManager::GetApproxEnergyDuringSession() +{ + return kApproximateEnergyUsedByESA; +}; + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPowerAdjustCompletion() +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +// kNoOptOut = 0x00, +// kLocalOptOut = 0x01, +// kGridOptOut = 0x02, +// kOptOut = 0x03, +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, + AdjustmentCauseEnum cause) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = nullptr; + AppTask::GetAppTask().PostEvent(&event); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) +{ + mActionInitiated_CB(OperationalStateEnum::kPaused); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementPauseCompletion() +{ + mActionInitiated_CB(OperationalStateEnum::kRunning); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) +{ + mActionInitiated_CB(OperationalStateEnum::kRunning); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleDeviceEnergyManagementCancelRequest() +{ + mActionInitiated_CB(OperationalStateEnum::kStopped); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherManager::HandleModifyForecastRequest( + const uint32_t forecastId, const DataModel::DecodableList & slotAdjustments, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DishwasherManager::RequestConstraintBasedForecast( + const DataModel::DecodableList & constraints, + AdjustmentCauseEnum cause) +{ + // Currently not implemented by our dishwasher app + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} diff --git a/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp b/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp new file mode 100644 index 0000000000..2d48dd821d --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ElectricalEnergyMeasurementInstance.cpp @@ -0,0 +1,193 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppTask.h" +#include "ElectricalEnergyMeasurementInstance.h" +#include "EnergyTimeUtils.h" + +#define mWms_TO_mWh(power) ((power) / 3600'000) + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Attributes; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; +using namespace chip::app::DataModel; + +// Example of setting CumulativeEnergyReset structure - for now set these to 0 +// but the manufacturer may want to store these in non volatile storage for timestamp (based on epoch_s) +// Create an accuracy entry which is between +/-0.5 and +/- 5% across the range of all possible energy readings +static const MeasurementAccuracyRangeStruct::Type kEnergyAccuracyRanges[] = { + { .rangeMin = 0, + .rangeMax = 1'000'000'000'000'000, // 1 million Mwh + .percentMax = MakeOptional(static_cast(500)), + .percentMin = MakeOptional(static_cast(50)) } +}; + +static const MeasurementAccuracyStruct::Type kAccuracy = { + .measurementType = MeasurementTypeEnum::kElectricalEnergy, + .measured = false, // this should be made true in an implementation where a real metering device is used. + .minMeasuredValue = 0, + .maxMeasuredValue = 1'000'000'000'000'000, // 1 million Mwh + .accuracyRanges = List(kEnergyAccuracyRanges) +}; + +static const CumulativeEnergyResetStruct::Type kResetStruct = { + .importedResetTimestamp = MakeOptional(MakeNullable(static_cast(0))), + .exportedResetTimestamp = MakeOptional(MakeNullable(static_cast(0))), + .importedResetSystime = MakeOptional(MakeNullable(static_cast(0))), + .exportedResetSystime = MakeOptional(MakeNullable(static_cast(0))), +}; + +static EnergyMeasurementStruct::Type sCumulativeImported = { + .energy = static_cast(0), +}; + +static const EnergyMeasurementStruct::Type sCumulativeExported = { + .energy = static_cast(0), +}; + +namespace { +ElectricalPowerMeasurement::ElectricalPowerMeasurementDelegate * gEPMDelegate; +EndpointId gEndpointId; +int64_t sCumulativeActivePower = 0; +uint8_t sSecondsSinceUpdate = 0; +} // namespace + +CHIP_ERROR ElectricalEnergyMeasurementInstance::Init() +{ + // Initialize attributes + SetMeasurementAccuracy(mEndpointId, kAccuracy); + SetCumulativeReset(mEndpointId, MakeOptional(kResetStruct)); + + // Assign class attributes to instantiated global variables + // for the access to TimerEventHandler + gEPMDelegate = GetEPMDelegate(); + gEndpointId = mEndpointId; + + CHIP_ERROR err; + + uint32_t currentTimestamp; + ReturnErrorOnFailure(GetEpochTS(currentTimestamp)); + + sCumulativeImported.startTimestamp.SetValue(currentTimestamp); + sCumulativeImported.startSystime.SetValue(System::SystemClock().GetMonotonicTimestamp().count()); + + // Initialize and start timer to calculate cumulative energy + err = InitTimer(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on EEM Timer")); + + StartTimer(kTimerPeriodms); + + return ElectricalEnergyMeasurementAttrAccess::Init(); +} + +void ElectricalEnergyMeasurementInstance::Shutdown() +{ + CancelTimer(); + ElectricalEnergyMeasurementAttrAccess::Shutdown(); +} + +CHIP_ERROR ElectricalEnergyMeasurementInstance::InitTimer() +{ + // Create cmsis os sw timer for EEM Cumulative timer + mTimer = osTimerNew(TimerEventHandler, // Timer callback handler + osTimerPeriodic, // Timer reload + (void *) this, // Pass the app task obj context + NULL // No osTimerAttr_t to provide. + ); + + VerifyOrReturnError(mTimer != NULL, APP_ERROR_CREATE_TIMER_FAILED, SILABS_LOG("Timer create failed")); + + return CHIP_NO_ERROR; +} + +void ElectricalEnergyMeasurementInstance::StartTimer(uint32_t aTimeoutMs) +{ + // Start or restart the function timer + if (osTimerStart(mTimer, pdMS_TO_TICKS(aTimeoutMs)) != osOK) + { + SILABS_LOG("Timer start failed"); + appError(APP_ERROR_START_TIMER_FAILED); + } +} + +void ElectricalEnergyMeasurementInstance::CancelTimer() +{ + if (osTimerStop(mTimer) == osError) + { + SILABS_LOG("Timer stop failed"); + appError(APP_ERROR_STOP_TIMER_FAILED); + } +} + +void ElectricalEnergyMeasurementInstance::TimerEventHandler(void * timerCbArg) +{ + // Get different EPM Active Power values according to operational mode change + Nullable EPMActivePower = gEPMDelegate ? gEPMDelegate->GetActivePower() : Nullable(0); + int64_t activePower = (EPMActivePower.IsNull()) ? 0 : EPMActivePower.Value(); + + // Calculate cumulative imported active power + sCumulativeActivePower += activePower; + sSecondsSinceUpdate += 1; + + if (sSecondsSinceUpdate >= ElectricalEnergyMeasurementInstance::kAttributeFrequency) + { + sSecondsSinceUpdate = 0; + + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateEnergyAttributesAndNotify; + AppTask::GetAppTask().PostEvent(&event); + } +} + +void ElectricalEnergyMeasurementInstance::UpdateEnergyAttributesAndNotify(AppEvent * aEvent) +{ + // cumulativeImported update code - To update energy (mWs to mWh), startSystime and endSystime + // Convert the unit : mW * ms -> mWh + sCumulativeImported.energy = mWms_TO_mWh(sCumulativeActivePower * kTimerPeriodms); + + uint32_t currentTimestamp; + if (GetEpochTS(currentTimestamp) == CHIP_NO_ERROR) + { + // Use EpochTS + sCumulativeImported.endTimestamp.SetValue(currentTimestamp); + } + + sCumulativeImported.endSystime.SetValue(System::SystemClock().GetMonotonicTimestamp().count()); + + // Call the SDK to update attributes and generate an event + chip::DeviceLayer::PlatformMgr().LockChipStack(); + NotifyCumulativeEnergyMeasured(gEndpointId, MakeOptional(sCumulativeImported), MakeOptional(sCumulativeExported)); + MatterReportingAttributeChangeCallback(gEndpointId, ElectricalEnergyMeasurement::Id, CumulativeEnergyImported::Id); + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); +} diff --git a/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp new file mode 100644 index 0000000000..c751c71c26 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ElectricalSensorManager.cpp @@ -0,0 +1,215 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include "AppConfig.h" +#include "AppTask.h" +#include "DataModelHelper.h" +#include "DishwasherManager.h" +#include "ElectricalEnergyMeasurementInstance.h" +#include "ElectricalSensorManager.h" +#include "EnergyTimeUtils.h" +#include "PowerTopologyDelegate.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement; +using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; +using namespace chip::app::Clusters::ElectricalPowerMeasurement; +using namespace chip::app::Clusters::DeviceEnergyManagement; +using namespace chip::app::Clusters::OperationalState; +using namespace chip::app::Clusters::PowerTopology; +using namespace chip::app::DataModel; + +ElectricalSensorManager ElectricalSensorManager::sElectricalSensor; + +static std::unique_ptr gEEMInstance; +static std::unique_ptr gEPMDelegate; +static std::unique_ptr gEPMInstance; +static std::unique_ptr gPTDelegate; +static std::unique_ptr gPTInstance; + +static const struct +{ + PowerModeEnum PowerMode; + int64_t Voltage; // mV + int64_t ActiveCurrent; // mA + int64_t ActivePower; // mW + int64_t Frequency; // Hz +} kAttributes[4] = { + { PowerModeEnum::kAc, 120'000, 0, 0, 60 }, // kStopped + { PowerModeEnum::kAc, 120'000, 15'000, 1800'000, 60 }, // kRunning + { PowerModeEnum::kAc, 120'000, 125, 17'000, 60 }, // kPaused + { PowerModeEnum::kUnknown, 0, 0, 0, 0 } // kError +}; + +/* + * @brief Creates a Delegate and Instance for Electrical Power/Energy Measurement and Power Topology clusters + * + * The Instance is a container around the Delegate, so + * create the Delegate first, then wrap it in the Instance + * Then call the Instance->Init() to register the attribute and command handlers + */ +CHIP_ERROR ElectricalSensorManager::Init() +{ + EndpointId EPMEndpointId = DataModelHelper::GetEndpointIdFromCluster(ElectricalPowerMeasurement::Id); + EndpointId EEMEndpointId = DataModelHelper::GetEndpointIdFromCluster(ElectricalEnergyMeasurement::Id); + EndpointId PTEndpointId = DataModelHelper::GetEndpointIdFromCluster(PowerTopology::Id); + CHIP_ERROR err; + + VerifyOrReturnError((EPMEndpointId != kInvalidEndpointId) && (EEMEndpointId != kInvalidEndpointId) && + (PTEndpointId != kInvalidEndpointId), + CHIP_ERROR_INCORRECT_STATE, ChipLogError(AppServer, "EPM, EEM or PT Cluster not configured")); + + // Initialize EPM (Electrical Power Management) + VerifyOrReturnError(!gEPMDelegate && !gEPMInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "EPM Delegate or Instance already exist")); + + gEPMDelegate = std::make_unique(); + VerifyOrReturnError(gEPMDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EPM Delegate")); + + /* Manufacturer may optionally not support all features, commands & attributes */ + /* Turning on all optional features and attributes for test certification purposes */ + gEPMInstance = std::make_unique( + EPMEndpointId, *gEPMDelegate, + BitMask(ElectricalPowerMeasurement::Feature::kDirectCurrent, + ElectricalPowerMeasurement::Feature::kAlternatingCurrent), + BitMask( + ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeVoltage, + ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeActiveCurrent)); + + VerifyOrReturnError(gEPMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EPM Instance"); + gEPMDelegate.reset()); + + // Register Attribute & Command handlers + err = gEPMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gEPMInstance"); gEPMInstance.reset(); + gEPMDelegate.reset()); + + // Initialize EPM attributes + OperationalStateEnum state = GetDishwasherManager()->GetOperationalState(); + UpdateEPMAttributes(state); + + // Initialize EEM (Electrical Energy Management) + VerifyOrReturnError(!gEEMInstance, CHIP_ERROR_INCORRECT_STATE, ChipLogError(AppServer, "EEM Instance already exist")); + + gEEMInstance = std::make_unique( + EEMEndpointId, *gEPMDelegate, + BitMask(ElectricalEnergyMeasurement::Feature::kImportedEnergy, + ElectricalEnergyMeasurement::Feature::kCumulativeEnergy), + BitMask( + ElectricalEnergyMeasurement::OptionalAttributes::kOptionalAttributeCumulativeEnergyReset)); + + VerifyOrReturnError(gEEMInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for EEM Instance")); + + // Register Attribute & Command handlers + err = gEEMInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gEEMInstance"); gPTInstance.reset()); + + // Initialize PT (Power Topology) + VerifyOrReturnError(!gPTDelegate && !gPTInstance, CHIP_ERROR_INCORRECT_STATE, + ChipLogError(AppServer, "PowerTopology Delegate or Instance already exist")); + + gPTDelegate = std::make_unique(); + VerifyOrReturnError(gPTDelegate, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for PT Delegate")); + + gPTInstance = std::make_unique( + PTEndpointId, *gPTDelegate, BitMask(PowerTopology::Feature::kNodeTopology), + BitMask()); + + VerifyOrReturnError(gPTInstance, CHIP_ERROR_NO_MEMORY, ChipLogError(AppServer, "Failed to allocate memory for PT Instance"); + gPTDelegate.reset()); + + // Register Attribute & Command handlers + err = gPTInstance->Init(); + VerifyOrReturnError(CHIP_NO_ERROR == err, err, ChipLogError(AppServer, "Init failed on gPTInstance"); gPTInstance.reset(); + gPTDelegate.reset();); + + return CHIP_NO_ERROR; +} + +void ElectricalSensorManager::Shutdown() +{ + /* Do this in the order Instance first, then delegate + * Ensure we call the Instance->Shutdown to free attribute & command handlers first + */ + + // Shutdown PT (Power Topology) + if (gPTInstance) + { + // Deregister attribute & command handlers + gPTInstance->Shutdown(); + gPTInstance.reset(); + } + + if (gPTDelegate) + { + gPTDelegate.reset(); + } + + // Shutdown EEM (Electrical Energy Management) + if (gEEMInstance) + { + // Deregister attribute & command handlers + gEEMInstance->Shutdown(); + gEEMInstance.reset(); + } + + // Shutdown EPM (Electrical Power Management) + if (gEPMInstance) + { + // Deregister attribute & command handlers + gEPMInstance->Shutdown(); + gEPMInstance.reset(); + } + + if (gEPMDelegate) + { + gEPMDelegate.reset(); + } +} + +void ElectricalSensorManager::UpdateEPMAttributes(OperationalStateEnum state) +{ + if (gEPMDelegate) + { + uint16_t updateState = to_underlying(state); + uint16_t ERROR_STATE_INDEX = ArraySize(kAttributes) - 1; + // Check state range + if ((updateState < 0) || (updateState > ERROR_STATE_INDEX)) + { + updateState = ERROR_STATE_INDEX; + } + + ChipLogDetail(AppServer, "UpdateAllAttributes to Operational State : %d", updateState); + + // Added to support testing using a static array for now + gEPMDelegate->SetPowerMode(kAttributes[updateState].PowerMode); + gEPMDelegate->SetVoltage(MakeNullable(kAttributes[updateState].Voltage)); + gEPMDelegate->SetActiveCurrent(MakeNullable(kAttributes[updateState].ActiveCurrent)); + gEPMDelegate->SetActivePower(MakeNullable(kAttributes[updateState].ActivePower)); + } +} diff --git a/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp b/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp new file mode 100644 index 0000000000..7e3a68a707 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/PowerTopologyDelegateImpl.cpp @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "PowerTopologyDelegateImpl.h" + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerTopology; + +CHIP_ERROR PowerTopologyDelegateImpl::GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + VerifyOrReturnError(index < ArraySize(mAvailableEndpointIdList), CHIP_ERROR_PROVIDER_LIST_EXHAUSTED); + + endpointId = mAvailableEndpointIdList[index]; + + return (endpointId == kInvalidEndpointId) ? CHIP_ERROR_INVALID_ARGUMENT : CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + VerifyOrReturnError(index < ArraySize(mActiveEndpointIdList), CHIP_ERROR_PROVIDER_LIST_EXHAUSTED); + + endpointId = mActiveEndpointIdList[index]; + + return (endpointId == kInvalidEndpointId) ? CHIP_ERROR_INVALID_ARGUMENT : CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::AddActiveEndpoint(EndpointId endpointId) +{ + bool AvailableEndpointFlag = false; + bool ActiveEndpointFlag = false; + uint16_t availableIndexToAdd = MAX_ENDPOINT_COUNT; + + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + if (mAvailableEndpointIdList[index] == endpointId) + { + AvailableEndpointFlag = true; + } + if (mActiveEndpointIdList[index] == endpointId) + { + ActiveEndpointFlag = true; + } + if (mActiveEndpointIdList[index] == kInvalidEndpointId) + { + availableIndexToAdd = index; + } + } + + // Availability and duplication check + VerifyOrReturnError(AvailableEndpointFlag && !ActiveEndpointFlag && (availableIndexToAdd != MAX_ENDPOINT_COUNT), + CHIP_ERROR_INVALID_ARGUMENT); + + mActiveEndpointIdList[availableIndexToAdd] = endpointId; + + return CHIP_NO_ERROR; +} + +CHIP_ERROR PowerTopologyDelegateImpl::RemoveActiveEndpoint(EndpointId endpointId) +{ + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + if (mActiveEndpointIdList[index] == endpointId) + { + mActiveEndpointIdList[index] = kInvalidEndpointId; + return CHIP_NO_ERROR; + } + } + + return CHIP_ERROR_INVALID_ARGUMENT; +} + +void PowerTopologyDelegateImpl::InitAvailableEndpointList() +{ + for (uint16_t index = 0; index < MAX_ENDPOINT_COUNT; index++) + { + mAvailableEndpointIdList[index] = + (emberAfEndpointIndexIsEnabled(index)) ? emberAfEndpointFromIndex(index) : kInvalidEndpointId; + + mActiveEndpointIdList[index] = kInvalidEndpointId; + } +} diff --git a/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp b/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp new file mode 100644 index 0000000000..cc972c6454 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/ZclCallbacks.cpp @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2024 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 handler for data model messages. + */ +#include +#include +#include +#include + +#include "AppConfig.h" +#include "DishwasherManager.h" +#include "ElectricalSensorManager.h" + +#ifdef DIC_ENABLE +#include "dic.h" +#endif // DIC_ENABLE + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::DeviceEnergyManagement; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + if ((clusterId == OperationalState::Id) && (attributeId == OperationalState::Attributes::OperationalState::Id)) + { + GetDishwasherManager()->UpdateOperationState(static_cast(*value)); + ElectricalSensorManager::Instance().UpdateEPMAttributes(static_cast(*value)); + } + else if (clusterId == Identify::Id) + { + ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributeId), type, *value, size); + } +} diff --git a/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp b/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp new file mode 100644 index 0000000000..df4e9e7ae8 --- /dev/null +++ b/examples/dishwasher-app/silabs/src/operational-state-delegate-impl.cpp @@ -0,0 +1,217 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include + +#include "DataModelHelper.h" +#include "EnergyTimeUtils.h" +#include "operational-state-delegate-impl.h" + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::OperationalState; + +static std::unique_ptr gOperationalStateDelegate; +static std::unique_ptr gOperationalStateInstance; + +/** + * Get the list of supported operational states. + * Fills in the provided GenericOperationalState with the state at `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ +CHIP_ERROR OperationalStateDelegate::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState) +{ + VerifyOrReturnError(index < mOperationalStateList.size(), CHIP_ERROR_NOT_FOUND); + + operationalState = mOperationalStateList[index]; + + return CHIP_NO_ERROR; +} + +/** + * Get the list of supported operational phases. + * Fills in the provided MutableCharSpan 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. + * + * If CHIP_ERROR_NOT_FOUND is returned for index 0, that indicates that the PhaseList attribute is null + * (there are no phases defined at all). + * + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The MutableCharSpan is filled. + */ +CHIP_ERROR OperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase) +{ + VerifyOrReturnError(index < mOperationalPhaseList.size(), CHIP_ERROR_NOT_FOUND); + + return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase); +} + +/** + * Handle Command Callback in application: Pause + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandlePauseStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kPaused); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Resume + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandleResumeStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kRunning); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Start + * @param[out] get Operational error after callback + */ +void OperationalStateDelegate::HandleStartStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kRunning); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * Handle Command Callback in application: Stop + * @param[out] get Operational error after callback. + */ +void OperationalStateDelegate::HandleStopStateCallback(GenericOperationalError & err) +{ + auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + + VerifyOrReturn(error == CHIP_NO_ERROR, err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation))); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(ErrorStateEnum::kNoError)); + uint8_t value = to_underlying(OperationalStateEnum::kStopped); + PostAttributeChangeCallback(Attributes::OperationalState::Id, ZCL_INT8U_ATTRIBUTE_TYPE, sizeof(uint8_t), &value); + } + else + { + err.Set(to_underlying(ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +/** + * @brief Calls the MatterPostAttributeChangeCallback for the modified attribute on the operationalState instance + * + * @param attributeId Id of the attribute that changed + * @param type Type of the attribute + * @param size Size of the attribute data + * @param value Value of the attribute data + */ +void OperationalStateDelegate::PostAttributeChangeCallback(AttributeId attributeId, uint8_t type, uint16_t size, uint8_t * value) +{ + ConcreteAttributePath info; + info.mClusterId = OperationalState::Id; + info.mAttributeId = attributeId; + info.mEndpointId = mEndpointId; + MatterPostAttributeChangeCallback(info, type, size, value); +} + +void OperationalStateDelegate::SetEndpointId(EndpointId endpointId) +{ + mEndpointId = endpointId; +} + +OperationalState::Instance * OperationalState::GetInstance() +{ + return gOperationalStateInstance.get(); +} + +OperationalState::OperationalStateDelegate * OperationalState::GetDelegate() +{ + return gOperationalStateDelegate.get(); +} + +void emberAfOperationalStateClusterInitCallback(EndpointId endpointId) +{ + CHIP_ERROR err; + + EndpointId OperationalStateEndpointId = DataModelHelper::GetEndpointIdFromCluster(OperationalState::Id); + VerifyOrDie((OperationalStateEndpointId != kInvalidEndpointId) && (OperationalStateEndpointId == endpointId)); + + VerifyOrDie(!gOperationalStateDelegate && !gOperationalStateInstance); + + gOperationalStateDelegate = std::make_unique(); + VerifyOrDie(gOperationalStateDelegate); + + gOperationalStateInstance = + std::make_unique(gOperationalStateDelegate.get(), OperationalStateEndpointId); + VerifyOrDie(gOperationalStateInstance); + + err = gOperationalStateInstance->Init(); + VerifyOrDie(CHIP_NO_ERROR == err); + + gOperationalStateInstance->SetOperationalState(to_underlying(OperationalStateEnum::kStopped)); + + gOperationalStateDelegate->SetEndpointId(OperationalStateEndpointId); +} + +void OperationalState::Shutdown() +{ + if (gOperationalStateInstance) + { + gOperationalStateInstance.reset(); + } + + if (gOperationalStateDelegate) + { + gOperationalStateDelegate.reset(); + } +} diff --git a/examples/dishwasher-app/silabs/third_party/connectedhomeip b/examples/dishwasher-app/silabs/third_party/connectedhomeip new file mode 120000 index 0000000000..c866b86874 --- /dev/null +++ b/examples/dishwasher-app/silabs/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/energy-management-app/energy-management-common/energy-evse/include/EnergyTimeUtils.h b/examples/energy-management-app/energy-management-common/common/include/EnergyTimeUtils.h similarity index 100% rename from examples/energy-management-app/energy-management-common/energy-evse/include/EnergyTimeUtils.h rename to examples/energy-management-app/energy-management-common/common/include/EnergyTimeUtils.h diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h b/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h index 65d214d319..f70b9bf33c 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h +++ b/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h @@ -80,6 +80,45 @@ class DEMManufacturerDelegate { return CHIP_NO_ERROR; } + + /** + * @brief Allows a client application to send in power readings into the system + * + * @param[in] aEndpointId - Endpoint to send to EPM Cluster + * @param[in] aActivePower_mW - ActivePower measured in milli-watts + * @param[in] aVoltage_mV - Voltage measured in milli-volts + * @param[in] aActiveCurrent_mA - ActiveCurrent measured in milli-amps + */ + virtual CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA) + { + return CHIP_NO_ERROR; + } + /** + * @brief Allows a client application to send cumulative energy readings into the system + * + * This is a helper function to add timestamps to the readings + * + * @param[in] aCumulativeEnergyImported -total energy imported in milli-watthours + * @param[in] aCumulativeEnergyExported -total energy exported in milli-watthours + */ + virtual CHIP_ERROR SendCumulativeEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, + int64_t aCumulativeEnergyExported) + { + return CHIP_NO_ERROR; + } + /** + * @brief Allows a client application to send periodic energy readings into the system + * + * This is a helper function to add timestamps to the readings + * + * @param[in] aPeriodicEnergyImported - energy imported in milli-watthours in last period + * @param[in] aPeriodicEnergyExported - energy exported in milli-watthours in last period + */ + virtual CHIP_ERROR SendPeriodicEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, + int64_t aCumulativeEnergyExported) + { + return CHIP_NO_ERROR; + } }; } // namespace DeviceEnergyManagement diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h index da563910f7..568c4b753d 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h +++ b/examples/energy-management-app/energy-management-common/device-energy-management/include/DeviceEnergyManagementDelegateImpl.h @@ -39,6 +39,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate void SetDEMManufacturerDelegate(DEMManufacturerDelegate & deviceEnergyManagementManufacturerDelegate); + chip::app::Clusters::DeviceEnergyManagement::DEMManufacturerDelegate * GetDEMManufacturerDelegate(); /** * * Implement the DeviceEnergyManagement::Delegate interface diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp index ff545ecf38..58258b73cd 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp index 157b85d477..3adefb0953 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp @@ -62,6 +62,11 @@ void DeviceEnergyManagementDelegate::SetDEMManufacturerDelegate( mpDEMManufacturerDelegate = &deviceEnergyManagementManufacturerDelegate; } +chip::app::Clusters::DeviceEnergyManagement::DEMManufacturerDelegate * DeviceEnergyManagementDelegate::GetDEMManufacturerDelegate() +{ + return mpDEMManufacturerDelegate; +} + /** * @brief Delegate handler for PowerAdjustRequest * diff --git a/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp b/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp index 3323519875..d993e5c163 100644 --- a/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp +++ b/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp @@ -90,10 +90,14 @@ void DeviceEnergyManagementMode::Shutdown() void emberAfDeviceEnergyManagementModeClusterInitCallback(chip::EndpointId endpointId) { - VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. VerifyOrDie(!gDeviceEnergyManagementModeDelegate && !gDeviceEnergyManagementModeInstance); gDeviceEnergyManagementModeDelegate = std::make_unique(); - gDeviceEnergyManagementModeInstance = - std::make_unique(gDeviceEnergyManagementModeDelegate.get(), 0x1, DeviceEnergyManagementMode::Id, 0); + gDeviceEnergyManagementModeInstance = std::make_unique(gDeviceEnergyManagementModeDelegate.get(), + endpointId, DeviceEnergyManagementMode::Id, 0); gDeviceEnergyManagementModeInstance->Init(); } + +void MatterDeviceEnergyManagementModeClusterServerShutdownCallback(chip::EndpointId endpoint) +{ + DeviceEnergyManagementMode::Shutdown(); +} diff --git a/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h b/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h index 17d2c865bb..c802cf8e04 100644 --- a/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h +++ b/examples/energy-management-app/energy-management-common/energy-evse/include/EVSEManufacturerImpl.h @@ -153,7 +153,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aVoltage_mV - Voltage measured in milli-volts * @param[in] aActiveCurrent_mA - ActiveCurrent measured in milli-amps */ - CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA); + CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA) override; /** * @brief Allows a client application to send cumulative energy readings into the system @@ -164,7 +164,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aCumulativeEnergyExported -total energy exported in milli-watthours */ CHIP_ERROR SendCumulativeEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, - int64_t aCumulativeEnergyExported); + int64_t aCumulativeEnergyExported) override; /** * @brief Allows a client application to send periodic energy readings into the system @@ -175,7 +175,7 @@ class EVSEManufacturer : public DEMManufacturerDelegate * @param[in] aPeriodicEnergyExported - energy exported in milli-watthours in last period */ CHIP_ERROR SendPeriodicEnergyReading(EndpointId aEndpointId, int64_t aCumulativeEnergyImported, - int64_t aCumulativeEnergyExported); + int64_t aCumulativeEnergyExported) override; /** Fake Meter data generation - used for testing EPM/EEM clusters */ /** diff --git a/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp b/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp index 0294a0349e..0305a58381 100644 --- a/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp +++ b/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp @@ -934,10 +934,10 @@ Status EnergyEvseDelegate::ComputeMaxChargeCurrentLimit() oldValue = mActualChargingCurrentLimit; mActualChargingCurrentLimit = mMaxHardwareCurrentLimit; - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mCircuitCapacity); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mCableAssemblyCurrentLimit); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mMaximumChargingCurrentLimitFromCommand); - mActualChargingCurrentLimit = min(mActualChargingCurrentLimit, mUserMaximumChargeCurrent); + mActualChargingCurrentLimit = std::min(mActualChargingCurrentLimit, mCircuitCapacity); + mActualChargingCurrentLimit = std::min(mActualChargingCurrentLimit, mCableAssemblyCurrentLimit); + mActualChargingCurrentLimit = std::min(mActualChargingCurrentLimit, mMaximumChargingCurrentLimitFromCommand); + mActualChargingCurrentLimit = std::min(mActualChargingCurrentLimit, mUserMaximumChargeCurrent); /* Set the actual max charging current attribute */ mMaximumChargeCurrent = mActualChargingCurrentLimit; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index bae77f5f8e..a8a10075ef 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -931,6 +931,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp b/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp index 78795976c0..bffe3c900d 100644 --- a/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp +++ b/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp @@ -16,16 +16,13 @@ * limitations under the License. */ +#include #include -#include -#include -#include #include #include #include #include -#include #include #include @@ -38,7 +35,6 @@ using namespace chip; using namespace chip::app; using namespace chip::app::DataModel; using namespace chip::app::Clusters; -using namespace chip::app::Clusters::EnergyEvse; using namespace chip::app::Clusters::ElectricalPowerMeasurement; using namespace chip::app::Clusters::ElectricalEnergyMeasurement; using namespace chip::app::Clusters::ElectricalEnergyMeasurement::Structs; @@ -145,7 +141,7 @@ void FakeReadings::FakeReadingsUpdate() int64_t current = (static_cast(rand()) % (2 * mCurrentRandomness_mA)) - mCurrentRandomness_mA; current += mCurrent_mA; // add in the base current - GetEvseManufacturer()->SendPowerReading(mEndpointId, power, voltage, current); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendPowerReading(mEndpointId, power, voltage, current); // update the energy meter - we'll assume that the power has been constant during the previous interval if (mPower_mW > 0) @@ -163,9 +159,11 @@ void FakeReadings::FakeReadingsUpdate() mTotalEnergyExported += mPeriodicEnergyExported; } - GetEvseManufacturer()->SendPeriodicEnergyReading(mEndpointId, mPeriodicEnergyImported, mPeriodicEnergyExported); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendPeriodicEnergyReading(mEndpointId, mPeriodicEnergyImported, + mPeriodicEnergyExported); - GetEvseManufacturer()->SendCumulativeEnergyReading(mEndpointId, mTotalEnergyImported, mTotalEnergyExported); + GetDEMDelegate()->GetDEMManufacturerDelegate()->SendCumulativeEnergyReading(mEndpointId, mTotalEnergyImported, + mTotalEnergyExported); // start/restart the timer DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(mInterval_s), FakeReadingsTimerExpiry, this); diff --git a/examples/energy-management-app/esp32/README.md b/examples/energy-management-app/esp32/README.md index 733ac5a632..f1a2f12ec4 100644 --- a/examples/energy-management-app/esp32/README.md +++ b/examples/energy-management-app/esp32/README.md @@ -5,9 +5,9 @@ Heater example application along with several other energy management clusters on ESP platforms. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. ### Enabling ESP-Insights: @@ -32,7 +32,7 @@ cp /path/to/auth/key.txt path/to/connectedhomeip/examples/energy-management-app/ --- - [Cluster Control](#cluster-control) -- [Matter OTA guide](../../../docs/guides/esp32/ota.md) +- [Matter OTA guide](../../../docs/platforms/esp32/ota.md) --- diff --git a/examples/energy-management-app/linux/README.md b/examples/energy-management-app/linux/README.md index 89b165c1e1..615f1f50db 100644 --- a/examples/energy-management-app/linux/README.md +++ b/examples/energy-management-app/linux/README.md @@ -7,7 +7,7 @@ for Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/energy-management-app/silabs/README.md b/examples/energy-management-app/silabs/README.md index 96237911df..5c1955a507 100644 --- a/examples/energy-management-app/silabs/README.md +++ b/examples/energy-management-app/silabs/README.md @@ -335,7 +335,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Group Communication (Multicast) diff --git a/examples/fabric-admin/commands/common/Commands.h b/examples/fabric-admin/commands/common/Commands.h index f071ac08c4..693c33e0ca 100644 --- a/examples/fabric-admin/commands/common/Commands.h +++ b/examples/fabric-admin/commands/common/Commands.h @@ -29,7 +29,7 @@ class Commands { public: - using CommandsVector = ::std::vector>; + using CommandsVector = std::vector>; void RegisterCluster(const char * clusterName, commands_list commandsList) { diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index c8d9f3da96..879d28cd15 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -30,15 +30,6 @@ using namespace ::chip; -namespace { - -void CheckFabricBridgeSynchronizationSupport(intptr_t ignored) -{ - DeviceMgr().ReadSupportedDeviceCategories(); -} - -} // namespace - void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_ERROR err) { if (mBridgeNodeId != deviceId) @@ -73,7 +64,7 @@ void FabricSyncAddBridgeCommand::OnCommissioningComplete(NodeId deviceId, CHIP_E // // Note: The Fabric-Admin MUST NOT send the RequestCommissioningApproval command // if the remote Fabric-Bridge lacks Fabric Synchronization support. - DeviceLayer::PlatformMgr().ScheduleWork(CheckFabricBridgeSynchronizationSupport, 0); + DeviceLayer::SystemLayer().ScheduleLambda([]() { DeviceMgr().ReadSupportedDeviceCategories(); }); } } else diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 4f7b1c7755..3a27c68184 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -30,6 +30,7 @@ using namespace chip::app::Clusters; namespace { +constexpr EndpointId kAggregatorEndpointId = 1; constexpr uint16_t kWindowTimeout = 300; constexpr uint16_t kIteration = 1000; constexpr uint16_t kSubscribeMinInterval = 0; @@ -114,7 +115,7 @@ void DeviceManager::RemoveSyncedDevice(NodeId nodeId) ChipLogValueX64(device->GetNodeId()), device->GetEndpointId()); } -void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, +void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const ByteSpan & salt, const ByteSpan & verifier) { ChipLogProgress(NotSpecified, "Opening commissioning window for Node ID: " ChipLogFormatX64, ChipLogValueX64(nodeId)); @@ -207,7 +208,7 @@ void DeviceManager::SubscribeRemoteFabricBridge() // Prepare and push the commissioner control subscribe command commandBuilder.Add("commissionercontrol subscribe-event commissioning-request-result "); commandBuilder.AddFormat("%d %d %lu %d --is-urgent true --keepSubscriptions true", kSubscribeMinInterval, kSubscribeMaxInterval, - mRemoteBridgeNodeId, kRootEndpointId); + mRemoteBridgeNodeId, kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } @@ -224,7 +225,7 @@ void DeviceManager::ReadSupportedDeviceCategories() commandBuilder.Add("commissionercontrol read supported-device-categories "); commandBuilder.AddFormat("%ld ", mRemoteBridgeNodeId); - commandBuilder.AddFormat("%d", kRootEndpointId); + commandBuilder.AddFormat("%d", kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } @@ -259,7 +260,7 @@ void DeviceManager::RequestCommissioningApproval() StringBuilder commandBuilder; commandBuilder.Add("commissionercontrol request-commissioning-approval "); - commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kRootEndpointId); + commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kAggregatorEndpointId); mRequestId = requestId; PushCommand(commandBuilder.c_str()); @@ -398,7 +399,7 @@ void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t respo StringBuilder commandBuilder; commandBuilder.Add("commissionercontrol commission-node "); - commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kRootEndpointId); + commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kAggregatorEndpointId); PushCommand(commandBuilder.c_str()); } @@ -422,7 +423,7 @@ void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier size: %lu", value.PAKEPasscodeVerifier.size()); ChipLogProgress(NotSpecified, " salt size: %lu", value.salt.size()); - OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, + OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.iterations, value.commissioningTimeout, value.discriminator, ByteSpan(value.salt.data(), value.salt.size()), ByteSpan(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size())); } diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index 5e43e78e3a..1514c417be 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -94,17 +94,17 @@ class DeviceManager : public PairingDelegate * This function initiates the process to open the commissioning window for a device identified by the given node ID. * * @param nodeId The ID of the node that should open the commissioning window. - * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines - * how long the commissioning window remains open for incoming connections. * @param iterations The number of PBKDF (Password-Based Key Derivation Function) iterations to use * for deriving the PAKE (Password Authenticated Key Exchange) verifier. + * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines + * how long the commissioning window remains open for incoming connections. * @param discriminator The device-specific discriminator, determined during commissioning, which helps * to uniquely identify the device among others. * @param salt The salt used in the cryptographic operations for commissioning. * @param verifier The PAKE verifier used to authenticate the commissioning process. * */ - void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, + void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const chip::ByteSpan & salt, const chip::ByteSpan & verifier); /** diff --git a/examples/fabric-admin/device_manager/PairingManager.cpp b/examples/fabric-admin/device_manager/PairingManager.cpp index c46a0ca000..41b4c8744e 100644 --- a/examples/fabric-admin/device_manager/PairingManager.cpp +++ b/examples/fabric-admin/device_manager/PairingManager.cpp @@ -131,98 +131,97 @@ CHIP_ERROR PairingManager::OpenCommissioningWindow(NodeId nodeId, EndpointId end return CHIP_ERROR_INCORRECT_STATE; } - auto params = Platform::MakeUnique(); - params->nodeId = nodeId; - params->endpointId = endpointId; - params->commissioningWindowTimeout = commissioningTimeoutSec; - params->iteration = iterations; - params->discriminator = discriminator; + // Ensure salt and verifier sizes are valid + if (!salt.empty() && salt.size() > chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length) + { + ChipLogError(NotSpecified, "Salt size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } - if (!salt.empty()) + if (!verifier.empty() && verifier.size() > chip::Crypto::kSpake2p_VerifierSerialized_Length) { - if (salt.size() > sizeof(params->saltBuffer)) - { - ChipLogError(NotSpecified, "Salt size exceeds buffer capacity"); - return CHIP_ERROR_BUFFER_TOO_SMALL; - } + ChipLogError(NotSpecified, "Verifier size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } - memcpy(params->saltBuffer, salt.data(), salt.size()); - params->salt = ByteSpan(params->saltBuffer, salt.size()); + if (!salt.empty()) + { + memcpy(mSaltBuffer, salt.data(), salt.size()); + mSalt = ByteSpan(mSaltBuffer, salt.size()); + } + else + { + mSalt = ByteSpan(); } if (!verifier.empty()) { - if (verifier.size() > sizeof(params->verifierBuffer)) - { - ChipLogError(NotSpecified, "Verifier size exceeds buffer capacity"); - return CHIP_ERROR_BUFFER_TOO_SMALL; - } - - memcpy(params->verifierBuffer, verifier.data(), verifier.size()); - params->verifier = ByteSpan(params->verifierBuffer, verifier.size()); + memcpy(mVerifierBuffer, verifier.data(), verifier.size()); + mVerifier = ByteSpan(mVerifierBuffer, verifier.size()); } - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnOpenCommissioningWindow, reinterpret_cast(params.release())); -} - -void PairingManager::OnOpenCommissioningWindow(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); - - if (self.mCommissioner == nullptr) + else { - ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); - return; + mVerifier = ByteSpan(); } - self.mWindowOpener = Platform::MakeUnique(self.mCommissioner); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId, endpointId, commissioningTimeoutSec, iterations, discriminator]() { + PairingManager & self = PairingManager::Instance(); - if (!params->verifier.empty()) - { - if (params->salt.empty()) + if (self.mCommissioner == nullptr) { - ChipLogError(NotSpecified, "Salt is required when verifier is set"); - self.mWindowOpener.reset(); + ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); return; } - CHIP_ERROR err = - self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowVerifierParams() - .SetNodeId(params->nodeId) - .SetEndpointId(params->endpointId) - .SetTimeout(params->commissioningWindowTimeout) - .SetIteration(params->iteration) - .SetDiscriminator(params->discriminator) - .SetVerifier(params->verifier) - .SetSalt(params->salt) - .SetCallback(&self.mOnOpenCommissioningWindowVerifierCallback)); - if (err != CHIP_NO_ERROR) + self.mWindowOpener = Platform::MakeUnique(self.mCommissioner); + + if (!self.mVerifier.empty()) { - ChipLogError(NotSpecified, "Failed to open commissioning window with verifier: %s", ErrorStr(err)); - self.mWindowOpener.reset(); + if (self.mSalt.empty()) + { + ChipLogError(NotSpecified, "Salt is required when verifier is set"); + self.mWindowOpener.reset(); + return; + } + + // Open the commissioning window with verifier parameters + CHIP_ERROR err = + self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowVerifierParams() + .SetNodeId(nodeId) + .SetEndpointId(endpointId) + .SetTimeout(commissioningTimeoutSec) + .SetIteration(iterations) + .SetDiscriminator(discriminator) + .SetVerifier(self.mVerifier) + .SetSalt(self.mSalt) + .SetCallback(&self.mOnOpenCommissioningWindowVerifierCallback)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with verifier: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } } - } - else - { - SetupPayload ignored; - CHIP_ERROR err = self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowPasscodeParams() - .SetNodeId(params->nodeId) - .SetEndpointId(params->endpointId) - .SetTimeout(params->commissioningWindowTimeout) - .SetIteration(params->iteration) - .SetDiscriminator(params->discriminator) - .SetSetupPIN(NullOptional) - .SetSalt(NullOptional) - .SetCallback(&self.mOnOpenCommissioningWindowCallback), - ignored); - if (err != CHIP_NO_ERROR) + else { - ChipLogError(NotSpecified, "Failed to open commissioning window with passcode: %s", ErrorStr(err)); - self.mWindowOpener.reset(); + SetupPayload ignored; + // Open the commissioning window with passcode parameters + CHIP_ERROR err = self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowPasscodeParams() + .SetNodeId(nodeId) + .SetEndpointId(endpointId) + .SetTimeout(commissioningTimeoutSec) + .SetIteration(iterations) + .SetDiscriminator(discriminator) + .SetSetupPIN(NullOptional) + .SetSalt(NullOptional) + .SetCallback(&self.mOnOpenCommissioningWindowCallback), + ignored); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with passcode: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } } - } + }); } void PairingManager::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, SetupPayload payload) @@ -290,7 +289,7 @@ void PairingManager::OnCommissioningComplete(NodeId nodeId, CHIP_ERROR err) if (err == CHIP_NO_ERROR) { // print to console - fprintf(stderr, "New device with Node ID: " ChipLogFormatX64 "has been successfully added.\n", ChipLogValueX64(nodeId)); + fprintf(stderr, "New device with Node ID: " ChipLogFormatX64 " has been successfully added.\n", ChipLogValueX64(nodeId)); // mCommissioner has a lifetime that is the entire life of the application itself // so it is safe to provide to StartDeviceSynchronization. @@ -580,34 +579,24 @@ CHIP_ERROR PairingManager::PairDeviceWithCode(NodeId nodeId, const char * payloa return CHIP_ERROR_INVALID_STRING_LENGTH; } - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - Platform::CopyString(params->payloadBuffer, sizeof(params->payloadBuffer), payload); + Platform::CopyString(mOnboardingPayload, sizeof(mOnboardingPayload), payload); - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnPairDeviceWithCode, reinterpret_cast(params.release())); -} - -void PairingManager::OnPairDeviceWithCode(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); + self.InitPairingCommand(); - CommissioningParameters commissioningParams = self.GetCommissioningParameters(); - auto discoveryType = DiscoveryType::kDiscoveryNetworkOnly; + CommissioningParameters commissioningParams = self.GetCommissioningParameters(); + auto discoveryType = DiscoveryType::kDiscoveryNetworkOnly; - self.mNodeId = params->nodeId; - self.mOnboardingPayload = params->payloadBuffer; + self.mNodeId = nodeId; - CHIP_ERROR err = self.mCommissioner->PairDevice(params->nodeId, params->payloadBuffer, commissioningParams, discoveryType); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to pair device with code, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.mCommissioner->PairDevice(nodeId, self.mOnboardingPayload, commissioningParams, discoveryType); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to pair device with code, error: %s", ErrorStr(err)); + } + }); } CHIP_ERROR PairingManager::PairDevice(chip::NodeId nodeId, uint32_t setupPINCode, const char * deviceRemoteIp, @@ -619,72 +608,50 @@ CHIP_ERROR PairingManager::PairDevice(chip::NodeId nodeId, uint32_t setupPINCode return CHIP_ERROR_INVALID_STRING_LENGTH; } - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - params->setupPINCode = setupPINCode; - params->deviceRemotePort = deviceRemotePort; - - Platform::CopyString(params->ipAddrBuffer, sizeof(params->ipAddrBuffer), deviceRemoteIp); - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnPairDevice, reinterpret_cast(params.release())); -} + Platform::CopyString(mRemoteIpAddr, sizeof(mRemoteIpAddr), deviceRemoteIp); -void PairingManager::OnPairDevice(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId, setupPINCode, deviceRemotePort]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); - self.mSetupPINCode = params->setupPINCode; + self.InitPairingCommand(); + self.mSetupPINCode = setupPINCode; - Inet::IPAddress address; - Inet::InterfaceId interfaceId; + Inet::IPAddress address; + Inet::InterfaceId interfaceId; - if (!ParseAddressWithInterface(params->ipAddrBuffer, address, interfaceId)) - { - ChipLogError(NotSpecified, "Invalid IP address: %s", params->ipAddrBuffer); - return; - } + if (!ParseAddressWithInterface(self.mRemoteIpAddr, address, interfaceId)) + { + ChipLogError(NotSpecified, "Invalid IP address: %s", self.mRemoteIpAddr); + return; + } - CHIP_ERROR err = self.Pair(params->nodeId, Transport::PeerAddress::UDP(address, params->deviceRemotePort, interfaceId)); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to pair device, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.Pair(nodeId, Transport::PeerAddress::UDP(address, deviceRemotePort, interfaceId)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to pair device, error: %s", ErrorStr(err)); + } + }); } CHIP_ERROR PairingManager::UnpairDevice(NodeId nodeId) { - auto params = Platform::MakeUnique(); - VerifyOrReturnError(params != nullptr, CHIP_ERROR_NO_MEMORY); - - params->nodeId = nodeId; - - // Schedule work on the Matter thread - return DeviceLayer::PlatformMgr().ScheduleWork(OnUnpairDevice, reinterpret_cast(params.release())); -} - -void PairingManager::OnUnpairDevice(intptr_t context) -{ - Platform::UniquePtr params(reinterpret_cast(context)); - PairingManager & self = PairingManager::Instance(); + return DeviceLayer::SystemLayer().ScheduleLambda([nodeId]() { + PairingManager & self = PairingManager::Instance(); - self.InitPairingCommand(); + self.InitPairingCommand(); - self.mCurrentFabricRemover = Platform::MakeUnique(self.mCommissioner); + self.mCurrentFabricRemover = Platform::MakeUnique(self.mCommissioner); - if (!self.mCurrentFabricRemover) - { - ChipLogError(NotSpecified, "Failed to unpair device, mCurrentFabricRemover is null"); - return; - } + if (!self.mCurrentFabricRemover) + { + ChipLogError(NotSpecified, "Failed to unpair device, mCurrentFabricRemover is null"); + return; + } - CHIP_ERROR err = self.mCurrentFabricRemover->RemoveCurrentFabric(params->nodeId, &self.mCurrentFabricRemoveCallback); - if (err != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "Failed to unpair device, error: %s", ErrorStr(err)); - } + CHIP_ERROR err = self.mCurrentFabricRemover->RemoveCurrentFabric(nodeId, &self.mCurrentFabricRemoveCallback); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to unpair device, error: %s", ErrorStr(err)); + } + }); } diff --git a/examples/fabric-admin/device_manager/PairingManager.h b/examples/fabric-admin/device_manager/PairingManager.h index 563d129079..50e64f9f0c 100644 --- a/examples/fabric-admin/device_manager/PairingManager.h +++ b/examples/fabric-admin/device_manager/PairingManager.h @@ -140,39 +140,6 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, CHIP_ERROR UnpairDevice(chip::NodeId nodeId); private: - struct CommissioningWindowParams - { - chip::NodeId nodeId; - chip::EndpointId endpointId; - uint16_t commissioningWindowTimeout; - uint32_t iteration; - uint16_t discriminator; - chip::Optional setupPIN; - uint8_t verifierBuffer[chip::Crypto::kSpake2p_VerifierSerialized_Length]; - chip::ByteSpan verifier; - uint8_t saltBuffer[chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length]; - chip::ByteSpan salt; - }; - - struct PairDeviceWithCodeParams - { - chip::NodeId nodeId; - char payloadBuffer[kMaxManualCodeLength + 1]; - }; - - struct PairDeviceParams - { - chip::NodeId nodeId; - uint32_t setupPINCode; - uint16_t deviceRemotePort; - char ipAddrBuffer[chip::Inet::IPAddress::kMaxStringLength]; - }; - - struct UnpairDeviceParams - { - chip::NodeId nodeId; - }; - // Constructors PairingManager(); PairingManager(const PairingManager &) = delete; @@ -202,14 +169,10 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, const chip::Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info, chip::Credentials::AttestationVerificationResult attestationResult) override; - static void OnOpenCommissioningWindow(intptr_t context); static void OnOpenCommissioningWindowResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status, chip::SetupPayload payload); static void OnOpenCommissioningWindowVerifierResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status); static void OnCurrentFabricRemove(void * context, chip::NodeId remoteNodeId, CHIP_ERROR status); - static void OnPairDeviceWithCode(intptr_t context); - static void OnPairDevice(intptr_t context); - static void OnUnpairDevice(intptr_t context); // Private data members chip::Controller::DeviceCommissioner * mCommissioner = nullptr; @@ -219,12 +182,17 @@ class PairingManager : public chip::Controller::DevicePairingDelegate, CommissioningDelegate * mCommissioningDelegate = nullptr; PairingDelegate * mPairingDelegate = nullptr; - chip::NodeId mNodeId = chip::kUndefinedNodeId; - uint16_t mDiscriminator = 0; - uint32_t mSetupPINCode = 0; - const char * mOnboardingPayload = nullptr; - bool mDeviceIsICD = false; + chip::NodeId mNodeId = chip::kUndefinedNodeId; + chip::ByteSpan mVerifier; + chip::ByteSpan mSalt; + uint16_t mDiscriminator = 0; + uint32_t mSetupPINCode = 0; + bool mDeviceIsICD = false; uint8_t mRandomGeneratedICDSymmetricKey[chip::Crypto::kAES_CCM128_Key_Length]; + uint8_t mVerifierBuffer[chip::Crypto::kSpake2p_VerifierSerialized_Length]; + uint8_t mSaltBuffer[chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length]; + char mRemoteIpAddr[chip::Inet::IPAddress::kMaxStringLength]; + char mOnboardingPayload[kMaxManualCodeLength + 1]; chip::Optional mICDRegistration; chip::Optional mICDCheckInNodeId; diff --git a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp index 9c59e54137..49ce9b663c 100644 --- a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp +++ b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp @@ -131,7 +131,7 @@ void UniqueIdGetter::OnDeviceConnected(Messaging::ExchangeManager & exchangeMgr, if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Failed to issue subscription to AdministratorCommissioning data"); + ChipLogError(NotSpecified, "Failed to read unique ID from the bridged device."); OnDone(nullptr); return; } @@ -140,7 +140,7 @@ void UniqueIdGetter::OnDeviceConnected(Messaging::ExchangeManager & exchangeMgr, void UniqueIdGetter::OnDeviceConnectionFailure(const ScopedNodeId & peerId, CHIP_ERROR error) { VerifyOrDie(mCurrentlyGettingUid); - ChipLogError(NotSpecified, "DeviceSubscription failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); + ChipLogError(NotSpecified, "UniqueIdGetter failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); OnDone(nullptr); } diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index d68eb11786..8613d06c6f 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -101,9 +101,9 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate // TODO(#35875): OpenDeviceCommissioningWindow uses the same controller every time and doesn't currently accept // FabricIndex. For now we are dropping fabric index from the scoped node id. NodeId nodeId = request.id.node_id; - uint32_t commissioningTimeoutSec = request.commissioning_timeout; uint32_t iterations = request.iterations; uint16_t discriminator = request.discriminator; + uint16_t commissioningTimeoutSec = static_cast(request.commissioning_timeout); // Log the request details for debugging ChipLogProgress(NotSpecified, @@ -111,7 +111,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate static_cast(nodeId), commissioningTimeoutSec, iterations, discriminator); // Open the device commissioning window using raw binary data for salt and verifier - DeviceMgr().OpenDeviceCommissioningWindow(nodeId, commissioningTimeoutSec, iterations, discriminator, + DeviceMgr().OpenDeviceCommissioningWindow(nodeId, iterations, commissioningTimeoutSec, discriminator, ByteSpan(request.salt.bytes, request.salt.size), ByteSpan(request.verifier.bytes, request.verifier.size)); diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index 57ce56efc3..11dcf2f03d 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -710,6 +710,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2058,21 +2059,6 @@ endpoint 0 { handle command KeySetReadAllIndices; handle command KeySetReadAllIndicesResponse; } - - server cluster CommissionerControl { - emits event CommissioningRequestResult; - ram attribute supportedDeviceCategories default = 0; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute eventList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - - handle command RequestCommissioningApproval; - handle command CommissionNode; - handle command ReverseOpenCommissioningWindow; - } } endpoint 1 { device type ma_aggregator = 14, version 1; @@ -2102,6 +2088,21 @@ endpoint 1 { callback attribute featureMap; callback attribute clusterRevision; } + + server cluster CommissionerControl { + emits event CommissioningRequestResult; + ram attribute supportedDeviceCategories default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RequestCommissioningApproval; + handle command CommissionNode; + handle command ReverseOpenCommissioningWindow; + } } diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap index 83dae81eec..6537421778 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap @@ -3969,18 +3969,46 @@ "reportableChange": 0 } ] - }, + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 14, + "profileId": 259, + "label": "MA-aggregator", + "name": "MA-aggregator" + }, + "deviceTypes": [ { - "name": "Commissioner Control", - "code": 1873, + "code": 14, + "profileId": 259, + "label": "MA-aggregator", + "name": "MA-aggregator" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 14 + ], + "deviceTypeName": "MA-aggregator", + "deviceTypeCode": 14, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, "mfgCode": null, - "define": "COMMISSIONER_CONTROL_CLUSTER", + "define": "IDENTIFY_CLUSTER", "side": "server", "enabled": 1, - "apiMaturity": "provisional", "commands": [ { - "name": "RequestCommissioningApproval", + "name": "Identify", "code": 0, "mfgCode": null, "source": "client", @@ -3988,58 +4016,50 @@ "isEnabled": 1 }, { - "name": "CommissionNode", - "code": 1, + "name": "TriggerEffect", + "code": 64, "mfgCode": null, "source": "client", "isIncoming": 1, "isEnabled": 1 - }, - { - "name": "ReverseOpenCommissioningWindow", - "code": 2, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 } ], "attributes": [ { - "name": "SupportedDeviceCategories", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", - "type": "SupportedDeviceCategoryBitmap", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "0x0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "IdentifyType", + "code": 1, "mfgCode": null, "side": "server", - "type": "array", + "type": "IdentifyTypeEnum", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0x0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -4054,8 +4074,8 @@ "reportableChange": 0 }, { - "name": "EventList", - "code": 65530, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -4111,105 +4131,81 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 } - ], - "events": [ - { - "name": "CommissioningRequestResult", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - } ] - } - ] - }, - { - "id": 2, - "name": "Anonymous Endpoint Type", - "deviceTypeRef": { - "code": 14, - "profileId": 259, - "label": "MA-aggregator", - "name": "MA-aggregator" - }, - "deviceTypes": [ - { - "code": 14, - "profileId": 259, - "label": "MA-aggregator", - "name": "MA-aggregator" - } - ], - "deviceVersions": [ - 1 - ], - "deviceIdentifiers": [ - 14 - ], - "deviceTypeName": "MA-aggregator", - "deviceTypeCode": 14, - "deviceTypeProfileId": 259, - "clusters": [ + }, { - "name": "Identify", - "code": 3, + "name": "Descriptor", + "code": 29, "mfgCode": null, - "define": "IDENTIFY_CLUSTER", + "define": "DESCRIPTOR_CLUSTER", "side": "server", "enabled": 1, - "commands": [ + "attributes": [ { - "name": "Identify", + "name": "DeviceTypeList", "code": 0, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 }, { - "name": "TriggerEffect", - "code": 64, + "name": "ServerList", + "code": 1, "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { - "name": "IdentifyTime", - "code": 0, + "name": "ClientList", + "code": 2, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "IdentifyType", - "code": 1, + "name": "PartsList", + "code": 3, "mfgCode": null, "side": "server", - "type": "IdentifyTypeEnum", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0x0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4270,10 +4266,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4286,10 +4282,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4298,64 +4294,58 @@ ] }, { - "name": "Descriptor", - "code": 29, + "name": "Commissioner Control", + "code": 1873, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "COMMISSIONER_CONTROL_CLUSTER", "side": "server", "enabled": 1, - "attributes": [ + "commands": [ { - "name": "DeviceTypeList", + "name": "RequestCommissioningApproval", "code": 0, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ServerList", + "name": "CommissionNode", "code": 1, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ClientList", + "name": "ReverseOpenCommissioningWindow", "code": 2, "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedDeviceCategories", + "code": 0, + "mfgCode": null, "side": "server", - "type": "array", + "type": "SupportedDeviceCategoryBitmap", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -4363,15 +4353,15 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -4379,15 +4369,15 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", "type": "array", @@ -4395,7 +4385,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4411,7 +4401,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4424,10 +4414,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4440,15 +4430,24 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "CommissioningRequestResult", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } ] } ] diff --git a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp index 02bdfbdbcb..7d58811299 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp +++ b/examples/fabric-bridge-app/fabric-bridge-common/src/BridgedDevice.cpp @@ -24,78 +24,31 @@ #include #include -namespace { - -struct ActiveChangeEventWorkData -{ - chip::EndpointId mEndpointId; - uint32_t mPromisedActiveDuration; -}; - -struct ReportAttributeChangedWorkData -{ - chip::EndpointId mEndpointId; - bool mWindowChanged = false; - bool mFabricIndexChanged = false; - bool mVendorChanged = false; -}; - -void ActiveChangeEventWork(intptr_t arg) -{ - ActiveChangeEventWorkData * data = reinterpret_cast(arg); - - chip::app::Clusters::BridgedDeviceBasicInformation::Events::ActiveChanged::Type event{}; - event.promisedActiveDuration = data->mPromisedActiveDuration; - chip::EventNumber eventNumber = 0; - - CHIP_ERROR err = chip::app::LogEvent(event, data->mEndpointId, eventNumber); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); - } - chip::Platform::Delete(data); -} - -void ReportAttributeChangedWork(intptr_t arg) -{ - ReportAttributeChangedWorkData * data = reinterpret_cast(arg); - - if (data->mWindowChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); - } - if (data->mFabricIndexChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); - } - if (data->mVendorChanged) - { - MatterReportingAttributeChangeCallback(data->mEndpointId, chip::app::Clusters::AdministratorCommissioning::Id, - chip::app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); - } - chip::Platform::Delete(data); -} - -} // namespace - +using namespace chip; using namespace chip::app::Clusters::Actions; -BridgedDevice::BridgedDevice(chip::ScopedNodeId scopedNodeId) +BridgedDevice::BridgedDevice(ScopedNodeId scopedNodeId) { mReachable = false; mScopedNodeId = scopedNodeId; - mEndpointId = chip::kInvalidEndpointId; + mEndpointId = kInvalidEndpointId; } void BridgedDevice::LogActiveChangeEvent(uint32_t promisedActiveDurationMs) { - ActiveChangeEventWorkData * workdata = chip::Platform::New(); - workdata->mEndpointId = mEndpointId; - workdata->mPromisedActiveDuration = promisedActiveDurationMs; - - chip::DeviceLayer::PlatformMgr().ScheduleWork(ActiveChangeEventWork, reinterpret_cast(workdata)); + EndpointId endpointId = mEndpointId; + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, promisedActiveDurationMs]() { + app::Clusters::BridgedDeviceBasicInformation::Events::ActiveChanged::Type event{}; + event.promisedActiveDuration = promisedActiveDurationMs; + EventNumber eventNumber = 0; + + CHIP_ERROR err = app::LogEvent(event, endpointId, eventNumber); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); + } + }); } void BridgedDevice::SetReachable(bool reachable) @@ -114,15 +67,29 @@ void BridgedDevice::SetReachable(bool reachable) void BridgedDevice::SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes) { - ReportAttributeChangedWorkData * workdata = chip::Platform::New(); - - workdata->mEndpointId = mEndpointId; - workdata->mWindowChanged = + EndpointId endpointId = mEndpointId; + bool windowChanged = (aAdminCommissioningAttributes.commissioningWindowStatus != mAdminCommissioningAttributes.commissioningWindowStatus); - workdata->mFabricIndexChanged = - (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); - workdata->mVendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); + bool fabricIndexChanged = (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); + bool vendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); mAdminCommissioningAttributes = aAdminCommissioningAttributes; - chip::DeviceLayer::PlatformMgr().ScheduleWork(ReportAttributeChangedWork, reinterpret_cast(workdata)); + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, windowChanged, fabricIndexChanged, vendorChanged]() { + if (windowChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); + } + if (fabricIndexChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); + } + if (vendorChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); + } + }); } diff --git a/examples/fabric-bridge-app/linux/CommissionerControl.cpp b/examples/fabric-bridge-app/linux/CommissionerControl.cpp index e9dded102b..138e1129b8 100644 --- a/examples/fabric-bridge-app/linux/CommissionerControl.cpp +++ b/examples/fabric-bridge-app/linux/CommissionerControl.cpp @@ -116,7 +116,7 @@ CHIP_ERROR CommissionerControlDelegate::HandleCommissioningApprovalRequest(const mLabel.ClearValue(); } - CHIP_ERROR err = CommissionerControlServer::Instance().GenerateCommissioningRequestResultEvent(result); + CHIP_ERROR err = CommissionerControlServer::Instance().GenerateCommissioningRequestResultEvent(kAggregatorEndpointId, result); if (err == CHIP_NO_ERROR) { @@ -241,7 +241,7 @@ CHIP_ERROR CommissionerControlInit() Protocols::InteractionModel::Status status = Clusters::CommissionerControl::CommissionerControlServer::Instance().SetSupportedDeviceCategoriesValue( - kRootEndpointId, supportedDeviceCategories); + Clusters::CommissionerControl::kAggregatorEndpointId, supportedDeviceCategories); if (status != Protocols::InteractionModel::Status::Success) { diff --git a/examples/fabric-bridge-app/linux/include/CommissionerControl.h b/examples/fabric-bridge-app/linux/include/CommissionerControl.h index 1188d9a796..fceb80c2d8 100644 --- a/examples/fabric-bridge-app/linux/include/CommissionerControl.h +++ b/examples/fabric-bridge-app/linux/include/CommissionerControl.h @@ -26,6 +26,8 @@ namespace app { namespace Clusters { namespace CommissionerControl { +inline constexpr EndpointId kAggregatorEndpointId = 1; + class CommissionerControlDelegate : public Delegate { public: diff --git a/examples/fabric-bridge-app/linux/main.cpp b/examples/fabric-bridge-app/linux/main.cpp index 3e93c9878f..a101fd3d32 100644 --- a/examples/fabric-bridge-app/linux/main.cpp +++ b/examples/fabric-bridge-app/linux/main.cpp @@ -81,10 +81,10 @@ bool HandleCustomOption(const char * aProgram, ArgParser::OptionSet * aOptions, switch (aIdentifier) { case kOptionFabricAdminServerPortNumber: - gFabricAdminServerPort = atoi(aValue); + gFabricAdminServerPort = static_cast(atoi(aValue)); break; case kOptionLocalServerPortNumber: - gLocalServerPort = atoi(aValue); + gLocalServerPort = static_cast(atoi(aValue)); break; default: ArgParser::PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt index 0b1a2ab746..be1af1d62c 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImExtendableInvokeCommand.kt @@ -75,6 +75,7 @@ class PairOnNetworkLongImExtendableInvokeCommand( ) { setFailure("invoke failure with incorrect status") } + responseCount++ } if (clusterId == CLUSTER_ID_TEST && commandId == TEST_ADD_ARGUMENT_RSP_COMMAND) { @@ -89,8 +90,8 @@ class PairOnNetworkLongImExtendableInvokeCommand( if (status != null) { setFailure("invoke failure with incorrect status") } + responseCount++ } - responseCount++ } override fun onNoResponse(noInvokeResponseData: NoInvokeResponseData) { @@ -126,7 +127,7 @@ class PairOnNetworkLongImExtendableInvokeCommand( val element1: InvokeElement = InvokeElement.newInstance( - /* endpointId= */ 0, + /* endpointId= */ 1, CLUSTER_ID_IDENTIFY, IDENTIFY_COMMAND, tlvWriter1.getEncoded(), diff --git a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt index a33a813f07..4351a937f7 100644 --- a/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt +++ b/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt @@ -183,7 +183,9 @@ abstract class PairingCommand( override fun onICDRegistrationInfoRequired() { logger.log(Level.INFO, "onICDRegistrationInfoRequired") currentCommissioner() - .updateCommissioningICDRegistrationInfo(ICDRegistrationInfo.newBuilder().build()) + .updateCommissioningICDRegistrationInfo( + ICDRegistrationInfo.newBuilder().setICDStayActiveDurationMsec(30000L).build() + ) } override fun onICDRegistrationComplete(errorCode: Long, icdDeviceInfo: ICDDeviceInfo) { diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index 8f30d53f6e..39546259b0 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -1194,6 +1194,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/light-switch-app/asr/README.md b/examples/light-switch-app/asr/README.md index ed3b65b82f..5d2f575a2b 100755 --- a/examples/light-switch-app/asr/README.md +++ b/examples/light-switch-app/asr/README.md @@ -13,7 +13,7 @@ This example demonstrates the Matter Light Switch application on ASR platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/light-switch-app/esp32/README.md b/examples/light-switch-app/esp32/README.md index 43a9d9536b..023f9bb227 100644 --- a/examples/light-switch-app/esp32/README.md +++ b/examples/light-switch-app/esp32/README.md @@ -3,9 +3,9 @@ This example demonstrates the Matter Light-switch application on ESP platforms. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- diff --git a/examples/light-switch-app/genio/README.md b/examples/light-switch-app/genio/README.md index 7961597d4d..1a9531803f 100644 --- a/examples/light-switch-app/genio/README.md +++ b/examples/light-switch-app/genio/README.md @@ -88,7 +88,7 @@ MediaTek platform. Chip tool standalone, Android or iOS app [CHIP - Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) + Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md) - First of all, you have to commission with the light-switch-app (nodeID 1) and the lighting-app (nodeID 2) with the CHIP tool by following commands. diff --git a/examples/light-switch-app/infineon/cyw30739/README.md b/examples/light-switch-app/infineon/cyw30739/README.md index 0343563087..cec7a2b3ad 100644 --- a/examples/light-switch-app/infineon/cyw30739/README.md +++ b/examples/light-switch-app/infineon/cyw30739/README.md @@ -212,7 +212,7 @@ Put the CYW30739 in to the recovery mode before running the flash script. - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. - For this example to work, it is necessary to have a second CYW30739 device 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 e2fea1bdb8..07910e283f 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 @@ -959,6 +959,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/light-switch-app/nrfconnect/README.md b/examples/light-switch-app/nrfconnect/README.md index 943759735f..11e5379346 100644 --- a/examples/light-switch-app/nrfconnect/README.md +++ b/examples/light-switch-app/nrfconnect/README.md @@ -48,7 +48,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -236,9 +236,10 @@ development kits: - [Lighting Example Application](../../lighting-app/nrfconnect/README.md) -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to -learn how to commission the lighting device to the same Matter network using the -CHIP Tool. +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to learn how to commission the lighting device to the same Matter network using +the CHIP Tool.
@@ -342,7 +343,7 @@ platform image. **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -375,7 +376,8 @@ the Light Switch Example application by using the Matter CLI: uart:~$ switch groups onoff off : sends multicast Off command to all bound devices in a group uart:~$ switch groups onoff toggle : sends multicast Toggle command to all bound devices in a group -Check the [CLI user guide](../../../docs/guides/nrfconnect_examples_cli.md) to +Check the +[CLI user guide](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) to learn how to use other CLI commands of the application.
@@ -570,7 +572,7 @@ depending on the selected board: the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -602,7 +604,8 @@ process, and add Access Control Lists (ACLs). ### Commissioning the lighting device To commission the Lighting Example Application to the same Matter network, read -the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md). +the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md). ### Binding cluster and endpoints @@ -617,7 +620,7 @@ example, you can use the The ACL should contain information about all clusters that can be called by the light switch application. See the section about interacting with ZCL clusters in the -[CHIP Tool's user guide](../../../docs/guides/chip_tool_guide.md#interacting-with-data-model-clusters) +[CHIP Tool's user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#interacting-with-data-model-clusters) for more information about ACLs. You can perform the binding process to a single remote endpoint (unicast @@ -635,7 +638,7 @@ same Matter network. To perform the unicast binding process, complete the following steps: 1. Build the CHIP Tool according to the steps from the - [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md#building-and-running-the-chip-tool). + [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-and-running-the-chip-tool). 2. Go to the CHIP Tool build directory. 3. Add an ACL to the development kit that is programmed with the [Lighting Application Example](../../lighting-app/nrfconnect/README.md) by @@ -687,7 +690,7 @@ same Matter network. To perform the unicast binding process, complete the following steps: 1. Build the CHIP Tool according to the steps from the - [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md#building-and-running-the-chip-tool). + [CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md#building-and-running-the-chip-tool). 2. Go to the CHIP Tool build directory. 3. Add the light switch device to the multicast group by running the following @@ -734,5 +737,5 @@ switch subscribe-event short-release 1 20 2 --is-urgent true --keepSub ### Testing Device Firmware Upgrade Read the -[DFU tutorial](../../../docs/guides/nrfconnect_examples_software_update.md) to -see how to upgrade your device firmware. +[DFU tutorial](../../../docs/platforms/nrf/nrfconnect_examples_software_update.md) +to see how to upgrade your device firmware. diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 0cbae08b34..979ae18fa4 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1343,6 +1343,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/light-switch-app/silabs/README.md b/examples/light-switch-app/silabs/README.md index fe39610cbf..898f8e8f29 100644 --- a/examples/light-switch-app/silabs/README.md +++ b/examples/light-switch-app/silabs/README.md @@ -210,7 +210,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -393,7 +393,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index c5ee2bb6d3..d103ddc553 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3019,7 +3020,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap index 8d55481e31..54693b1515 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap @@ -4484,7 +4484,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app-data-mode-no-unique-id/linux/README.md b/examples/lighting-app-data-mode-no-unique-id/linux/README.md index 3262e3446a..0fc9ebccff 100644 --- a/examples/lighting-app-data-mode-no-unique-id/linux/README.md +++ b/examples/lighting-app-data-mode-no-unique-id/linux/README.md @@ -12,17 +12,21 @@ Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
-- [CHIP Linux Lighting Example](#chip-linux-lighting-example-data-mode-no-unique-id) +- [CHIP Linux Lighting Example (Data Mode, No Unique ID)](#chip-linux-lighting-example-data-mode-no-unique-id) - [Building](#building) - - [Commandline Arguments](#commandline-arguments) + - [Commandline arguments](#commandline-arguments) - [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4) - - [Running RPC console](#running-rpc-console) + - [Running RPC Console](#running-rpc-console) - [Device Tracing](#device-tracing) + - [Trigger event using lighting-app event named pipe](#trigger-event-using-lighting-app-event-named-pipe) + - [Trigger `SoftwareFault` events](#trigger-softwarefault-events) + - [Trigger `HardwareFault` events](#trigger-hardwarefault-events) + - [Trigger Switch events](#trigger-switch-events)
diff --git a/examples/lighting-app/asr/README.md b/examples/lighting-app/asr/README.md index 234154ce8b..ade620e0fc 100755 --- a/examples/lighting-app/asr/README.md +++ b/examples/lighting-app/asr/README.md @@ -14,7 +14,7 @@ This example demonstrates the Matter Lighting application on ASR platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index d2fd8b72af..4a5c8d72f4 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -1,4 +1,4 @@ -# `Bouffalo Lab` +# Matter `Bouffalo Lab` Lighting Example This example functions as a light bulb device type, with on/off and level capabilities and uses a test Vendor ID (VID) and a Product ID (PID) @@ -17,8 +17,6 @@ Legacy supported boards: - `BL602-NIGHT-LIGHT` - `XT-ZB6-DevKit` - `BL706-NIGHT-LIGHT` -- `BL706DK` -- `BL704LDK` > Warning: Changing the VID/PID may cause compilation problems, we recommend > leaving it as the default while using this example. @@ -99,6 +97,7 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ``` ./scripts/build/build_examples.py --target bouffalolab-bl602dk-light build + ./scripts/build/build_examples.py --target bouffalolab-bl616dk-light-wifi build ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light build ``` @@ -113,25 +112,28 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ### Build options with build_examples.py -- `-wifi`, to specify that connectivity Wi-Fi is enabled for Matter - application. +- `-wifi`, specifies to use Wi-Fi for Matter application. - - BL602 uses `-wifi` by default - - BL702 needs specify to use BL706 + BL602 for Wi-Fi connectivity. + - BL602 uses Wi-Fi by default. `-wifi` could be elided. + - BL702 needs it to specify to use BL706 + BL602 for Wi-Fi. -- `-thread`, to specify that connectivity Thread is enabled for Matter - application. +- `-thread`, specifies to use Thread for Matter application. - - BL70X uses `-thread` by default. + - BL70X uses Thread by default. `-thread` could be elided. -- `-ethernet`, to specify that connectivity Ethernet is enabled for Matte - application. +- `-ethernet`, specifies to use Ethernet for Matter application. - - BL706 needs specify to use Ethernet connectivity. + - BL706 needs it to specify to use Ethernet. -- `-easyflash`, to specify that `easyflash` is used for flash storage access. +- `-littlefs`, specifies to use `littlefs` for flash access. +- `-easyflash`, specifies to use `easyflash` for flash access. + - for platform BL602/BL70X, it is necessary to specify one of `-easyflash` + and `-littlefs`. - `-mfd`, enable Matter factory data feature, which load factory data from `MFD` partition + - Please refer to + [Bouffalo Lab Matter factory data guide](../../../docs/platforms/bouffalolab/matter_factory_data.md) + or contact to `Bouffalo Lab` for support. - `-shell`, enable command line - `-rpc`, enable Pigweed RPC feature - `-115200`, set UART baudrate to 115200 for log and command line @@ -173,11 +175,11 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. - `BL602DK`, `BL704LDK` and `BL706DK`. - ```shell - ./out/bouffalolab-bl602dk-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-bl706dk-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl602dk-light-littlefs/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl616dk-light-wifi/chip-bl616dk-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl704ldk-light-littlefs/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light-littlefs/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ``` - To wipe out flash and download image, please append `--erase` @@ -209,15 +211,16 @@ The following steps take examples for `BL602DK`, `BL704LDK` and `BL706DK`. ## Test Commission and Control with chip-tool -Please follow [chip_tool_guide](../../../docs/guides/chip_tool_guide.md) and -[guide](../../chip-tool/README.md) to build and use chip-tool for test. +Please follow +[chip_tool_guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +and [guide](../../chip-tool/README.md) to build and use chip-tool for test. ### Prerequisite for Thread Protocol Thread wireless protocol runs on BL706, which needs a Thread border router to connect Thread network to Wi-Fi/Ethernet network. Please follow this -[guide](../../../docs/guides/openthread_border_router_pi.md) to setup a -raspberry Pi border router. +[guide](../../../docs/platforms/openthread/openthread_border_router_pi.md) to +setup a raspberry Pi border router. After Thread border router setup, please type following command on Thread border router to get Thread network credential. @@ -300,11 +303,11 @@ ota-provider-app build and usage. - Add boot parameters, signature/encryption if specified - And specify whether image has be compressed. - Add Matter recognition header by - [ota_image_tool.py](../../../docs/guides/openthread_border_router_pi.md). + [ota_image_tool.py](../../../docs/platforms/openthread/openthread_border_router_pi.md). Script `*.flash.py` builds `Bouffalo Lab` bootable image and call -[ota_image_tool.py](../../../docs/guides/openthread_border_router_pi.md) to add -Matter recognition header. Take `BL602DK` as example. +[ota_image_tool.py](../../../docs/platforms/openthread/openthread_border_router_pi.md) +to add Matter recognition header. Take `BL602DK` as example. ```shell ./out/bouffalolab-bl602dk-light/chip-bl602-lighting-example.flash.py --build-ota --vendor-id --product-id --version --version-str --digest-algorithm 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 ac770a74de..7ce2b52c2d 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2390,7 +2391,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x254; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; 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 5a0e876845..5115fe9657 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -2952,7 +2952,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x254", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, 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 c8c3ebca3a..bc48c4056b 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2576,7 +2577,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x254; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; 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 0c3c28dbdd..f3e9a7c5ce 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -3928,7 +3928,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x254", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, 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 66ccb1f4fb..d896f4308f 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2439,7 +2440,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x254; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; 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 3f7f9e3119..2afef0893a 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -3135,7 +3135,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x254", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/esp32/README.md b/examples/lighting-app/esp32/README.md index 3e3dc5ee0a..da74d5476d 100644 --- a/examples/lighting-app/esp32/README.md +++ b/examples/lighting-app/esp32/README.md @@ -3,9 +3,9 @@ This example demonstrates the Matter Lighting application on ESP platforms. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. ### Enabling ESP-Insights: @@ -47,4 +47,4 @@ cp /path/to/auth/key.txt path/to/connectedhomeip/examples/lighting-app/esp32/mai ### Matter OTA For Matter OTA please take a look at -[Matter OTA guide](../../../docs/guides/esp32/ota.md). +[Matter OTA guide](../../../docs/platforms/esp32/ota.md). diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 index 104777a72b..161fdd52ae 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32c6 @@ -65,3 +65,7 @@ CONFIG_ENABLE_CHIP_SHELL=y # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Serial Flasher config +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" diff --git a/examples/lighting-app/genio/README.md b/examples/lighting-app/genio/README.md index 575d4ba5e1..1b586c1597 100644 --- a/examples/lighting-app/genio/README.md +++ b/examples/lighting-app/genio/README.md @@ -86,7 +86,7 @@ MediaTek platform. Chip tool standalone, Android or iOS app [CHIP - Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) + Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md) Here is an example with the CHIP Tool controller: diff --git a/examples/lighting-app/infineon/cyw30739/README.md b/examples/lighting-app/infineon/cyw30739/README.md index a69ddb0957..c27eaba47a 100644 --- a/examples/lighting-app/infineon/cyw30739/README.md +++ b/examples/lighting-app/infineon/cyw30739/README.md @@ -212,7 +212,7 @@ Put the CYW30739 in to the recovery mode before running the flash script. - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. - You can provision and control the device using the Python controller REPL, diff --git a/examples/lighting-app/infineon/psoc6/README.md b/examples/lighting-app/infineon/psoc6/README.md index 773a05af1f..853000547c 100644 --- a/examples/lighting-app/infineon/psoc6/README.md +++ b/examples/lighting-app/infineon/psoc6/README.md @@ -138,4 +138,4 @@ commands. These power cycle the BlueTooth hardware and disable BR/EDR mode. For the description of Software Update process with infineon PSoC6 example applications see -[Infineon PSoC6 OTA Software Update](../../../../docs/guides/infineon_psoc6_software_update.md) +[Infineon PSoC6 OTA Software Update](../../../../docs/platforms/infineon/infineon_psoc6_software_update.md) diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 011d11fc33..769d929e58 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2956,7 +2957,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index b04b233712..e714f74af1 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -4500,7 +4500,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/linux/README.md b/examples/lighting-app/linux/README.md index e41799a70d..b5c3d2a53b 100644 --- a/examples/lighting-app/linux/README.md +++ b/examples/lighting-app/linux/README.md @@ -7,7 +7,7 @@ Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/lighting-app/mbed/README.md b/examples/lighting-app/mbed/README.md index 0eafd74a5e..d96ee5281d 100644 --- a/examples/lighting-app/mbed/README.md +++ b/examples/lighting-app/mbed/README.md @@ -240,7 +240,8 @@ terminal. #### CHIP Tools -Read the [MbedCommissioning](../../../docs/guides/mbedos_commissioning.md) to +Read the +[MbedCommissioning](../../../docs/platforms/mbedos/mbedos_commissioning.md) to see how to use different CHIP tools to commission and control the application within a WiFi network. @@ -314,7 +315,7 @@ The example supports building and running on the following mbed-enabled devices: - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `lighting-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/lighting-app/nrfconnect/README.md b/examples/lighting-app/nrfconnect/README.md index 3ba3c74f56..62e4954d7b 100644 --- a/examples/lighting-app/nrfconnect/README.md +++ b/examples/lighting-app/nrfconnect/README.md @@ -44,7 +44,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -267,7 +267,7 @@ opposite one. **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -496,7 +496,7 @@ depending on the selected board: DFU enabled by default. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -535,19 +535,20 @@ to read more about flashing on the nRF52840 Dongle. ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread network. @@ -555,8 +556,8 @@ Matter-enabled Thread network. ### Testing Device Firmware Upgrade Read the -[DFU tutorial](../../../docs/guides/nrfconnect_examples_software_update.md) to -see how to upgrade your device firmware. +[DFU tutorial](../../../docs/platforms/nrf/nrfconnect_examples_software_update.md) +to see how to upgrade your device firmware. ## Testing using the RPC console diff --git a/examples/lighting-app/nxp/README.md b/examples/lighting-app/nxp/README.md index d611b24c8d..e0860a021e 100644 --- a/examples/lighting-app/nxp/README.md +++ b/examples/lighting-app/nxp/README.md @@ -131,7 +131,7 @@ corresponding to data model target. Use `chip_with_factory_data=1` in the gn build command to enable factory data. For a full guide on manufacturing flow, please see -[Guide for writing manufacturing data on NXP devices](../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../docs/platforms/nxp/nxp_manufacturing_flow.md). ## Flashing and debugging diff --git a/examples/lighting-app/nxp/k32w0/README.md b/examples/lighting-app/nxp/k32w0/README.md index 518e0232a4..61f35a3e71 100644 --- a/examples/lighting-app/nxp/k32w0/README.md +++ b/examples/lighting-app/nxp/k32w0/README.md @@ -328,7 +328,7 @@ Please use the following build args: ## Manufacturing data See -[Guide for writing manufacturing data on NXP devices](../../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../../docs/platforms/nxp/nxp_manufacturing_flow.md). There are factory data generated binaries available in `third_party/nxp/nxp_matter_support/examples/platform/k32w0/scripts/demo_generated_factory_data` @@ -595,7 +595,7 @@ internal flash space can be found in the The steps for building the SSBL binary with appropriate configuration and writing to the board the binary and other OTA related configurations are described in the -[K32W0x1 OTA guide](../../../../docs/guides/nxp/nxp_k32w0_ota_guide.md). +[K32W0x1 OTA guide](../../../../docs/platforms/nxp/nxp_k32w0_ota_guide.md). Note that the application needs to be built using the `chip_enable_ota_requestor=true` option. This is enabled in the configuration by diff --git a/examples/lighting-app/nxp/k32w1/README.md b/examples/lighting-app/nxp/k32w1/README.md index d61ab1e424..61cec8077c 100644 --- a/examples/lighting-app/nxp/k32w1/README.md +++ b/examples/lighting-app/nxp/k32w1/README.md @@ -109,7 +109,7 @@ this feature, compile the application with: `chip_config_dimmable_led=true` If the feature is enabled, the LED brightness can be controlled using `LevelControl` cluster -[commands](../../../../docs/guides/chip_tool_guide.md#step-7-control-application-data-model-clusters). +[commands](../../../../docs/development_controllers/chip-tool/chip_tool_guide.md#step-7-control-application-data-model-clusters). ## Flashing @@ -235,4 +235,4 @@ To reboot the device, please run `rpcs.chip.rpc.Device.Reboot()`. ## OTA Please see -[k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[k32w1 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/lighting-app/nxp/linux-imx/imx8m/README.md b/examples/lighting-app/nxp/linux-imx/imx8m/README.md index e20ff1065d..01941f58e7 100644 --- a/examples/lighting-app/nxp/linux-imx/imx8m/README.md +++ b/examples/lighting-app/nxp/linux-imx/imx8m/README.md @@ -1,4 +1,4 @@ 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/nxp_imx8m_linux_examples.md) +[README document](../../../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details. diff --git a/examples/lighting-app/nxp/mcxw71/README.md b/examples/lighting-app/nxp/mcxw71/README.md index 116fd6183e..3cded8b8be 100644 --- a/examples/lighting-app/nxp/mcxw71/README.md +++ b/examples/lighting-app/nxp/mcxw71/README.md @@ -109,7 +109,7 @@ this feature, compile the application with: `chip_config_dimmable_led=true` If the feature is enabled, the LED brightness can be controlled using `LevelControl` cluster -[commands](../../../../docs/guides/chip_tool_guide.md#step-7-control-application-data-model-clusters). +[commands](../../../../docs/development_controllers/chip-tool/chip_tool_guide.md#step-7-control-application-data-model-clusters). ## Flashing @@ -267,4 +267,4 @@ To reboot the device, please run `rpcs.chip.rpc.Device.Reboot()`. ## OTA Please see -[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[mcxw71 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 99a3c51c41..c80d7cfa19 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2136,7 +2137,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 6d5d8fd8cb..f8293b8cfc 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -3637,7 +3637,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index a352d37dbb..fbefaabad5 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2630,7 +2631,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index f4b4c6f1bf..b744892b3b 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -4770,7 +4770,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/silabs/README.md b/examples/lighting-app/silabs/README.md index 606208a387..7052d4f712 100644 --- a/examples/lighting-app/silabs/README.md +++ b/examples/lighting-app/silabs/README.md @@ -200,7 +200,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -331,7 +331,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Group Communication (Multicast) 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 52285ea3b4..cae4c83018 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1013,6 +1013,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2587,7 +2588,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; 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 2644717a84..62cc5c49eb 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -3803,7 +3803,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, 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 6fb823728b..33e7614604 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1272,6 +1272,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2859,7 +2860,7 @@ endpoint 1 { } server cluster LevelControl { - persist attribute currentLevel default = 0x01; + persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; ram attribute minLevel default = 0x01; ram attribute maxLevel default = 0xFE; 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 086261b9e0..94397579a0 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -3288,7 +3288,7 @@ "storageOption": "NVM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0xFE", "reportable": 1, "minInterval": 0, "maxInterval": 65344, diff --git a/examples/lighting-app/stm32/README.md b/examples/lighting-app/stm32/README.md index 26a6051d1a..d69df7d277 100644 --- a/examples/lighting-app/stm32/README.md +++ b/examples/lighting-app/stm32/README.md @@ -14,7 +14,7 @@ This example demonstrates the Matter Lighting application on stm32 platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/stm32_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/stm32/stm32_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp index 36c0f19c35..5484c7daff 100644 --- a/examples/lighting-app/tizen/src/DBusInterface.cpp +++ b/examples/lighting-app/tizen/src/DBusInterface.cpp @@ -42,9 +42,12 @@ class CommandHandlerImplCallback : public CommandHandlerImpl::Callback { public: using Status = Protocols::InteractionModel::Status; - void OnDone(CommandHandlerImpl & apCommandObj) {} - void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) {} - Status CommandExists(const ConcreteCommandPath & aCommandPath) { return Status::Success; } + + void OnDone(CommandHandlerImpl & apCommandObj) override {} + void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, + TLV::TLVReader & apPayload) override + {} + Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override { return Status::Success; } }; DBusInterface::DBusInterface(chip::EndpointId endpointId) : mEndpointId(endpointId) diff --git a/examples/lit-icd-app/esp32/README.md b/examples/lit-icd-app/esp32/README.md index 405f208bc5..9f36e17f82 100644 --- a/examples/lit-icd-app/esp32/README.md +++ b/examples/lit-icd-app/esp32/README.md @@ -3,9 +3,9 @@ This example is meant to represent a power-save application. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. **Note**: Currently only Thread devices can run this example. diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 2d3430c8d9..e67ae7524b 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -765,6 +765,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lit-icd-app/nrfconnect/README.md b/examples/lit-icd-app/nrfconnect/README.md index ff0f6b6699..81503f9e13 100644 --- a/examples/lit-icd-app/nrfconnect/README.md +++ b/examples/lit-icd-app/nrfconnect/README.md @@ -42,7 +42,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -183,7 +183,7 @@ procedure. **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -376,7 +376,7 @@ depending on the selected board: the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -400,17 +400,18 @@ directory: ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing Device Firmware Upgrade Read the -[DFU tutorial](../../../docs/guides/nrfconnect_examples_software_update.md) to -see how to upgrade your device firmware. +[DFU tutorial](../../../docs/platforms/nrf/nrfconnect_examples_software_update.md) +to see how to upgrade your device firmware. diff --git a/examples/lit-icd-app/silabs/README.md b/examples/lit-icd-app/silabs/README.md index a38944bad5..4d1dee045c 100644 --- a/examples/lit-icd-app/silabs/README.md +++ b/examples/lit-icd-app/silabs/README.md @@ -202,7 +202,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -317,7 +317,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options diff --git a/examples/lock-app/asr/README.md b/examples/lock-app/asr/README.md index 1da71f5800..e81db2a331 100755 --- a/examples/lock-app/asr/README.md +++ b/examples/lock-app/asr/README.md @@ -17,7 +17,7 @@ reference for creating your own application. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/lock-app/esp32/README.md b/examples/lock-app/esp32/README.md index f7f020ed10..119450658c 100644 --- a/examples/lock-app/esp32/README.md +++ b/examples/lock-app/esp32/README.md @@ -3,16 +3,16 @@ This example demonstrates the mapping of OnOff cluster to lock/unlock logic. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- - [Cluster control](#cluster-control) - [Example Demo](#example-demo) -- [RPC console and Device Tracing](../../../docs/guides/esp32/rpc_console.md) +- [RPC console and Device Tracing](../../../docs/platforms/esp32/rpc_console.md) --- diff --git a/examples/lock-app/genio/README.md b/examples/lock-app/genio/README.md index 7c4582f707..051f6fa4f2 100644 --- a/examples/lock-app/genio/README.md +++ b/examples/lock-app/genio/README.md @@ -86,7 +86,7 @@ MediaTek platform. Chip tool standalone, Android or iOS app [CHIP - Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) + Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md) Here is an example with the CHIP Tool controller: diff --git a/examples/lock-app/infineon/cyw30739/README.md b/examples/lock-app/infineon/cyw30739/README.md index 0c9b769b66..c02d3a6c05 100644 --- a/examples/lock-app/infineon/cyw30739/README.md +++ b/examples/lock-app/infineon/cyw30739/README.md @@ -212,7 +212,7 @@ Put the CYW30739 in to the recovery mode before running the flash script. - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. - You can provision and control the device using the Python controller REPL, diff --git a/examples/lock-app/infineon/psoc6/README.md b/examples/lock-app/infineon/psoc6/README.md index 0c8e8eb1e8..657b038af9 100644 --- a/examples/lock-app/infineon/psoc6/README.md +++ b/examples/lock-app/infineon/psoc6/README.md @@ -175,7 +175,7 @@ cloud, giving every IoT device its own unique identity. For the description of OPTIGA™ Trust M Provisioning with test DAC generation and PAI and CD storage, please refer to -[Infineon OPTIGA™ Trust M Provisioning](../../../../docs/guides/infineon_trustm_provisioning.md) +[Infineon OPTIGA™ Trust M Provisioning](../../../../docs/platforms/infineon/infineon_trustm_provisioning.md) After completing OPTIGA™ Trust M Provisioning, proceed to [Flashing the Application](#flashing-the-application) section to continue with @@ -185,4 +185,4 @@ subsequent steps. For the description of Software Update process with infineon PSoC6 example applications see -[Infineon PSoC6 OTA Software Update](../../../../docs/guides/infineon_psoc6_software_update.md) +[Infineon PSoC6 OTA Software Update](../../../../docs/platforms/infineon/infineon_psoc6_software_update.md) diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 5e9c4080af..94c2fcf3bb 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1024,6 +1024,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/mbed/README.md b/examples/lock-app/mbed/README.md index 27eb422246..1a8c34d1db 100644 --- a/examples/lock-app/mbed/README.md +++ b/examples/lock-app/mbed/README.md @@ -224,7 +224,8 @@ terminal. #### CHIP Tools -Read the [MbedCommissioning](../../../docs/guides/mbedos_commissioning.md) to +Read the +[MbedCommissioning](../../../docs/platforms/mbedos/mbedos_commissioning.md) to see how to use different CHIP tools to commission and control the application within a WiFi network. @@ -288,7 +289,7 @@ The example supports building and running on the following mbed-enabled devices: - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `lock-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/lock-app/nrfconnect/README.md b/examples/lock-app/nrfconnect/README.md index 14385357bc..0a0743abd4 100644 --- a/examples/lock-app/nrfconnect/README.md +++ b/examples/lock-app/nrfconnect/README.md @@ -44,7 +44,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. By default, the Matter accessory device has IPv6 networking disabled. You must @@ -255,7 +255,7 @@ opposite one. **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -454,7 +454,7 @@ depending on the selected board: the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -478,20 +478,21 @@ directory: ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread or Wi-Fi network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread or Wi-Fi network. @@ -499,5 +500,5 @@ Matter-enabled Thread or Wi-Fi network. ### Testing Device Firmware Upgrade Read the -[DFU tutorial](../../../docs/guides/nrfconnect_examples_software_update.md) to -see how to upgrade your device firmware. +[DFU tutorial](../../../docs/platforms/nrf/nrfconnect_examples_software_update.md) +to see how to upgrade your device firmware. diff --git a/examples/lock-app/nxp/README.md b/examples/lock-app/nxp/README.md index c3cf4c112f..a758ef50d7 100644 --- a/examples/lock-app/nxp/README.md +++ b/examples/lock-app/nxp/README.md @@ -126,7 +126,7 @@ corresponding to data model target. Use `chip_with_factory_data=1` in the gn build command to enable factory data. For a full guide on manufacturing flow, please see -[Guide for writing manufacturing data on NXP devices](../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../docs/platforms/nxp/nxp_manufacturing_flow.md). ## Flashing and debugging diff --git a/examples/lock-app/nxp/k32w1/README.md b/examples/lock-app/nxp/k32w1/README.md index a085d94afd..88041b86e4 100644 --- a/examples/lock-app/nxp/k32w1/README.md +++ b/examples/lock-app/nxp/k32w1/README.md @@ -163,7 +163,7 @@ Run -> Debug Configurations... -> C/C++ Application ## OTA Please see -[k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[k32w1 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). ## Multiple BLE connections diff --git a/examples/lock-app/nxp/mcxw71/README.md b/examples/lock-app/nxp/mcxw71/README.md index db877d0c00..92e177d0e3 100644 --- a/examples/lock-app/nxp/mcxw71/README.md +++ b/examples/lock-app/nxp/mcxw71/README.md @@ -195,7 +195,7 @@ Run -> Debug Configurations... -> C/C++ Application ## OTA Please see -[mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). +[mcxw71 OTA guide](../../../../docs/platforms/nxp/nxp_mcxw71_ota_guide.md). ## Multiple BLE connections diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index c975e2b7c1..fc3a8917b2 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -756,6 +756,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/openiotsdk/README.md b/examples/lock-app/openiotsdk/README.md index 69e569b9be..f81f2ad9fc 100644 --- a/examples/lock-app/openiotsdk/README.md +++ b/examples/lock-app/openiotsdk/README.md @@ -10,7 +10,7 @@ existing Matter network and can be controlled by it. For information on how to build, run, test and debug this example and further information about the platform it is run on see -[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). +[Open IoT SDK examples](../../../docs/platforms/openiotsdk/openiotsdk_examples.md). The example name to use in the scripts is `lock-app`. @@ -30,7 +30,7 @@ in the terminal. ### Commissioning Read the -[Open IoT SDK commissioning guide](../../../docs/guides/openiotsdk_commissioning.md) +[Open IoT SDK commissioning guide](../../../docs/platforms/openiotsdk/openiotsdk_commissioning.md) to see how to use the Matter controller to commission and control the application. diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 0c408680b1..53bf1d4f8d 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -816,6 +816,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/lock-app/silabs/README.md b/examples/lock-app/silabs/README.md index 4a16af08c0..7b4f7fdbdf 100644 --- a/examples/lock-app/silabs/README.md +++ b/examples/lock-app/silabs/README.md @@ -223,7 +223,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -367,7 +367,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options diff --git a/examples/lock-app/silabs/data_model/lock-app.matter b/examples/lock-app/silabs/data_model/lock-app.matter index 9902b87beb..bf8c297e1c 100644 --- a/examples/lock-app/silabs/data_model/lock-app.matter +++ b/examples/lock-app/silabs/data_model/lock-app.matter @@ -1024,6 +1024,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 3da4e2a7ec..e5f6ee1007 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 @@ -405,6 +405,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index f9ee0e90dd..f22729df88 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -629,6 +629,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index e3b0fb9de3..5d53e15732 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -535,6 +535,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/ota-provider-app/esp32/README.md b/examples/ota-provider-app/esp32/README.md index 2102aabd1a..7717aa1a88 100644 --- a/examples/ota-provider-app/esp32/README.md +++ b/examples/ota-provider-app/esp32/README.md @@ -3,7 +3,7 @@ A prototype application that demonstrates OTA provider capabilities. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) --- @@ -16,7 +16,7 @@ Please ### Building and Commissioning Generate the OTA image as described -[here](../../../docs/guides/esp32/ota.md#generate-chip-ota-image) +[here](../../../docs/platforms/esp32/ota.md#generate-chip-ota-image) #### Configure OTA image to serve @@ -36,7 +36,7 @@ Generate the OTA image as described terminator. Follow -[ESP32 Application Usage Guide](../../../docs/guides/esp32/build_app_and_commission.md) +[ESP32 Application Usage Guide](../../../docs/platforms/esp32/build_app_and_commission.md) to Build, Flash, Monitor, and Commission the device. Once device is commissioned successfully, then please try below steps. diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp index 381d3b43f7..d93a61dfbd 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp @@ -61,7 +61,7 @@ constexpr uint32_t kBdxServerPollIntervalMillis = 50; void GetUpdateTokenString(const chip::ByteSpan & token, char * buf, size_t bufSize) { const uint8_t * tokenData = static_cast(token.data()); - size_t minLength = chip::min(token.size(), bufSize); + size_t minLength = std::min(token.size(), bufSize); for (size_t i = 0; i < (minLength / 2) - 1; ++i) { snprintf(&buf[i * 2], bufSize, "%02X", tokenData[i]); 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 a8773f83d1..7538f304f3 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 @@ -736,6 +736,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/ota-requestor-app/asr/README.md b/examples/ota-requestor-app/asr/README.md index 7af3c25e92..d2cb6c8ff7 100755 --- a/examples/ota-requestor-app/asr/README.md +++ b/examples/ota-requestor-app/asr/README.md @@ -13,7 +13,7 @@ This example demonstrates the Matter OTA Requestor application on ASR platform. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/ota-requestor-app/esp32/README.md b/examples/ota-requestor-app/esp32/README.md index 1951b4535b..0f8972db50 100644 --- a/examples/ota-requestor-app/esp32/README.md +++ b/examples/ota-requestor-app/esp32/README.md @@ -3,9 +3,9 @@ A prototype application that demonstrates OTA Requestor capabilities. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- @@ -13,7 +13,7 @@ guides to get started. - [Prerequisite](#prerequisite) - [Query for an OTA Image](#query-for-an-ota-image) - [ESP32 OTA Requestor with Linux OTA Provider](#esp32-ota-requestor-with-linux-ota-provider) -- [RPC console and Device Tracing](../../../docs/guides/esp32/rpc_console.md) +- [RPC console and Device Tracing](../../../docs/platforms/esp32/rpc_console.md) --- diff --git a/examples/ota-requestor-app/genio/README.md b/examples/ota-requestor-app/genio/README.md index e8675adc62..487056c08f 100644 --- a/examples/ota-requestor-app/genio/README.md +++ b/examples/ota-requestor-app/genio/README.md @@ -86,7 +86,7 @@ MediaTek platform. Chip tool standalone, Android or iOS app [CHIP - Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) + Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md) Here is an example with the CHIP Tool controller: diff --git a/examples/ota-requestor-app/mbed/README.md b/examples/ota-requestor-app/mbed/README.md index 6f8bcdaf53..0de672921c 100644 --- a/examples/ota-requestor-app/mbed/README.md +++ b/examples/ota-requestor-app/mbed/README.md @@ -231,7 +231,8 @@ in the terminal. #### CHIP Tools -Read the [MbedCommissioning](../../../docs/guides/mbedos_commissioning.md) to +Read the +[MbedCommissioning](../../../docs/platforms/mbedos/mbedos_commissioning.md) to see how to use different CHIP tools to commission and control the application within a WiFi network. @@ -266,7 +267,7 @@ The example supports building and running on the following mbed-enabled devices: - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `ota-requestor-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/ota-requestor-app/openiotsdk/README.md b/examples/ota-requestor-app/openiotsdk/README.md index d9a98c44d3..042c30d17f 100644 --- a/examples/ota-requestor-app/openiotsdk/README.md +++ b/examples/ota-requestor-app/openiotsdk/README.md @@ -9,8 +9,8 @@ file and apply it. The application is configured to support: -- [TF-M](../../../docs/guides/openiotsdk_examples.md#trusted-firmware-m) -- [Device Firmware Update](../../../docs/guides/openiotsdk_examples.md#device-firmware-update) +- [TF-M](../../../docs/platforms/openiotsdk/openiotsdk_examples.md#trusted-firmware-m) +- [Device Firmware Update](../../../docs/platforms/openiotsdk/openiotsdk_examples.md#device-firmware-update) The example behaves as a Matter accessory, device that can be paired into an existing Matter network and can be controlled by it. @@ -19,7 +19,7 @@ existing Matter network and can be controlled by it. For information on how to build, run, test and debug this example and further information about the platform it is run on see -[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). +[Open IoT SDK examples](../../../docs/platforms/openiotsdk/openiotsdk_examples.md). The example name to use in the scripts is `ota-requestor-app`. @@ -39,14 +39,14 @@ follow traces in the terminal. ### Commissioning Read the -[Open IoT SDK commissioning guide](../../../docs/guides/openiotsdk_commissioning.md) +[Open IoT SDK commissioning guide](../../../docs/platforms/openiotsdk/openiotsdk_commissioning.md) to see how to use the Matter controller to commission and control the application. ### Device Firmware Upgrade Read the -[Matter Open IoT SDK Example Device Firmware Upgrade](../../../docs/guides/openiotsdk_examples_software_update.md) +[Matter Open IoT SDK Example Device Firmware Upgrade](../../../docs/platforms/openiotsdk/openiotsdk_examples_software_update.md) to see how to use Matter OTA for firmware update. ### OtaSoftwareUpdateRequestor cluster usage @@ -78,4 +78,4 @@ downloading the update image. If this step is completed, a new image will be installed and the application will be reboot. More details about device firmware update over Matter can be found -[here](../../../docs/guides/openiotsdk_examples_software_update.md). +[here](../../../docs/platforms/openiotsdk/openiotsdk_examples_software_update.md). 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 2ab9918446..b7514cf573 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 @@ -888,6 +888,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/persistent-storage/esp32/README.md b/examples/persistent-storage/esp32/README.md index d87b894060..e6820508df 100644 --- a/examples/persistent-storage/esp32/README.md +++ b/examples/persistent-storage/esp32/README.md @@ -3,9 +3,9 @@ An example testing and demonstrating the key value storage API. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- diff --git a/examples/pigweed-app/esp32/README.md b/examples/pigweed-app/esp32/README.md index 8044faebd1..ebd63eda45 100644 --- a/examples/pigweed-app/esp32/README.md +++ b/examples/pigweed-app/esp32/README.md @@ -1,9 +1,9 @@ # CHIP ESP32 Pigweed Example Application Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- diff --git a/examples/pigweed-app/mbed/README.md b/examples/pigweed-app/mbed/README.md index 8ca7aca3c2..3932e4f961 100644 --- a/examples/pigweed-app/mbed/README.md +++ b/examples/pigweed-app/mbed/README.md @@ -249,7 +249,7 @@ The example supports building and running on the following mbed-enabled devices: - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `pigweed-app/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 79d17e5306..30f9ca883b 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1672,6 +1672,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1763,6 +1764,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 467aed8bac..d8ced986c7 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1629,6 +1629,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1720,6 +1721,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/platform/nrfconnect/util/PWMDevice.cpp b/examples/platform/nrfconnect/util/PWMDevice.cpp index d0a77ab63f..67836224ce 100644 --- a/examples/platform/nrfconnect/util/PWMDevice.cpp +++ b/examples/platform/nrfconnect/util/PWMDevice.cpp @@ -18,6 +18,8 @@ #include "PWMDevice.h" +#include + #include "AppConfig.h" #include @@ -129,7 +131,7 @@ void PWMDevice::SuppressOutput() void PWMDevice::ApplyLevel() { const uint8_t maxEffectiveLevel = mMaxLevel - mMinLevel; - const uint8_t effectiveLevel = mState == kState_On ? chip::min(mLevel - mMinLevel, maxEffectiveLevel) : 0; + const uint8_t effectiveLevel = mState == kState_On ? std::min(mLevel - mMinLevel, maxEffectiveLevel) : 0; pwm_set_pulse_dt(mPwmDevice, static_cast(static_cast(mPwmDevice->period) * effectiveLevel / maxEffectiveLevel)); diff --git a/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp b/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp index 3b03b413ec..ce036dbd75 100644 --- a/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp +++ b/examples/platform/nxp/common/matter_button/source/ButtonApp.cpp @@ -24,11 +24,30 @@ extern "C" { #include "board_comp.h" } +/** + * @brief Flag to describe if the button handles are predefined in SDK. + * + * Set to true by default. Platforms that do not have this support should + * disable the flag, which will enable handle definition in this file. + */ +#ifndef CONFIG_APP_BUTTON_HANDLE_SDK_PREDEFINED +#define CONFIG_APP_BUTTON_HANDLE_SDK_PREDEFINED 1 +#endif + +#if !CONFIG_APP_BUTTON_HANDLE_SDK_PREDEFINED +BUTTON_HANDLE_ARRAY_DEFINE(g_buttonHandle, gAppButtonCnt_c); +#endif + CHIP_ERROR chip::NXP::App::ButtonApp::Init() { - // Button is initialized in otSysInit, when APP_InitServices is called. - // Overwrite the handle to reference the SDK handle. +#if CONFIG_APP_BUTTON_HANDLE_SDK_PREDEFINED + // Button is defined in the SDK and initialized in otSysInit, when APP_InitServices is called. handle = &g_buttonHandle[1]; +#else + // Button handle is defined in this file and it should be initialized here. + handle = &g_buttonHandle[0]; + BOARD_InitButton0(handle); +#endif return CHIP_NO_ERROR; } @@ -48,7 +67,14 @@ void chip::NXP::App::ButtonApp::HandleShortPress() void chip::NXP::App::ButtonApp::HandleLongPress() { - chip::DeviceLayer::PlatformMgrImpl().CleanReset(); + // Execute "clean" reset + chip::DeviceLayer::PlatformMgr().ScheduleWork( + [](intptr_t arg) { + chip::DeviceLayer::PlatformMgr().StopEventLoopTask(); + chip::DeviceLayer::PlatformMgr().Shutdown(); + chip::DeviceLayer::PlatformMgrImpl().Reset(); + }, + (intptr_t) nullptr); } void chip::NXP::App::ButtonApp::HandleDoubleClick() diff --git a/examples/platform/nxp/common/matter_button/source/ButtonManager.cpp b/examples/platform/nxp/common/matter_button/source/ButtonManager.cpp index 046337397a..7aa9866edf 100644 --- a/examples/platform/nxp/common/matter_button/source/ButtonManager.cpp +++ b/examples/platform/nxp/common/matter_button/source/ButtonManager.cpp @@ -17,7 +17,10 @@ */ #include "ButtonManager.h" + +extern "C" { #include "fwk_platform.h" +} #include #include diff --git a/examples/platform/nxp/common/matter_button/source/ButtonRegistrationAppAndBle.cpp b/examples/platform/nxp/common/matter_button/source/ButtonRegistrationAppAndBle.cpp index 45037b268f..b16bc1ff5c 100644 --- a/examples/platform/nxp/common/matter_button/source/ButtonRegistrationAppAndBle.cpp +++ b/examples/platform/nxp/common/matter_button/source/ButtonRegistrationAppAndBle.cpp @@ -24,14 +24,37 @@ #include -static chip::NXP::App::ButtonApp sAppButton; -static chip::NXP::App::ButtonBle sBleButton; +/** + * @brief Flag to configure if the app button is enabled. + * + * Enabled by default. + */ +#ifndef CONFIG_APP_BUTTON_ENABLED +#define CONFIG_APP_BUTTON_ENABLED 1 +#endif + +/** + * @brief Flag to configure if the BLE button is enabled. + * + * Enabled by default. + */ +#ifndef CONFIG_BLE_BUTTON_ENABLED +#define CONFIG_BLE_BUTTON_ENABLED 1 +#endif CHIP_ERROR chip::NXP::App::RegisterButtons(void) { ReturnErrorOnFailure(ButtonMgr().Init()); + +#if CONFIG_BLE_BUTTON_ENABLED + static chip::NXP::App::ButtonBle sBleButton; ReturnErrorOnFailure(ButtonMgr().RegisterButton(sBleButton)); +#endif + +#if CONFIG_APP_BUTTON_ENABLED + static chip::NXP::App::ButtonApp sAppButton; ReturnErrorOnFailure(ButtonMgr().RegisterButton(sAppButton)); +#endif return CHIP_NO_ERROR; } diff --git a/examples/platform/qpg/project_include/OpenThreadConfig.h b/examples/platform/qpg/project_include/OpenThreadConfig.h index d6955a90a5..a5dd275eb1 100644 --- a/examples/platform/qpg/project_include/OpenThreadConfig.h +++ b/examples/platform/qpg/project_include/OpenThreadConfig.h @@ -80,6 +80,8 @@ #define OPENTHREAD_EXAMPLES_SIMULATION 0 #define OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE 0 +#define OPENTHREAD_PLATFORM_NEXUS 0 + // Use the Qorvo-supplied default platform configuration for remainder // of OpenThread config options. // diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index 37efb09fe5..b7ce3e9fed 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -259,7 +259,7 @@ CHIP_ERROR BaseApplication::Init() ChipLogProgress(AppServer, "APP: Wait WiFi Init"); while (!wfx_hw_ready()) { - vTaskDelay(pdMS_TO_TICKS(10)); + osDelay(pdMS_TO_TICKS(10)); } ChipLogProgress(AppServer, "APP: Done WiFi Init"); /* We will init server when we get IP */ diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp index c65a97ea3a..622d8edafb 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp @@ -97,10 +97,6 @@ bool ps_requirement_added = false; // TODO: Figure out why we actually need this, we are already handling failure and retries somewhere else. #define WIFI_SCAN_TIMEOUT_TICK 10000 -#if !defined(MIN) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#endif - WfxRsi_t wfx_rsi; bool hasNotifiedIPV6 = false; @@ -544,12 +540,12 @@ sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result) memset(&cur_scan_result, 0, sizeof(cur_scan_result)); cur_scan_result.ssid_length = strnlen((char *) scan_result->scan_info[idx].ssid, - chip::min(sizeof(scan_result->scan_info[idx].ssid), WFX_MAX_SSID_LENGTH)); + std::min(sizeof(scan_result->scan_info[idx].ssid), WFX_MAX_SSID_LENGTH)); chip::Platform::CopyString(cur_scan_result.ssid, cur_scan_result.ssid_length, (char *) scan_result->scan_info[idx].ssid); // if user has provided ssid, then check if the current scan result ssid matches the user provided ssid if (wfx_rsi.scan_ssid != NULL && - (strncmp(wfx_rsi.scan_ssid, cur_scan_result.ssid, MIN(strlen(wfx_rsi.scan_ssid), strlen(cur_scan_result.ssid))) == + (strncmp(wfx_rsi.scan_ssid, cur_scan_result.ssid, std::min(strlen(wfx_rsi.scan_ssid), strlen(cur_scan_result.ssid))) == CMP_SUCCESS)) { continue; diff --git a/examples/platform/silabs/SoftwareFaultReports.cpp b/examples/platform/silabs/SoftwareFaultReports.cpp index e656717b88..977f3df20e 100644 --- a/examples/platform/silabs/SoftwareFaultReports.cpp +++ b/examples/platform/silabs/SoftwareFaultReports.cpp @@ -17,10 +17,10 @@ */ #include "SoftwareFaultReports.h" -#include "FreeRTOS.h" #include "silabs_utils.h" #include #include +#include #include #include #include @@ -75,7 +75,7 @@ void OnSoftwareFaultEventHandler(const char * faultRecordString) // Allow some time for the Fault event to be sent as the next action after exiting this function // is typically an assert or reboot. // Depending on the task at fault, it is possible the event can't be transmitted. - vTaskDelay(pdMS_TO_TICKS(1000)); + osDelay(pdMS_TO_TICKS(1000)); #endif // MATTER_DM_PLUGIN_SOFTWARE_DIAGNOSTICS_SERVER } diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp index 02500c80f7..4e9c40974c 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.cpp +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.cpp @@ -752,7 +752,7 @@ void ProcessEvent(WfxEvent_t inEvent) // clear structure and calculate size of SSID memset(&ap, 0, sizeof(ap)); ap.ssid_length = - strnlen(reinterpret_cast(scan->ssid), chip::min(sizeof(scan->ssid), WFX_MAX_SSID_LENGTH)); + strnlen(reinterpret_cast(scan->ssid), std::min(sizeof(scan->ssid), WFX_MAX_SSID_LENGTH)); chip::Platform::CopyString(ap.ssid, ap.ssid_length, reinterpret_cast(scan->ssid)); // check if the scanned ssid is the one we are looking for diff --git a/examples/platform/silabs/efr32/wf200/host_if.cpp b/examples/platform/silabs/efr32/wf200/host_if.cpp index 044ecc6e97..516abca22b 100644 --- a/examples/platform/silabs/efr32/wf200/host_if.cpp +++ b/examples/platform/silabs/efr32/wf200/host_if.cpp @@ -736,7 +736,7 @@ int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap) { int32_t signal_strength; - ap->ssid_length = strnlen(ap_info.ssid, chip::min(sizeof(ap_info.ssid), WFX_MAX_SSID_LENGTH)); + ap->ssid_length = strnlen(ap_info.ssid, std::min(sizeof(ap_info.ssid), WFX_MAX_SSID_LENGTH)); chip::Platform::CopyString(ap->ssid, ap->ssid_length, ap_info.ssid); memcpy(ap->bssid, ap_info.bssid, sizeof(ap_info.bssid)); ap->security = ap_info.security; diff --git a/examples/platform/silabs/uart.cpp b/examples/platform/silabs/uart.cpp index a43a23fa2c..1af3cb75d9 100644 --- a/examples/platform/silabs/uart.cpp +++ b/examples/platform/silabs/uart.cpp @@ -65,10 +65,6 @@ extern "C" { #include "sl_power_manager.h" #endif -#if !defined(MIN) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#endif - #ifdef SL_CATALOG_UARTDRV_EUSART_PRESENT #define HELPER1(x) EUSART##x##_RX_IRQn #else @@ -278,7 +274,7 @@ static uint16_t RetrieveFromFifo(Fifo_t * fifo, uint8_t * pData, uint16_t SizeTo VerifyOrDie(pData != nullptr); VerifyOrDie(SizeToRead <= fifo->MaxSize); - uint16_t ReadSize = MIN(SizeToRead, AvailableDataCount(fifo)); + uint16_t ReadSize = std::min(SizeToRead, AvailableDataCount(fifo)); uint16_t nBytesBeforWrap = (fifo->MaxSize - fifo->Head); if (ReadSize > nBytesBeforWrap) diff --git a/examples/platform/silabs/wifi/wfx_rsi_host.cpp b/examples/platform/silabs/wifi/wfx_rsi_host.cpp index 130d9c90d1..d76bc9c795 100644 --- a/examples/platform/silabs/wifi/wfx_rsi_host.cpp +++ b/examples/platform/silabs/wifi/wfx_rsi_host.cpp @@ -369,7 +369,7 @@ bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *)) wfx_rsi.scan_cb = callback; VerifyOrReturnError(ssid != nullptr, false); - wfx_rsi.scan_ssid_length = strnlen(ssid, chip::min(sizeof(ssid), WFX_MAX_SSID_LENGTH)); + wfx_rsi.scan_ssid_length = strnlen(ssid, std::min(sizeof(ssid), WFX_MAX_SSID_LENGTH)); wfx_rsi.scan_ssid = reinterpret_cast(chip::Platform::MemoryAlloc(wfx_rsi.scan_ssid_length)); VerifyOrReturnError(wfx_rsi.scan_ssid != nullptr, false); chip::Platform::CopyString(wfx_rsi.scan_ssid, wfx_rsi.scan_ssid_length, ssid); diff --git a/examples/pump-app/nrfconnect/README.md b/examples/pump-app/nrfconnect/README.md index 16fbc2f014..98d3e1518b 100644 --- a/examples/pump-app/nrfconnect/README.md +++ b/examples/pump-app/nrfconnect/README.md @@ -42,7 +42,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. The Matter device that runs the pump application is controlled by the Matter @@ -213,7 +213,7 @@ by default). **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -415,7 +415,7 @@ depending on the selected board: the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -439,19 +439,20 @@ directory: ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread network. diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index fc30273ac0..d4ac8e35a3 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-app/silabs/README.md b/examples/pump-app/silabs/README.md index 7bde704c4a..70d83e4de5 100644 --- a/examples/pump-app/silabs/README.md +++ b/examples/pump-app/silabs/README.md @@ -197,7 +197,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -307,7 +307,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Group Communication (Multicast) 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 c45e6dcfb8..7d730d759c 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; 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 c45e6dcfb8..7d730d759c 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -957,6 +957,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/pump-controller-app/nrfconnect/README.md b/examples/pump-controller-app/nrfconnect/README.md index 64f37c4bb6..b492c3ec38 100644 --- a/examples/pump-controller-app/nrfconnect/README.md +++ b/examples/pump-controller-app/nrfconnect/README.md @@ -43,7 +43,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit CHIP's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. The Matter device that runs the pump application is controlled by the Matter @@ -214,7 +214,7 @@ by default). **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -415,7 +415,7 @@ depending on the selected board: the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -439,19 +439,20 @@ directory: ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a CHIP-enabled Thread network. 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 43d27b44e1..a7c2ebcd0f 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 @@ -832,6 +832,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/refrigerator-app/linux/README.md b/examples/refrigerator-app/linux/README.md index c969832bcd..cf66321b9a 100644 --- a/examples/refrigerator-app/linux/README.md +++ b/examples/refrigerator-app/linux/README.md @@ -7,7 +7,7 @@ for Raspberry Pi Desktop 20.10 (aarch64)** 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/nxp_imx8m_linux_examples.md) for +[README document](../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details.
diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 6a43e52c64..f3149e01af 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -561,6 +561,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/refrigerator-app/silabs/BUILD.gn b/examples/refrigerator-app/silabs/BUILD.gn new file mode 100644 index 0000000000..9e63c6c10e --- /dev/null +++ b/examples/refrigerator-app/silabs/BUILD.gn @@ -0,0 +1,243 @@ +# Copyright (c) 2024 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/efr32_sdk.gni") +import("//build_overrides/pigweed.gni") + +import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/silabs_executable.gni") + +import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/silabs/silabs_board.gni") + +if (chip_enable_pw_rpc) { + import("//build_overrides/pigweed.gni") + import("$dir_pw_build/target_types.gni") +} + +assert(current_os == "freertos") + +silabs_project_dir = "${chip_root}/examples/refrigerator-app/silabs" +examples_common_plat_dir = "${chip_root}/examples/platform/silabs" + +if (wifi_soc) { + import("${chip_root}/third_party/silabs/SiWx917_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") + examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +} + +import("${examples_common_plat_dir}/args.gni") + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false + + # Enable the temperature sensor + # Some boards do not have a temperature sensor + use_temp_sensor = false +} + +if (wifi_soc) { + siwx917_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/SiWx917", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + } +} else { + efr32_sdk("sdk") { + sources = [ + "${examples_common_plat_dir}/FreeRTOSConfig.h", + "${silabs_project_dir}/include/CHIPProjectConfig.h", + ] + + include_dirs = [ + "${chip_root}/src/platform/silabs/efr32", + "${silabs_project_dir}/include", + "${examples_plat_dir}", + "${chip_root}/src/lib", + "${examples_common_plat_dir}", + ] + + if (use_wf200) { + include_dirs += [ "${examples_plat_dir}/wf200" ] + } + + if (chip_enable_ble_rs911x) { + include_dirs += [ + "${chip_root}/src/platform/silabs/efr32/rs911x", + "${examples_plat_dir}/rs911x", + "${examples_plat_dir}/rs911x/hal", + ] + } + + defines = [] + if (chip_enable_pw_rpc) { + defines += [ + "HAL_VCOM_ENABLE=1", + "PW_RPC_ENABLED", + ] + } + + if (use_temp_sensor) { + include_dirs += [ + "${efr32_sdk_root}/platform/driver/i2cspm/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht", + "${efr32_sdk_root}/app/bluetooth/common/sensor_rht/config", + "${efr32_sdk_root}/hardware/driver/si70xx/inc", + "${efr32_sdk_root}/app/bluetooth/common/sensor_select", + "${efr32_sdk_root}/platform/common/config", + ] + + defines += [ "USE_TEMP_SENSOR" ] + } + } +} + +silabs_executable("refrigerator_app") { + output_name = "matter-silabs-refrigerator-example.out" + defines = [] + include_dirs = [ + "include", + "${chip_root}/examples/refrigerator-app/refrigerator-common/include", + ] + + sources = [ + "${chip_root}/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp", + "${examples_common_plat_dir}/main.cpp", + "src/AppTask.cpp", + "src/RefrigeratorManager.cpp", + "src/ZclCallbacks.cpp", + "src/refrigerator-and-temperature-controlled-cabinet-mode.cpp", + ] + + if (use_temp_sensor) { + sources += [ + "${efr32_sdk_root}/hardware/driver/si70xx/src/sl_si70xx.c", + "${efr32_sdk_root}/platform/common/src/sl_status.c", + "${efr32_sdk_root}/platform/driver/i2cspm/src/sl_i2cspm.c", + "${efr32_sdk_root}/platform/emlib/src/em_i2c.c", + "${examples_common_plat_dir}/TemperatureSensor.cpp", + "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_i2cspm_init.c", + ] + } + + if (!disable_lcd) { + sources += [ "src/RefrigeratorUI.cpp" ] + } + + deps = [ + ":sdk", + app_data_model, + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}:siwx917-common" ] + } else { + deps += [ "${examples_plat_dir}:efr32-common" ] + } + + if (chip_enable_pw_rpc) { + defines += [ + "PW_RPC_ENABLED", + "PW_RPC_ATTRIBUTE_SERVICE=1", + "PW_RPC_BUTTON_SERVICE=1", + "PW_RPC_DESCRIPTOR_SERVICE=1", + "PW_RPC_DEVICE_SERVICE=1", + ] + + sources += [ + "${chip_root}/examples/common/pigweed/RpcService.cpp", + "${chip_root}/examples/common/pigweed/efr32/PigweedLoggerMutex.cpp", + "${examples_common_plat_dir}/PigweedLogger.cpp", + "${examples_common_plat_dir}/Rpc.cpp", + ] + + deps += [ + "$dir_pw_hdlc:default_addresses", + "$dir_pw_hdlc:rpc_channel_output", + "$dir_pw_stream:sys_io_stream", + "${chip_root}/config/efr32/lib/pw_rpc:pw_rpc", + "${chip_root}/examples/common/pigweed:attributes_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:button_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", + ] + + if (wifi_soc) { + deps += [ "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917" ] + } else { + deps += [ "${examples_common_plat_dir}/pw_sys_io:pw_sys_io_silabs" ] + } + + deps += pw_build_LINK_DEPS + + include_dirs += [ + "${chip_root}/examples/common", + "${chip_root}/examples/common/pigweed/efr32", + ] + } + + ldscript = "${examples_common_plat_dir}/ldscripts/${silabs_family}.ld" + + inputs = [ ldscript ] + + ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + # WiFi Settings + if (chip_enable_wifi) { + ldflags += [ + "-Wl,--defsym", + "-Wl,SILABS_WIFI=1", + ] + } + + output_dir = root_out_dir +} + +group("silabs") { + deps = [ ":refrigerator_app" ] +} + +group("default") { + deps = [ ":silabs" ] +} diff --git a/examples/refrigerator-app/silabs/README.md b/examples/refrigerator-app/silabs/README.md new file mode 100644 index 0000000000..d063937a6d --- /dev/null +++ b/examples/refrigerator-app/silabs/README.md @@ -0,0 +1,378 @@ +# Matter Refrigerator and Temperature Controlled Example + +An example showing the use of CHIP on the Silicon Labs EFR32 MG24 and SiWx917 +Wi-Fi Boards. + +
+ +- [Matter Refrigerator and Temperature Controlled + Example](#matter-refrigerator-and-Temperature -controlled-example) + - [Introduction](#introduction) + - [Building](#building) + - [Flashing the Application](#flashing-the-application) + - [Viewing Logging Output](#viewing-logging-output) + - [Running the Complete Example](#running-the-complete-example) + - [Notes](#notes) + - [OTA Software Update](#ota-software-update) + - [Building options](#building-options) + - [Disabling logging](#disabling-logging) + - [Debug build / release build](#debug-build--release-build) + - [Disabling LCD](#disabling-lcd) + - [KVS maximum entry count](#kvs-maximum-entry-count) + +
+ +> **NOTE:** Silicon Laboratories now maintains a public matter GitHub repo with +> frequent releases thoroughly tested and validated. Developers looking to +> develop matter products with silabs hardware are encouraged to use our latest +> release with added tools and documentation. +> [Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) + +## Introduction + +The Refrigerator and Temperature Controlled example provides a baseline +demonstration of a Temperature Controlled Cabinet device, built using Matter and +the Silicon Labs Simplicity SDK. It can be controlled by a Chip controller over +an Openthread or Wi-Fi network. + +The Refrigerator device can be commissioned over Bluetooth Low Energy (BLE), +where the device and the Chip controller will exchange security information +using the Rendez-vous procedure. For Thread, the Thread Network credentials are +provided to the Refrigerator device, which will then join the Thread network. + +If the LCD is enabled, the LCD on the Silabs WSTK displays a QR Code containing +the needed commissioning information for the BLE connection and starting the +Rendez-vous procedure. Once the device is commissioned, the display shows a +representation of the refrigerator's temperature-controlled state. + +The Refrigerator and Temperature Controlled example is intended to serve both as +a means to explore the workings of Matter as well as a template for creating +real products based on the Silicon Labs platform. + +## Building + +- Download the + [Simplicity Commander](https://www.silabs.com/mcu/programming-options) + command line tool, and ensure that `commander` is your shell search path. + (For Mac OS X, `commander` is located inside + `Commander.app/Contents/MacOS/`.) + +- Download and install a suitable ARM gcc tool chain (For most Host, the + bootstrap already installs the toolchain): + [GNU Arm Embedded Toolchain 12.2 Rel1](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads) + +- Install some additional tools(likely already present for CHIP developers): + + # Linux + $ sudo apt-get install git ninja-build + + # Mac OS X + $ brew install ninja + +- Supported hardware: + + - > For the latest supported hardware please refer to the + > [Hardware Requirements](https://github.com/SiliconLabs/matter/blob/latest/docs/silabs/general/HARDWARE_REQUIREMENTS.md) + > in the Silicon Labs Matter Github Repo + + Silabs boards : + + - BRD2601B / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD2703A / SLWSTK6000B / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4186C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@10dBm + - BRD4187A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4187C / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4338A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + - BRD4346A / SLWSTK6006A / Wireless Starter Kit / 2.4GHz@20dBm + +* Build the example application: + + cd ~/connectedhomeip + ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app BRD4187C + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip + $ rm -rf ./out/ + + OR use GN/Ninja directly + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/debug + $ ninja -C out/debug + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ rm -rf out/ + +* Build the example as Intermittently Connected Device (ICD) + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs/ ./out/refrigerator-app_ICD BRD4187C --icd + + or use gn as previously mentioned but adding the following arguments: + + $ gn gen out/debug '--args=SILABS_BOARD="BRD4187C" enable_sleepy_device=true chip_openthread_ftd=false' + +* Build the example with pigweed RCP + + $ ./scripts/examples/gn_silabs_example.sh examples/refrigerator-app/silabs/ out/refrigerator_app_rpc BRD4187C 'import("//with_pw_rpc.gni")' + + or use GN/Ninja Directly + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ export SILABS_BOARD=BRD4187C + $ gn gen out/debug --args='import("//with_pw_rpc.gni")' + $ ninja -C out/debug + +For more build options, help is provided when running the build script without +arguments + + ./scripts/examples/gn_silabs_example.sh + +## Flashing the Application + +- On the command line: + + $ cd ~/connectedhomeip/examples/refrigerator-app/silabs + $ python3 out/debug/matter-silabs-refrigerator-example.flash.py + +- Or with the Ozone debugger, just load the .out file. + +All EFR32 boards require a bootloader, see Silicon Labs documentation for more +info. Pre-built bootloader binaries are available in the Assets section of the +Releases page on +[Silabs Matter Github](https://github.com/SiliconLabs/matter/releases) . + +## Viewing Logging Output + +The example application is built to use the SEGGER Real Time Transfer (RTT) +facility for log output. RTT is a feature built-in to the J-Link Interface MCU +on the WSTK development board. It allows bi-directional communication with an +embedded application without the need for a dedicated UART. + +Using the RTT facility requires downloading and installing the _SEGGER J-Link +Software and Documentation Pack_ +([web site](https://www.segger.com/downloads/jlink#J-LinkSoftwareAndDocumentationPack)). + +Alternatively, SEGGER Ozone J-Link debugger can be used to view RTT logs too +after flashing the .out file. + +- Download the J-Link installer by navigating to the appropriate URL and + agreeing to the license agreement. + +- [JLink_Linux_x86_64.deb](https://www.segger.com/downloads/jlink/JLink_Linux_x86_64.deb) +- [JLink_MacOSX.pkg](https://www.segger.com/downloads/jlink/JLink_MacOSX.pkg) + +* Install the J-Link software + + $ cd ~/Downloads + $ sudo dpkg -i JLink_Linux_V*_x86_64.deb + +* In Linux, grant the logged in user the ability to talk to the development + hardware via the linux tty device (/dev/ttyACMx) by adding them to the + dialout group. + + $ sudo usermod -a -G dialout ${USER} + +Once the above is complete, log output can be viewed using the JLinkExe tool in +combination with JLinkRTTClient as follows: + +- Run the JLinkExe tool with arguments to autoconnect to the WSTK board: + + For MG24 use: + + ``` + $ JLinkExe -device EFR32MG24AXXXF1536 -if SWD -speed 4000 -autoconnect 1 + ``` + +- In a second terminal, run the JLinkRTTClient to view logs: + + $ JLinkRTTClient + +## Running the Complete Example + +- It is assumed here that you already have an OpenThread border router + configured and running. If not see the following guide + [Openthread_border_router](../../../docs/platforms/openthread/openthread_border_router_pi.md) + for more information on how to setup a border router on a raspberryPi. + + Take note that the RCP code is available directly through + [Simplicity Studio 5](https://www.silabs.com/products/development-tools/software/simplicity-studio/simplicity-studio-5) + under File->New->Project Wizard->Examples->Thread : ot-rcp + +- User interface : **LCD** The LCD on Silabs WSTK shows a QR Code. This QR + Code is be scanned by the CHIP Tool app For the Rendez-vous procedure over + BLE + + * On devices that do not have or support the LCD Display like the BRD4166A Thunderboard Sense 2, + a URL can be found in the RTT logs. + + [SVR] Copy/paste the below URL in a browser to see the QR Code: + [SVR] https://project-chip.github.io/connectedhomeip/qrcode.html?data=CH%3AI34NM%20-00%200C9SS0 + + **LED 0** shows the overall state of the device and its connectivity. The + following states are possible: + + - _Short Flash On (50 ms on/950 ms off)_ ; The device is in the + unprovisioned (unpaired) state and is waiting for a commissioning + application to connect. + + - _Rapid Even Flashing_ ; (100 ms on/100 ms off)_ — The device is in the + unprovisioned state and a commissioning application is connected through + Bluetooth LE. + + - _Short Flash Off_ ; (950ms on/50ms off)_ — The device is fully + provisioned, but does not yet have full Thread network or service + connectivity. + + - _Solid On_ ; The device is fully provisioned and has full Thread + network and service connectivity. + + **LED 1** Shows the state of the refrigerator and temperature controlled + cabinet + + - temperature ; No implementation is present. this feature will be available in a future update. + - _Off_ ; No implementation is present. this feature will be available in a future update. + - _Blinking slowly_ ; No implementation is present. this feature will be available in a future update. + - _Blinking quickly_ ; No implementation is present. this feature will be available in a future update. + + **Push Button 0** Function button and factory reset + + - Pressed and release: No implementation is present. this feature will be available in a future update. + + - Pressed and hold for 6 s: Initiates the factory reset of the device. + Releasing the button within the 6-second window cancels the factory reset + procedure. **LEDs** blink in unison when the factory reset procedure is + initiated. + + **Push Button 1** Application button + + - Pressed and release: No implementation is present. this feature will be available in a future update. + + - Press and hold for 3 s: No implementation is present. this feature will be available in a future update. + +* Once the device is provisioned, it will join the Thread network is + established, look for the RTT log + + ``` + [DL] Device Role: CHILD + [DL] Partition Id:0x6A7491B7 + [DL] \_OnPlatformEvent default: event->Type = 32778 + [DL] OpenThread State Changed (Flags: 0x00000001) + [DL] Thread Unicast Addresses: + [DL] 2001:DB8::E1A2:87F1:7D5D:FECA/64 valid preferred + [DL] FDDE:AD00:BEEF::FF:FE00:2402/64 valid preferred rloc + [DL] FDDE:AD00:BEEF:0:383F:5E81:A05A:B168/64 valid preferred + [DL] FE80::D8F2:592E:C109:CF00/64 valid preferred + [DL] LwIP Thread interface addresses updated + [DL] FE80::D8F2:592E:C109:CF00 IPv6 link-local address, preferred) + [DL] FDDE:AD00:BEEF:0:383F:5E81:A05A:B168 Thread mesh-local address, preferred) + [DL] 2001:DB8::E1A2:87F1:7D5D:FECA IPv6 global unicast address, preferred) + ``` + + (you can verify that the device is on the thread network with the command + `router table` using a serial terminal (screen / minicom etc.) on the board + running the refrigerator-app example. You can also get the address list with + the command ipaddr again in the serial terminal ) + + You can provision the Chip device using Chip tool Android or iOS app or + through CLI commands on your OT BR + + The + [CHIPTool](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) + can now be used to send ZCL commands to the refrigerator device. For + instance, to set the refrigerator covering lift by percentage: + + ``` + chip-tool pairing ble-thread 1 hex: 20202021 3840 + + ./chip-tool refrigeratoralarm read state 1 1 + + Refrigerator Endpoint Id 1 + + This enpoint support the refrigerator alarm cluster + + ./chip-tool temperaturecontrol read temperature-setpoint 1 2 + + Enpoint for temperaturecontrol is 2 and 3 + + Cold Cabinet Endpoint Id 2 + Freeze Cabinet Endpoint Id 3 + + This enpoint support Temperature control cluster + ``` + + To see the supported refrigerator cluster commands, use: + + ``` + chip-tool refrigeratorandtemperaturecontrolledcabinetmode + chip-tool temperaturecontrol + chip-tool refrigeratoralarm + + ``` + +### Notes + +- Depending on your network settings your router might not provide native ipv6 + addresses to your devices (Border router / PC). If this is the case, you + need to add a static ipv6 addresses on both device and then an ipv6 route to + the border router on your PC + + # On Border Router : + $ sudo ip addr add dev 2002::2/64 + + # On PC (Linux) : + $ sudo ip addr add dev 2002::1/64 + + # Add Ipv6 route on PC (Linux) + $ sudo ip route add /64 via 2002::2 + +## OTA Software Update + +For the description of Software Update process with EFR32 example applications +see +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) + +For the description of Software Update process with SiWx917 example applications +see +[SiWx917 OTA Software Update](https://docs.silabs.com/matter/latest/matter-ota/04-ota-software-update-soc) + +## Building options + +All of Silabs's examples within the Matter repo have all the features enabled by +default, as to provide the best end user experience. However some of those +features can easily be toggled on or off. Here is a short list of options : + +### Disabling logging + +chip_progress_logging, chip_detail_logging, chip_automation_logging + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false" + +### Debug build / release build + +is_debug + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "is_debug=false" + +### Disabling LCD + +show_qr_code + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A "show_qr_code=false" + +### KVS maximum entry count + +kvs_max_entries + + Set the maximum Kvs entries that can be stored in NVM (Default 75) + Thresholds: 30 <= kvs_max_entries <= 255 + + $ ./scripts/examples/gn_silabs_example.sh ./examples/refrigerator-app/silabs ./out/refrigerator-app BRD4164A kvs_max_entries=50 diff --git a/examples/refrigerator-app/silabs/build_for_wifi_args.gni b/examples/refrigerator-app/silabs/build_for_wifi_args.gni new file mode 100644 index 0000000000..e82cf8be12 --- /dev/null +++ b/examples/refrigerator-app/silabs/build_for_wifi_args.gni @@ -0,0 +1,21 @@ +# Copyright (c) 2024 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") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") +import("${chip_root}/src/platform/silabs/wifi_args.gni") +chip_enable_wifi = true +chip_enable_ota_requestor = true +app_data_model = "${chip_root}/examples/refrigerator-app/silabs/data_model:silabs-refrigerator" diff --git a/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn b/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn new file mode 100644 index 0000000000..c3b7b1f036 --- /dev/null +++ b/examples/refrigerator-app/silabs/build_for_wifi_gnfile.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 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" + chip_device_platform = "SiWx917" + chip_enable_wifi = true + import("//build_for_wifi_args.gni") +} diff --git a/examples/all-clusters-minimal-app/tizen/build_overrides b/examples/refrigerator-app/silabs/build_overrides similarity index 100% rename from examples/all-clusters-minimal-app/tizen/build_overrides rename to examples/refrigerator-app/silabs/build_overrides diff --git a/examples/refrigerator-app/silabs/data_model/BUILD.gn b/examples/refrigerator-app/silabs/data_model/BUILD.gn new file mode 100644 index 0000000000..da519c005a --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2024 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") +import("${chip_root}/src/platform/device.gni") + +chip_data_model("silabs-refrigerator") { + if (chip_enable_wifi) { + zap_file = "refrigerator-wifi-app.zap" + } else { + zap_file = "refrigerator-thread-app.zap" + } + is_server = true +} diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter new file mode 100644 index 0000000000..96d392547f --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter @@ -0,0 +1,2000 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + 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; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + 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 ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + 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; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + 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; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + 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. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The Thread Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems */ +cluster ThreadNetworkDiagnostics = 53 { + revision 2; + + enum ConnectionStatusEnum : enum8 { + kConnected = 0; + kNotConnected = 1; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kLinkDown = 1; + kHardwareFailure = 2; + kNetworkJammed = 3; + } + + enum RoutingRoleEnum : enum8 { + kUnspecified = 0; + kUnassigned = 1; + kSleepyEndDevice = 2; + kEndDevice = 3; + kREED = 4; + kRouter = 5; + kLeader = 6; + } + + bitmap Feature : bitmap32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + kMLECounts = 0x4; + kMACCounts = 0x8; + } + + struct NeighborTableStruct { + int64u extAddress = 0; + int32u age = 1; + int16u rloc16 = 2; + int32u linkFrameCounter = 3; + int32u mleFrameCounter = 4; + int8u lqi = 5; + nullable int8s averageRssi = 6; + nullable int8s lastRssi = 7; + int8u frameErrorRate = 8; + int8u messageErrorRate = 9; + boolean rxOnWhenIdle = 10; + boolean fullThreadDevice = 11; + boolean fullNetworkData = 12; + boolean isChild = 13; + } + + struct OperationalDatasetComponents { + boolean activeTimestampPresent = 0; + boolean pendingTimestampPresent = 1; + boolean masterKeyPresent = 2; + boolean networkNamePresent = 3; + boolean extendedPanIdPresent = 4; + boolean meshLocalPrefixPresent = 5; + boolean delayPresent = 6; + boolean panIdPresent = 7; + boolean channelPresent = 8; + boolean pskcPresent = 9; + boolean securityPolicyPresent = 10; + boolean channelMaskPresent = 11; + } + + struct RouteTableStruct { + int64u extAddress = 0; + int16u rloc16 = 1; + int8u routerId = 2; + int8u nextHop = 3; + int8u pathCost = 4; + int8u LQIIn = 5; + int8u LQIOut = 6; + int8u age = 7; + boolean allocated = 8; + boolean linkEstablished = 9; + } + + struct SecurityPolicy { + int16u rotationTime = 0; + int16u flags = 1; + } + + info event ConnectionStatus = 0 { + ConnectionStatusEnum connectionStatus = 0; + } + + info event NetworkFaultChange = 1 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + readonly attribute nullable int16u channel = 0; + readonly attribute nullable RoutingRoleEnum routingRole = 1; + readonly attribute nullable char_string<16> networkName = 2; + readonly attribute nullable int16u panId = 3; + readonly attribute nullable int64u extendedPanId = 4; + readonly attribute nullable octet_string<17> meshLocalPrefix = 5; + readonly attribute optional int64u overrunCount = 6; + readonly attribute NeighborTableStruct neighborTable[] = 7; + readonly attribute RouteTableStruct routeTable[] = 8; + readonly attribute nullable int32u partitionId = 9; + readonly attribute nullable int16u weighting = 10; + readonly attribute nullable int16u dataVersion = 11; + readonly attribute nullable int16u stableDataVersion = 12; + readonly attribute nullable int8u leaderRouterId = 13; + readonly attribute optional int16u detachedRoleCount = 14; + readonly attribute optional int16u childRoleCount = 15; + readonly attribute optional int16u routerRoleCount = 16; + readonly attribute optional int16u leaderRoleCount = 17; + readonly attribute optional int16u attachAttemptCount = 18; + readonly attribute optional int16u partitionIdChangeCount = 19; + readonly attribute optional int16u betterPartitionAttachAttemptCount = 20; + readonly attribute optional int16u parentChangeCount = 21; + readonly attribute optional int32u txTotalCount = 22; + readonly attribute optional int32u txUnicastCount = 23; + readonly attribute optional int32u txBroadcastCount = 24; + readonly attribute optional int32u txAckRequestedCount = 25; + readonly attribute optional int32u txAckedCount = 26; + readonly attribute optional int32u txNoAckRequestedCount = 27; + readonly attribute optional int32u txDataCount = 28; + readonly attribute optional int32u txDataPollCount = 29; + readonly attribute optional int32u txBeaconCount = 30; + readonly attribute optional int32u txBeaconRequestCount = 31; + readonly attribute optional int32u txOtherCount = 32; + readonly attribute optional int32u txRetryCount = 33; + readonly attribute optional int32u txDirectMaxRetryExpiryCount = 34; + readonly attribute optional int32u txIndirectMaxRetryExpiryCount = 35; + readonly attribute optional int32u txErrCcaCount = 36; + readonly attribute optional int32u txErrAbortCount = 37; + readonly attribute optional int32u txErrBusyChannelCount = 38; + readonly attribute optional int32u rxTotalCount = 39; + readonly attribute optional int32u rxUnicastCount = 40; + readonly attribute optional int32u rxBroadcastCount = 41; + readonly attribute optional int32u rxDataCount = 42; + readonly attribute optional int32u rxDataPollCount = 43; + readonly attribute optional int32u rxBeaconCount = 44; + readonly attribute optional int32u rxBeaconRequestCount = 45; + readonly attribute optional int32u rxOtherCount = 46; + readonly attribute optional int32u rxAddressFilteredCount = 47; + readonly attribute optional int32u rxDestAddrFilteredCount = 48; + readonly attribute optional int32u rxDuplicatedCount = 49; + readonly attribute optional int32u rxErrNoFrameCount = 50; + readonly attribute optional int32u rxErrUnknownNeighborCount = 51; + readonly attribute optional int32u rxErrInvalidSrcAddrCount = 52; + readonly attribute optional int32u rxErrSecCount = 53; + readonly attribute optional int32u rxErrFcsCount = 54; + readonly attribute optional int32u rxErrOtherCount = 55; + readonly attribute optional nullable int64u activeTimestamp = 56; + readonly attribute optional nullable int64u pendingTimestamp = 57; + readonly attribute optional nullable int32u delay = 58; + readonly attribute nullable SecurityPolicy securityPolicy = 59; + readonly attribute nullable octet_string<4> channelPage0Mask = 60; + readonly attribute nullable OperationalDatasetComponents operationalDatasetComponents = 61; + readonly attribute NetworkFaultEnum activeNetworkFaultsList[] = 62; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + /** Reception of this command SHALL reset the OverrunCount attributes to 0 */ + command access(invoke: manage) ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { + revision 2; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kRapidCool = 16384; + kRapidFreeze = 16385; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 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 ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 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 SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for configuring the Refrigerator alarm. */ +cluster RefrigeratorAlarm = 87 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kDoorOpen = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 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; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + 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; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateProvider { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command QueryImage; + handle command QueryImageResponse; + handle command ApplyUpdateRequest; + handle command ApplyUpdateResponse; + handle command NotifyUpdateApplied; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = true; + ram attribute updateState default = 0; + ram attribute updateStateProgress; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + 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; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster ThreadNetworkDiagnostics { + callback attribute channel; + callback attribute routingRole; + callback attribute networkName; + callback attribute panId; + callback attribute extendedPanId; + callback attribute meshLocalPrefix; + callback attribute neighborTable; + callback attribute routeTable; + callback attribute partitionId; + callback attribute weighting; + callback attribute dataVersion; + callback attribute stableDataVersion; + callback attribute leaderRouterId; + callback attribute securityPolicy; + callback attribute channelPage0Mask; + callback attribute operationalDatasetComponents; + callback attribute activeNetworkFaultsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_refrigerator = 112, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster RefrigeratorAndTemperatureControlledCabinetMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster RefrigeratorAlarm { + ram attribute mask default = 0; + ram attribute state default = 0; + ram attribute supported default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 2 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} +endpoint 3 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} + + diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap new file mode 100644 index 0000000000..57785bd3ad --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.zap @@ -0,0 +1,4311 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "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", + "category": "matter", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + } + ], + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "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": "server", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "true", + "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": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 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": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "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 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "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, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-refrigerator", + "deviceTypeRef": { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 112 + ], + "deviceTypeName": "MA-refrigerator", + "deviceTypeCode": 112, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "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, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 4, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-refrigerator", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter new file mode 100644 index 0000000000..346471b31b --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter @@ -0,0 +1,1908 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + 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; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + 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 ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** Provides an interface for providing OTA software updates */ +cluster OtaSoftwareUpdateProvider = 41 { + revision 1; // NOTE: Default/not specifically set + + enum ApplyUpdateActionEnum : enum8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum DownloadProtocolEnum : enum8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum StatusEnum : enum8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + int16u productID = 1; + int32u softwareVersion = 2; + DownloadProtocolEnum protocolsSupported[] = 3; + optional int16u hardwareVersion = 4; + optional char_string<2> location = 5; + optional boolean requestorCanConsent = 6; + optional octet_string<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + StatusEnum status = 0; + optional int32u delayedActionTime = 1; + optional char_string<256> imageURI = 2; + optional int32u softwareVersion = 3; + optional char_string<64> softwareVersionString = 4; + optional octet_string<32> updateToken = 5; + optional boolean userConsentNeeded = 6; + optional octet_string<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + octet_string<32> updateToken = 0; + int32u newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + ApplyUpdateActionEnum action = 0; + int32u delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + octet_string<32> updateToken = 0; + int32u softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +cluster OtaSoftwareUpdateRequestor = 42 { + revision 1; // NOTE: Default/not specifically set + + enum AnnouncementReasonEnum : enum8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum ChangeReasonEnum : enum8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum UpdateStateEnum : enum8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + UpdateStateEnum previousState = 0; + UpdateStateEnum newState = 1; + ChangeReasonEnum reason = 2; + nullable int32u targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + int32u softwareVersion = 0; + int16u productID = 1; + } + + info event DownloadError = 2 { + int32u softwareVersion = 0; + int64u bytesDownloaded = 1; + nullable int8u progressPercent = 2; + nullable int64s platformCode = 3; + } + + attribute access(write: administer) ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute UpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + AnnouncementReasonEnum announcementReason = 2; + optional octet_string<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + /** Announce the presence of an OTA Provider */ + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + 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; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + 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; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + 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. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** The 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. */ +cluster WiFiNetworkDiagnostics = 54 { + revision 1; // NOTE: Default/not specifically set + + 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 associationFailureCause = 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 optional nullable int32u beaconLostCount = 5; + readonly attribute optional nullable int32u beaconRxCount = 6; + readonly attribute optional nullable int32u packetMulticastRxCount = 7; + readonly attribute optional nullable int32u packetMulticastTxCount = 8; + readonly attribute optional nullable int32u packetUnicastRxCount = 9; + readonly attribute optional nullable int32u packetUnicastTxCount = 10; + readonly attribute optional nullable int64u currentMaxRate = 11; + readonly attribute optional 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; + + /** Reception of this command SHALL reset the Breacon and Packet related count attributes to 0 */ + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster RefrigeratorAndTemperatureControlledCabinetMode = 82 { + revision 2; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kRapidCool = 16384; + kRapidFreeze = 16385; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 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 ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 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 SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for configuring the Refrigerator alarm. */ +cluster RefrigeratorAlarm = 87 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kDoorOpen = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 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; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + 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; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OtaSoftwareUpdateProvider { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command QueryImage; + handle command QueryImageResponse; + handle command ApplyUpdateRequest; + handle command ApplyUpdateResponse; + handle command NotifyUpdateApplied; + } + + server cluster OtaSoftwareUpdateRequestor { + callback attribute defaultOTAProviders; + ram attribute updatePossible default = true; + ram attribute updateState default = 0; + ram attribute updateStateProgress; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + 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; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + + handle command ScanNetworks; + handle command ScanNetworksResponse; + handle command AddOrUpdateWiFiNetwork; + handle command RemoveNetwork; + handle command NetworkConfigResponse; + handle command ConnectNetwork; + handle command ConnectNetworkResponse; + handle command ReorderNetwork; + } + + server cluster DiagnosticLogs { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command RetrieveLogsRequest; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster WiFiNetworkDiagnostics { + emits event Disconnection; + emits event AssociationFailure; + emits event ConnectionStatus; + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber; + callback attribute rssi; + callback attribute beaconLostCount; + callback attribute beaconRxCount; + callback attribute packetMulticastRxCount; + callback attribute packetMulticastTxCount; + callback attribute packetUnicastRxCount; + callback attribute packetUnicastTxCount; + callback attribute currentMaxRate; + callback attribute overrunCount; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + + handle command ResetCounts; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command OpenCommissioningWindow; + handle command RevokeCommissioning; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + + handle command AttestationRequest; + handle command AttestationResponse; + handle command CertificateChainRequest; + handle command CertificateChainResponse; + handle command CSRRequest; + handle command CSRResponse; + handle command AddNOC; + handle command UpdateNOC; + handle command NOCResponse; + handle command UpdateFabricLabel; + handle command RemoveFabric; + handle command AddTrustedRootCertificate; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_refrigerator = 112, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster RefrigeratorAndTemperatureControlledCabinetMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster RefrigeratorAlarm { + ram attribute mask default = 0; + ram attribute state default = 0; + ram attribute supported default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 2 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} +endpoint 3 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster TemperatureControl { + ram attribute temperatureSetpoint; + ram attribute minTemperature; + ram attribute maxTemperature; + ram attribute step; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } +} + + diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap new file mode 100644 index 0000000000..edc35aa7a3 --- /dev/null +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.zap @@ -0,0 +1,4216 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "category": "matter", + "version": "chip-v1" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice", + "deviceTypeOrder": 0 + } + ], + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "3", + "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": "server", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "true", + "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": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 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": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "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 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Wi-Fi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "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": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "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": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-refrigerator", + "deviceTypeRef": { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 112 + ], + "deviceTypeName": "MA-refrigerator", + "deviceTypeCode": 112, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "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, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + }, + { + "id": 4, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "MA-refrigerator", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null + } + ] +} \ No newline at end of file diff --git a/examples/refrigerator-app/silabs/include/AppConfig.h b/examples/refrigerator-app/silabs/include/AppConfig.h new file mode 100644 index 0000000000..3c9472f8d3 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppConfig.h @@ -0,0 +1,61 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "silabs_utils.h" + +// ---- Refrigerator Example App Config ---- + +#define APP_TASK_NAME "Refr" + +#define BLE_DEV_NAME "SiLabs-Refrigerator" + +// Time it takes in ms for the simulated actuator to move from one +// state to another. +#define ACTUATOR_MOVEMENT_PERIOS_MS 10 + +// APP Logo, boolean only. must be 64x64 +#define ON_DEMO_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x81, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC1, 0x83, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, \ + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, \ + 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ + 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#define OFF_DEMO_BITMAP ON_DEMO_BITMAP diff --git a/examples/refrigerator-app/silabs/include/AppEvent.h b/examples/refrigerator-app/silabs/include/AppEvent.h new file mode 100644 index 0000000000..59d49c5002 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppEvent.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Refrigerator, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Actor; + } RefrigeratorEvent; + }; + + EventHandler Handler; +}; diff --git a/examples/refrigerator-app/silabs/include/AppTask.h b/examples/refrigerator-app/silabs/include/AppTask.h new file mode 100644 index 0000000000..36c4581b29 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/AppTask.h @@ -0,0 +1,110 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +/********************************************************** + * Includes + *********************************************************/ + +#include +#include + +#ifdef DISPLAY_ENABLED +#include "RefrigeratorUI.h" +#endif + +#include "AppEvent.h" +#include "BaseApplication.h" +#include "RefrigeratorManager.h" +#include +#include +#include +#include + +/********************************************************** + * Defines + *********************************************************/ + +// Application-defined error codes in the CHIP_ERROR space. +#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) +#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) +#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03) +#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04) +#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05) +#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) + +/********************************************************** + * AppTask Declaration + *********************************************************/ + +class AppTask : public BaseApplication +{ + +public: + AppTask() = default; + + static AppTask & GetAppTask() { return sAppTask; } + + /** + * @brief AppTask task main loop function + * + * @param pvParameter FreeRTOS task parameter + */ + static void AppTaskMain(void * pvParameter); + + CHIP_ERROR StartAppTask(); + + /** + * @brief Event handler when a button is pressed + * Function posts an event for button processing + * + * @param buttonHandle APP_CONTROL_BUTTON or APP_FUNCTION_BUTTON + * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, + * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED + */ + static void ButtonEventHandler(uint8_t button, uint8_t btnAction); + +private: + static AppTask sAppTask; + + /** + * @brief AppTask initialisation function + * + * @return CHIP_ERROR + */ + CHIP_ERROR Init(); + + /** + * @brief PB0 Button event processing function + * Press and hold will trigger a factory reset timer start + * Press and release will restart BLEAdvertising if not commisionned + * + * @param aEvent button event being processed + */ + static void ButtonHandler(AppEvent * aEvent); + + /** + * @brief PB1 Button event processing function + * Function triggers an action sent to the CHIP task + // TODO: Action for refrigerator is not decided yet + * + * @param aEvent button event being processed + */ + static void RefrigeratorActionEventHandler(AppEvent * aEvent); +}; diff --git a/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h b/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h new file mode 100644 index 0000000000..dfaca5d760 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/CHIPProjectConfig.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @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 + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// 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 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x800E: example refrigerator app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x800E + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +/** + * 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 0 + +/** + * CHIP_DEVICE_CONFIG_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_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * 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) + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) + +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h b/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h new file mode 100644 index 0000000000..094775fa9f --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorIcons.h @@ -0,0 +1,218 @@ +/* + * + * 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. + */ +#pragma once + +#define SILABS_LOGO_WIDTH 47 +#define SILABS_LOGO_HEIGHT 18 +#define BLUETOOTH_ICON_SIZE 18 + +// Status Icon defines +#define STATUS_ICON_LINE 0 +#define SILABS_ICON_POSITION_X 0 +#define BLE_ICON_POSITION_X 72 +#define NETWORK_ICON_POSITION_X 90 +#define MATTER_ICON_POSITION_X 108 + +// Heating/Cooling position +#define HEATING_COOLING_X 90 +#define HEATING_COOLING_Y 40 + +#define BLUETOOTH_ICON_SMALL \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0x7F, 0xFE, 0xEF, 0xF1, 0x7F, 0x9F, 0xFF, 0x7B, 0xFF, 0x1F, 0xFE, 0xFF, 0xFC, 0xFF, \ + 0xF3, 0xFF, 0x87, 0xFF, 0xEF, 0xFD, 0xDF, 0xE7, 0xBF, 0xC7, 0xFF, 0x9F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F + +#define SILABS_LOGO_SMALL \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, \ + 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x80, 0x3F, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0x9F, 0xFF, 0xE7, 0x3F, 0xE0, 0xF1, 0x83, \ + 0xFF, 0xF9, 0xEF, 0xFF, 0x3F, 0xE0, 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xF8, 0x0F, 0xFC, 0xFF, 0xFF, 0x3F, 0xFE, 0x03, 0xFC, \ + 0xFF, 0xF7, 0x9F, 0xFF, 0x81, 0x07, 0x02, 0xF8, 0xFF, 0xFF, 0xE0, 0x07, 0x00, 0xFE, 0xFF, 0xFF, 0xF8, 0x03, 0xC0, 0xFF, \ + 0xFF, 0xFF, 0xFE, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0x3F + +#define HEATING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, \ + 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFE, 0x7F, 0xFC, 0x1F, \ + 0x1F, 0xF8, 0xF8, 0x3F, 0x07, 0xE0, 0xFC, 0xBF, 0xC7, 0xE3, 0xFD, 0xFF, 0xE3, 0xC7, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, \ + 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xE3, 0xC7, 0xFF, 0xBF, 0xC7, 0xE3, 0xFD, 0x3F, \ + 0x07, 0xE0, 0xFC, 0x1F, 0x1F, 0xF8, 0xF8, 0x3F, 0xFE, 0x7F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xBF, 0xFD, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define HEATING_WIDTH 32 +#define HEATING_HEIGHT 32 + +#define COOLING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFD, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, \ + 0x3F, 0xFC, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, \ + 0x3E, 0x7C, 0xFC, 0x0F, 0x0C, 0x30, 0xF0, 0xCF, 0x80, 0x01, 0xF3, 0xFF, 0xE3, 0xC7, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, \ + 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xF3, 0xCF, 0xFF, 0xFF, 0xE3, 0xC7, 0xFF, 0xCF, 0x80, 0x01, 0xF3, 0x0F, \ + 0x0C, 0x30, 0xF0, 0x3F, 0x3E, 0x7C, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0x3F, 0x7F, 0xFE, 0xFC, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, \ + 0x7F, 0xFE, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define HEATING_COOLING_BITMAP \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, \ + 0xFC, 0xE0, 0xFF, 0xFF, 0xFC, 0xF9, 0xF7, 0x7F, 0xFC, 0xF8, 0xF3, 0x1F, 0xFC, 0xFC, 0xF9, 0x1F, 0x78, 0xFC, 0xFC, 0xFF, \ + 0x01, 0x7C, 0xFE, 0xFF, 0x03, 0x3C, 0xFF, 0xFF, 0xE3, 0x9F, 0xFF, 0xFF, 0xF3, 0x8F, 0xF3, 0xFF, 0xF3, 0x87, 0xE3, 0xFF, \ + 0xF3, 0x83, 0xF7, 0xC7, 0xF0, 0x01, 0xF7, 0x07, 0xF0, 0x00, 0xFF, 0x0F, 0x7F, 0x00, 0xFF, 0xCF, 0x3F, 0x80, 0xFF, 0xCF, \ + 0x1F, 0x80, 0xFF, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0x07, 0xE0, 0xFD, 0xFF, 0xF3, 0xF8, 0xFD, 0xFF, 0xF9, 0xFF, 0xFC, 0xFF, \ + 0xFC, 0x3F, 0xFC, 0x7F, 0xDE, 0xFF, 0xFF, 0x3F, 0x1F, 0xFE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + +#define COOLING_WIDTH 32 +#define COOLING_HEIGHT 32 + +// Font for temperature +#define CELSIUS_INDEX 2320 +#define FAHRENHEIT_INDEX 2370 +#define DEGREE_INDEX 2420 + +#define MONACO_FONT_WIDTH 29 +#define MONACO_FONT_NB_LENGTH 232 +#define MONACO_FONT_CH_LENGTH 50 + +#define MONACO_48PT \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, \ + 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x1F, 0x60, 0x00, 0xFF, 0x1F, 0xF8, 0x03, 0xFF, 0x0F, \ + 0xFC, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFE, 0x07, 0xFC, 0x07, 0xFF, 0x03, 0xFC, 0x03, 0xFF, 0x03, 0xFC, 0x03, \ + 0xFF, 0x01, 0xF8, 0x83, 0xFF, 0x00, 0xF8, 0x83, 0xFF, 0x00, 0xF8, 0x83, 0x7F, 0x30, 0xF8, 0x83, 0x3F, 0x30, 0xF8, 0x83, \ + 0x3F, 0x38, 0xF8, 0x81, 0x1F, 0x3C, 0xF8, 0x81, 0x0F, 0x3C, 0xF8, 0x81, 0x0F, 0x3E, 0xF8, 0x81, 0x07, 0x3E, 0xF8, 0x81, \ + 0x07, 0x3F, 0xF8, 0x83, 0x83, 0x3F, 0xF8, 0x83, 0x81, 0x3F, 0xF8, 0x83, 0xC1, 0x3F, 0xF8, 0x83, 0xE0, 0x1F, 0xF8, 0x03, \ + 0xE0, 0x1F, 0xF8, 0x03, 0xF0, 0x1F, 0xF8, 0x03, 0xF8, 0x1F, 0xFC, 0x07, 0xF8, 0x0F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x07, \ + 0xFC, 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFE, 0x0F, 0xF8, 0x03, 0xFF, 0x1F, 0xE0, 0x00, 0xFF, 0x3F, 0x00, 0x80, 0xFF, 0x7F, \ + 0x00, 0xC0, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x03, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x30 (48: '0')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x03, 0xFC, 0xFF, 0xFF, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0xFC, 0xFF, \ + 0x1F, 0x00, 0xFC, 0xFF, 0x0F, 0x10, 0xFC, 0xFF, 0x0F, 0x1C, 0xFC, 0xFF, 0x0F, 0x1E, 0xFC, 0xFF, 0xCF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, \ + 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x31 (49: '1')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, \ + 0x3F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x80, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0x0F, 0xF8, 0x00, 0xFF, 0x0F, 0xFF, 0x03, 0xFE, \ + 0xEF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, \ + 0xFF, 0x7F, 0xC0, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x1F, 0xF0, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, \ + 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, \ + 0x3F, 0xF0, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xFE, 0x07, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0xFC, \ + 0x07, 0x00, 0x00, 0xFC, 0x07, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x32 (50: '2')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFE, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x7C, 0x80, 0xFF, 0x8F, 0xFF, 0x01, 0xFF, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x7F, 0xC0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, \ + 0x7F, 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0x7F, 0x00, 0xE0, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, \ + 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xF7, 0xFF, 0x07, 0xFE, 0x87, 0xFF, 0x01, 0xFF, 0x07, 0x7C, 0x80, 0xFF, 0x07, 0x00, 0xC0, 0xFF, \ + 0x07, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0xF0, 0xFF, 0x7F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x33 (51: '3')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x3F, 0xE0, 0xFF, 0xFF, 0x1F, 0xE0, 0xFF, \ + 0xFF, 0x1F, 0xE0, 0xFF, 0xFF, 0x0F, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0x83, 0xE0, 0xFF, \ + 0xFF, 0x81, 0xE0, 0xFF, 0xFF, 0xC0, 0xE0, 0xFF, 0xFF, 0xE0, 0xE0, 0xFF, 0x7F, 0xE0, 0xE0, 0xFF, 0x3F, 0xF0, 0xE0, 0xFF, \ + 0x3F, 0xF8, 0xE0, 0xFF, 0x1F, 0xF8, 0xE0, 0xFF, 0x0F, 0xFC, 0xE0, 0xFF, 0x0F, 0xFE, 0xE0, 0xFF, 0x07, 0xFE, 0xE0, 0xFF, \ + 0x03, 0xFF, 0xE0, 0xFF, 0x83, 0xFF, 0xE0, 0xFF, 0x81, 0xFF, 0xC0, 0xFF, 0x01, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF0, \ + 0x01, 0x00, 0x00, 0xF0, 0x01, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x34 (52: '4')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, 0x0F, 0x00, 0x00, 0xFE, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, \ + 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xC0, 0xFF, 0x0F, 0x00, 0x80, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFE, \ + 0xFF, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, \ + 0xFF, 0xFF, 0x07, 0xFE, 0xEF, 0xFF, 0x03, 0xFE, 0x07, 0xFF, 0x00, 0xFF, 0x07, 0x00, 0x80, 0xFF, 0x07, 0x00, 0xC0, 0xFF, \ + 0x07, 0x00, 0xE0, 0xFF, 0x0F, 0x00, 0xF0, 0xFF, 0xFF, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x35 (53: '5')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xC0, 0xFF, \ + 0xFF, 0x07, 0x00, 0xFE, 0xFF, 0x01, 0x00, 0xFE, 0xFF, 0x00, 0x00, 0xFE, 0x7F, 0x80, 0x07, 0xFE, 0x3F, 0xE0, 0x7F, 0xFE, \ + 0x1F, 0xF0, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, \ + 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x03, 0x0F, 0xE0, 0xFF, \ + 0x83, 0x03, 0x80, 0xFF, 0x83, 0x01, 0x00, 0xFF, 0x83, 0x00, 0x00, 0xFE, 0x03, 0xC0, 0x07, 0xFC, 0x03, 0xF0, 0x0F, 0xFC, \ + 0x03, 0xF8, 0x1F, 0xF8, 0x03, 0xFC, 0x3F, 0xF8, 0x03, 0xFC, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, \ + 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x07, 0xFE, 0x3F, 0xF8, 0x0F, 0xFE, 0x3F, 0xF8, 0x0F, 0xFC, 0x1F, 0xF8, \ + 0x0F, 0xFC, 0x1F, 0xFC, 0x1F, 0xF8, 0x0F, 0xFC, 0x1F, 0xF0, 0x07, 0xFE, 0x3F, 0xC0, 0x01, 0xFE, 0x7F, 0x00, 0x00, 0xFF, \ + 0xFF, 0x00, 0x80, 0xFF, 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x07, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x36 (54: '6')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0xFF, 0xFF, 0x3F, 0xF8, 0xFF, 0xFF, 0x1F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x0F, 0xFE, \ + 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xC1, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, \ + 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x3F, 0xF0, 0xFF, 0xFF, 0x3F, 0xF8, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, \ + 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x83, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, \ + 0xFF, 0xC1, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, \ + 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xE0, 0xFF, 0xFF, 0x7F, 0xF0, 0xFF, 0xFF, \ + 0x7F, 0xF0, 0xFF, 0xFF, 0x7F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x37 (55: '7')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF8, 0xFF, \ + 0xFF, 0x01, 0xE0, 0xFF, 0xFF, 0x00, 0x80, 0xFF, 0x7F, 0x00, 0x80, 0xFF, 0x3F, 0xE0, 0x00, 0xFF, 0x3F, 0xF8, 0x03, 0xFF, \ + 0x1F, 0xFC, 0x07, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x0F, 0xFE, 0x1F, 0xFC, 0x07, 0xFE, \ + 0x1F, 0xF8, 0x07, 0xFF, 0x3F, 0xF0, 0x03, 0xFF, 0x3F, 0xE0, 0x81, 0xFF, 0x7F, 0xC0, 0x80, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, \ + 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x01, 0xF0, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0x7F, 0x00, 0xC0, 0xFF, \ + 0x3F, 0x60, 0x80, 0xFF, 0x1F, 0xF0, 0x00, 0xFF, 0x1F, 0xF8, 0x01, 0xFE, 0x0F, 0xFC, 0x03, 0xFE, 0x0F, 0xFC, 0x07, 0xFC, \ + 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, 0x07, 0xFF, 0x1F, 0xFC, \ + 0x07, 0xFE, 0x0F, 0xFC, 0x07, 0xFC, 0x0F, 0xFC, 0x0F, 0xF8, 0x07, 0xFE, 0x0F, 0xE0, 0x01, 0xFE, 0x1F, 0x00, 0x00, 0xFF, \ + 0x3F, 0x00, 0x80, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x38 (56: '8')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFE, 0xFF, \ + 0xFF, 0x00, 0xF0, 0xFF, 0x3F, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0xC0, 0xFF, 0x0F, 0x70, 0x80, 0xFF, 0x07, 0xFC, 0x01, 0xFF, \ + 0x07, 0xFE, 0x03, 0xFF, 0x03, 0xFF, 0x03, 0xFF, 0x83, 0xFF, 0x07, 0xFE, 0x83, 0xFF, 0x07, 0xFE, 0x83, 0xFF, 0x0F, 0xFC, \ + 0xC1, 0xFF, 0x0F, 0xFC, 0xC1, 0xFF, 0x0F, 0xFC, 0xC1, 0xFF, 0x0F, 0xFC, 0x83, 0xFF, 0x07, 0xFC, 0x83, 0xFF, 0x07, 0xFC, \ + 0x83, 0xFF, 0x07, 0xFC, 0x03, 0xFF, 0x03, 0xF8, 0x03, 0xFE, 0x01, 0xF8, 0x07, 0x7C, 0x00, 0xF8, 0x0F, 0x00, 0x00, 0xF8, \ + 0x1F, 0x00, 0x10, 0xF8, 0x3F, 0x00, 0x1C, 0xFC, 0xFF, 0x00, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x1F, 0xFC, \ + 0xFF, 0xFF, 0x1F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFC, 0xFF, 0xFF, 0x0F, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, \ + 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x81, 0xFF, 0xCF, 0xFF, 0x80, 0xFF, 0x0F, 0x3E, 0xC0, 0xFF, 0x0F, 0x00, 0xE0, 0xFF, \ + 0x0F, 0x00, 0xF0, 0xFF, 0x0F, 0x00, 0xFC, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x39 (57: '9')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0x1F, 0xE0, 0x0F, 0xE3, 0xC7, 0xFF, \ + 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xE3, 0xFF, 0xC3, 0xFF, 0x87, 0xEF, 0x0F, 0xE0, 0x1F, 0xE0, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x63 (99: 'c')*/ \ + 0xFF, 0xFB, 0x7F, 0xC0, 0x3F, 0xC0, 0x1F, 0xFF, 0x1F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x03, 0xF0, 0x03, 0xF0, \ + 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, 0x9F, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x66 (102: 'f')*/ \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE3, 0xFF, 0xDD, 0xFF, 0xDD, 0xFF, 0xDD, 0xFF, 0xE3, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, /* Character 0x20 (32: 'degree')*/ diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorManager.h b/examples/refrigerator-app/silabs/include/RefrigeratorManager.h new file mode 100644 index 0000000000..669fd833f4 --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorManager.h @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once +#include "AppEvent.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters::RefrigeratorAlarm; +using namespace chip::app::Clusters::RefrigeratorAlarm::Attributes; +using namespace chip::app::Clusters::TemperatureControl; +using namespace chip::app::Clusters::TemperatureControl::Attributes; +using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; +using namespace chip::DeviceLayer; +using chip::Protocols::InteractionModel::Status; + +class RefrigeratorManager +{ +public: + CHIP_ERROR Init(); + void TempCtrlAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, uint16_t size); + void RefAlaramAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, uint16_t size); + uint8_t GetMode(); + int8_t GetCurrentTemp(); + int8_t SetMode(); + +private: + friend RefrigeratorManager & RefrigeratorMgr(); + + int16_t mCurrentMode; + int16_t mStartUpMode; + int16_t mOnMode; + + int16_t mTemperatureSetpoint; + int16_t mMinTemperature; + int16_t mMaxTemperature; + + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mMask; + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mState; + chip::app::Clusters::RefrigeratorAlarm::AlarmBitmap mSupported; + + int8_t ConvertToPrintableTemp(int16_t temperature); + static RefrigeratorManager sRefrigeratorMgr; +}; + +inline RefrigeratorManager & RefrigeratorMgr() +{ + return RefrigeratorManager::sRefrigeratorMgr; +} diff --git a/examples/refrigerator-app/silabs/include/RefrigeratorUI.h b/examples/refrigerator-app/silabs/include/RefrigeratorUI.h new file mode 100644 index 0000000000..cf157420fb --- /dev/null +++ b/examples/refrigerator-app/silabs/include/RefrigeratorUI.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "RefrigeratorIcons.h" +#include "glib.h" +#include "lcd.h" + +class RefrigeratorUI +{ + +public: + static void DrawUI(GLIB_Context_t * glibContext); + static void SetCurrentTemp(int8_t temp); + static void SetMode(uint8_t mode); + +private: + static void DrawHeader(GLIB_Context_t * glibContext); + static void DrawFooter(GLIB_Context_t * glibContext, bool autoMode = true); + static void DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp, bool isCelsius = true); + static void DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data, + uint32_t size); + static void DrawSetPoint(GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine); +}; diff --git a/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h b/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h new file mode 100644 index 0000000000..2c13cd1f4a --- /dev/null +++ b/examples/refrigerator-app/silabs/include/refrigerator-and-temperature-controlled-cabinet-mode.h @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace RefrigeratorAndTemperatureControlledCabinetMode { + +const uint8_t ModeNormal = 0; +const uint8_t ModeRapidCool = 1; +const uint8_t ModeRapidFreeze = 2; + +/// This is an application level delegate to handle LaundryWasherMode commands according to the specific business logic. +class RefrigeratorAndTemperatureControlledCabinetModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsNoarmal[1] = { { .value = to_underlying(ModeTag::kAuto) } }; + ModeTagStructType modeTagsRapidCool[1] = { { .value = to_underlying(ModeTag::kRapidCool) } }; + ModeTagStructType modeTagsRapidFreeze[3] = { { .value = to_underlying(ModeBase::ModeTag::kMax) }, + { .value = to_underlying(ModeTag::kRapidFreeze) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Normal"), + .mode = ModeNormal, + .modeTags = DataModel::List(modeTagsNoarmal) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Rapid Cool"), + .mode = ModeRapidCool, + .modeTags = DataModel::List(modeTagsRapidCool) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Rapid Freeze"), + .mode = ModeRapidFreeze, + .modeTags = DataModel::List(modeTagsRapidFreeze) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + +public: + ~RefrigeratorAndTemperatureControlledCabinetModeDelegate() override = default; +}; + +ModeBase::Instance * Instance(); + +void Shutdown(); + +} // namespace RefrigeratorAndTemperatureControlledCabinetMode + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/refrigerator-app/silabs/openthread.gn b/examples/refrigerator-app/silabs/openthread.gn new file mode 100644 index 0000000000..01a7070afc --- /dev/null +++ b/examples/refrigerator-app/silabs/openthread.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2024 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" + chip_openthread_ftd = true + + import("//openthread.gni") +} diff --git a/examples/refrigerator-app/silabs/openthread.gni b/examples/refrigerator-app/silabs/openthread.gni new file mode 100644 index 0000000000..1b4d67ff84 --- /dev/null +++ b/examples/refrigerator-app/silabs/openthread.gni @@ -0,0 +1,26 @@ +# Copyright (c) 2024 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}/src/platform/silabs/efr32/args.gni") + +silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +app_data_model = "${chip_root}/examples/refrigerator-app/silabs/data_model:silabs-refrigerator" +chip_enable_ota_requestor = true +chip_enable_openthread = true + +openthread_external_platform = + "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" diff --git a/examples/refrigerator-app/silabs/src/AppTask.cpp b/examples/refrigerator-app/silabs/src/AppTask.cpp new file mode 100644 index 0000000000..d2def279be --- /dev/null +++ b/examples/refrigerator-app/silabs/src/AppTask.cpp @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2024 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. + */ + +/********************************************************** + * Includes + *********************************************************/ + +#include "AppTask.h" +#include "AppConfig.h" +#include "AppEvent.h" + +#include "LEDWidget.h" + +#ifdef DISPLAY_ENABLED +#include "RefrigeratorUI.h" +#include "lcd.h" +#ifdef QR_CODE_ENABLED +#include "qrcodegen.h" +#endif // QR_CODE_ENABLED +#endif // DISPLAY_ENABLED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/********************************************************** + * Defines and Constants + *********************************************************/ + +#define APP_FUNCTION_BUTTON 0 +#define APP_REFRIGERATOR 1 + +using namespace chip; +using namespace chip::app; +using namespace chip::TLV; +using namespace ::chip::DeviceLayer; + +/********************************************************** + * Variable declarations + *********************************************************/ + +/********************************************************** + * AppTask Definitions + *********************************************************/ + +AppTask AppTask::sAppTask; + +CHIP_ERROR AppTask::Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler); + +#ifdef DISPLAY_ENABLED + GetLCD().Init((uint8_t *) "Refrigrator-App"); +#endif + + err = BaseApplication::Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "BaseApplication::Init() failed"); + appError(err); + } + err = RefrigeratorMgr().Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "RefrigeratorMgr::Init() failed"); + appError(err); + } + + return err; +} + +CHIP_ERROR AppTask::StartAppTask() +{ + return BaseApplication::StartAppTask(AppTaskMain); +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + osMessageQueueId_t sAppEventQueue = *(static_cast(pvParameter)); + + CHIP_ERROR err = sAppTask.Init(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(AppServer, "AppTask.Init() failed"); + appError(err); + } + +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) + sAppTask.StartStatusLEDTimer(); +#endif + + ChipLogDetail(AppServer, "App Task started"); + while (true) + { + osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + sAppTask.DispatchEvent(&event); + eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, 0); + } + } +} + +void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction) +{ + AppEvent aEvent = {}; + aEvent.Type = AppEvent::kEventType_Button; + aEvent.ButtonEvent.Action = btnAction; + + if (button == APP_FUNCTION_BUTTON) + { + aEvent.Handler = BaseApplication::ButtonHandler; + sAppTask.PostEvent(&aEvent); + } +} diff --git a/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp b/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp new file mode 100644 index 0000000000..09ab827e9d --- /dev/null +++ b/examples/refrigerator-app/silabs/src/RefrigeratorManager.cpp @@ -0,0 +1,141 @@ +/* + * + * Copyright (c) 2024 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. + */ + +/********************************************************** + * Includes + *********************************************************/ + +#include "RefrigeratorManager.h" +#include "AppConfig.h" +#include "AppEvent.h" +#include "AppTask.h" +#include +#include +#include + +/********************************************************** + * Defines and Constants + *********************************************************/ + +using namespace chip; +using namespace ::chip::DeviceLayer; + +namespace RefAndTempAttr = chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Attributes; +namespace RefAlarmAttr = chip::app::Clusters::RefrigeratorAlarm::Attributes; +namespace TempCtrlAttr = chip::app::Clusters::TemperatureControl::Attributes; + +// set Parent Endpoint and Composition Type for an Endpoint +EndpointId kRefEndpointId = 1; +EndpointId kColdCabinetEndpointId = 2; +EndpointId kFreezeCabinetEndpointId = 3; + +RefrigeratorManager RefrigeratorManager::sRefrigeratorMgr; + +namespace { +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceRefrigerator = 0x41; +// Refrigerator Namespace: 0x41, tag 0x00 (Refrigerator) +constexpr const uint8_t kTagRefrigerator = 0x00; +// Refrigerator Namespace: 0x41, tag 0x01 (Freezer) +constexpr const uint8_t kTagFreezer = 0x01; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type refrigeratorTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagRefrigerator } }; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagFreezer } }; +} // namespace + +CHIP_ERROR RefrigeratorManager::Init() +{ + SetTreeCompositionForEndpoint(kRefEndpointId); + SetParentEndpointForEndpoint(kColdCabinetEndpointId, kRefEndpointId); + SetParentEndpointForEndpoint(kFreezeCabinetEndpointId, kRefEndpointId); + + // set TagList + SetTagList(kColdCabinetEndpointId, Span(refrigeratorTagList)); + SetTagList(kFreezeCabinetEndpointId, Span(freezerTagList)); + + app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); + return CHIP_NO_ERROR; +} + +int8_t RefrigeratorManager::ConvertToPrintableTemp(int16_t temperature) +{ + constexpr uint8_t kRoundUpValue = 50; + + // Round up the temperature as we won't print decimals on LCD + // Is it a negative temperature + if (temperature < 0) + { + temperature -= kRoundUpValue; + } + else + { + temperature += kRoundUpValue; + } + + return static_cast(temperature / 100); +} + +void RefrigeratorManager::TempCtrlAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, + uint16_t size) +{ + switch (attributeId) + { + case TempCtrlAttr::TemperatureSetpoint::Id: { + int16_t temperatureSetpoint = ConvertToPrintableTemp(static_cast(*value)); + mTemperatureSetpoint = temperatureSetpoint; + TempCtrlAttr::TemperatureSetpoint::Set(endpointId, temperatureSetpoint); + } + break; + default: { + ChipLogError(AppServer, "Unhandled Temperature controlled attribute %ld", attributeId); + return; + } + break; + } +} + +void RefrigeratorManager::RefAlaramAttributeChangeHandler(EndpointId endpointId, AttributeId attributeId, uint8_t * value, + uint16_t size) +{ + switch (attributeId) + { + case RefAlarmAttr::Mask::Id: { + auto mask = static_cast(*value); + mState = static_cast(mask); + RefAlarmAttr::Mask::Set(endpointId, mMask); + } + break; + + case RefAlarmAttr::State::Id: { + auto state = static_cast(*value); + mState = static_cast(state); + RefAlarmAttr::State::Set(endpointId, mState); + } + break; + + default: { + ChipLogError(AppServer, "Unhandled Refrigerator Alarm attribute %ld", attributeId); + return; + } + break; + } +} diff --git a/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp b/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp new file mode 100644 index 0000000000..655c803f21 --- /dev/null +++ b/examples/refrigerator-app/silabs/src/RefrigeratorUI.cpp @@ -0,0 +1,274 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "RefrigeratorUI.h" +#include "demo-ui-bitmaps.h" +#include "dmd.h" +#include "glib.h" +#include "lcd.h" +#include + +#if SL_WIFI && !defined(SLI_SI91X_MCU_INTERFACE) +// Only needed for wifi NCP devices +#include "spi_multiplex.h" +#endif // SL_WIFI + +// LCD line define +constexpr uint8_t kTempLcdInitialX = 30; + +// Bitmap +static const uint8_t silabsLogo[] = { SILABS_LOGO_SMALL }; +static const uint8_t matterLogoBitmap[] = { MATTER_LOGO_BITMAP }; + +static const uint8_t wifiLogo[] = { WIFI_BITMAP }; +static const uint8_t threadLogo[] = { THREAD_BITMAP }; +static const uint8_t bleLogo[] = { BLUETOOTH_ICON_SMALL }; + +static const unsigned char monaco_48pt[] = { MONACO_48PT }; +static const unsigned char heating_bits[] = { HEATING_BITMAP }; +static const unsigned char cooling_bits[] = { COOLING_BITMAP }; +static const unsigned char heating_cooling_bits[] = { HEATING_COOLING_BITMAP }; + +static int8_t mCurrentTempCelsius; +static uint8_t mMode; + +#ifdef SL_WIFI +#define UI_WIFI 1 +#else +#define UI_WIFI 0 +#endif + +/** + * @brief Draw the entire UI on the screen including header, footer, and temperature. + * @param GLIB_Context_t * pointer to the context for the GLIB library + */ +void RefrigeratorUI::DrawUI(GLIB_Context_t * glibContext) +{ + if (glibContext == nullptr) + { + ChipLogError(AppServer, "App Task started"); + return; + } + + GLIB_clear(glibContext); + DrawHeader(glibContext); + DrawCurrentTemp(glibContext, mCurrentTempCelsius); + DrawFooter(glibContext, false); + +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Set the current temperature of the refrigerator. + * @param int8_t temp The current temperature in Celsius + */ +void RefrigeratorUI::SetCurrentTemp(int8_t temp) +{ + mCurrentTempCelsius = temp; +} + +/** + * @brief Set the operating mode of the refrigerator. + * @param uint8_t mode Mode of the refrigerator (e.g., cooling, defrosting) + */ +void RefrigeratorUI::SetMode(uint8_t mode) +{ + mMode = mode; +} + +/** + * @brief Draw the header of the UI, usually displaying the title or current status. + * @param GLIB_Context_t * pointer to the context for the GLIB library + */ +void RefrigeratorUI::DrawHeader(GLIB_Context_t * glibContext) +{ + // Draw Silabs Corner icon + GLIB_drawBitmap(glibContext, SILABS_ICON_POSITION_X, STATUS_ICON_LINE, SILABS_LOGO_WIDTH, SILABS_LOGO_HEIGHT, silabsLogo); + // Draw BLE Icon + GLIB_drawBitmap(glibContext, BLE_ICON_POSITION_X, STATUS_ICON_LINE, BLUETOOTH_ICON_SIZE, BLUETOOTH_ICON_SIZE, bleLogo); + // Draw WiFi/OpenThread Icon + GLIB_drawBitmap(glibContext, NETWORK_ICON_POSITION_X, STATUS_ICON_LINE, (UI_WIFI) ? WIFI_BITMAP_HEIGHT : THREAD_BITMAP_WIDTH, + WIFI_BITMAP_HEIGHT, (UI_WIFI) ? wifiLogo : threadLogo); + // Draw Matter Icon + GLIB_drawBitmap(glibContext, MATTER_ICON_POSITION_X, STATUS_ICON_LINE, MATTER_LOGO_WIDTH, MATTER_LOGO_HEIGHT, matterLogoBitmap); +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Draw the footer of the UI, which may display additional information such as mode. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param bool autoMode Whether the refrigerator is in automatic mode + */ +void RefrigeratorUI::DrawFooter(GLIB_Context_t * glibContext, bool autoMode) +{ + // TODO:: Need to implement this function + +#if SL_LCDCTRL_MUX + sl_wfx_host_pre_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX + DMD_updateDisplay(); +#if SL_LCDCTRL_MUX + sl_wfx_host_post_lcd_spi_transfer(); +#endif // SL_LCDCTRL_MUX +} + +/** + * @brief Draw a 2 digit Temp of screen. Because of this Celsius is used by default + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param int8_t current Temperature in Celsius + * @param int8_t setPoint in Celsius + * @param bool isCelsius By default set to True. For future development + */ +void RefrigeratorUI::DrawCurrentTemp(GLIB_Context_t * glibContext, int8_t temp, bool isCelsius) +{ + uint8_t tempArray[2]; + uint8_t position_x = 10; + uint8_t * data; + + if (temp > 99 || temp < -99) + { + // Invalid temp for a house thermostat + return; + } + + if (temp < 0) + { + for (uint8_t y = 60; y < 64; y++) + { + for (uint8_t x = 1; x < 10; x++) + { + GLIB_drawPixel(glibContext, x, y); + } + } + + temp = temp * -1; + } + + // Draw Unit + if (isCelsius) + { + data = (uint8_t *) &monaco_48pt[DEGREE_INDEX]; + DrawFont(glibContext, 65, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + data = (uint8_t *) &monaco_48pt[CELSIUS_INDEX]; + DrawFont(glibContext, 70, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + } + else + { + data = (uint8_t *) &monaco_48pt[DEGREE_INDEX]; + DrawFont(glibContext, 65, 25, 15, data, MONACO_FONT_CH_LENGTH); // 25 to fit with f of fahrenheint + data = (uint8_t *) &monaco_48pt[FAHRENHEIT_INDEX]; + DrawFont(glibContext, 70, kTempLcdInitialX, 15, data, MONACO_FONT_CH_LENGTH); + } + + // Print Current temp + tempArray[0] = (uint8_t) ((temp / 10)); + tempArray[1] = (uint8_t) ((temp % 10)); + + for (uint8_t ch = 0; ch < 2; ch++) + { + data = (uint8_t *) &monaco_48pt[tempArray[ch] * MONACO_FONT_NB_LENGTH]; + DrawFont(glibContext, position_x, kTempLcdInitialX, MONACO_FONT_WIDTH, data, MONACO_FONT_NB_LENGTH); + position_x += MONACO_FONT_WIDTH; + } +} + +/** + * @brief Draw a font at a specified position on the screen. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param uint8_t initial_x X-coordinate for the starting position + * @param uint8_t initial_y Y-coordinate for the starting position + * @param uint8_t width Width of the font to be drawn + * @param uint8_t * data Pointer to the font data + * @param uint32_t size Size of the font data in bytes + */ +void RefrigeratorUI::DrawFont(GLIB_Context_t * glibContext, uint8_t initial_x, uint8_t initial_y, uint8_t width, uint8_t * data, + uint32_t size) +{ + uint8_t x = initial_x, y = initial_y; + for (uint16_t i = 0; i < size; i++) + { + for (uint8_t mask = 0; mask < 8; mask++) + { + if (!(data[i] & (0x01 << mask))) + { + GLIB_drawPixel(glibContext, x, y); + } + // Check line changes + if (((x - initial_x) % width) == 0 && x != initial_x) + { + x = initial_x; + y++; + // Font is 8 bit align with paddings bits; + mask = 8; + } + else + { + x++; + } + } + } +} + +/** + * @brief Draw the set point temperature on the screen. + * @param GLIB_Context_t * pointer to the context for the GLIB library + * @param int8_t setPoint The set point temperature in Celsius + * @param bool secondLine Whether to display on the second line (true) or first line (false) + */ +void RefrigeratorUI::DrawSetPoint(GLIB_Context_t * glibContext, int8_t setPoint, bool secondLine) +{ + char setPointLine[] = { '-', 'X', 'X', '\0' }; + + if (setPoint > 99 || setPoint < -99) + { + return; + } + + // Update SetPoint string + if (setPoint < 0) + { + setPointLine[0] = (setPoint < 0) ? '-' : ' '; + setPoint *= -1; + setPointLine[1] = ((setPoint / 10) + 0x30); + setPointLine[2] = ((setPoint % 10) + 0x30); + } + else + { + setPointLine[0] = ((setPoint / 10) + 0x30); + setPointLine[1] = ((setPoint % 10) + 0x30); + setPointLine[2] = '\0'; + } + + // Print SetPoint + GLIB_drawStringOnLine(glibContext, setPointLine, (secondLine) ? 8 : 7, GLIB_ALIGN_LEFT, 67, 0, true); +} diff --git a/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp b/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp new file mode 100644 index 0000000000..bd9febc75e --- /dev/null +++ b/examples/refrigerator-app/silabs/src/ZclCallbacks.cpp @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2024 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 handler for data model messages. + */ + +#include "AppConfig.h" +#include "RefrigeratorManager.h" +#include +#include +#include +#include + +#ifdef DIC_ENABLE +#include "dic_control.h" +#endif // DIC_ENABLE + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + switch (clusterId) + { + case app::Clusters::Identify::Id: + ChipLogProgress(Zcl, "Identify cluster ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", + ChipLogValueMEI(attributePath.mAttributeId), type, *value, size); + break; + case app::Clusters::RefrigeratorAlarm::Id: + RefrigeratorMgr().RefAlaramAttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size); +#ifdef DIC_ENABLE + dic::control::AttributeHandler(attributePath.mEndpointId, attributeId); +#endif // DIC_ENABLE + break; + case app::Clusters::TemperatureControl::Id: + RefrigeratorMgr().TempCtrlAttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size); +#ifdef DIC_ENABLE + dic::control::AttributeHandler(attributePath.mEndpointId, attributeId); +#endif // DIC_ENABLE + break; + default: + break; + } +} + +/** @brief Refrigerator Alarm 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 + * + */ +void emberAfRefrigeratorAlarmClusterInitCallback(EndpointId endpoint) {} + +/** @brief Temperature Control 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 + * + */ +void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) {} diff --git a/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp b/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp new file mode 100644 index 0000000000..443dcb7f6d --- /dev/null +++ b/examples/refrigerator-app/silabs/src/refrigerator-and-temperature-controlled-cabinet-mode.cpp @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RefrigeratorAndTemperatureControlledCabinetMode; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; +using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; + +static RefrigeratorAndTemperatureControlledCabinetModeDelegate * gRefrigeratorAndTemperatureControlledCabinetModeDelegate = nullptr; +static ModeBase::Instance * gRefrigeratorAndTemperatureControlledCabinetModeInstance = nullptr; + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RefrigeratorAndTemperatureControlledCabinetModeDelegate::HandleChangeToMode( + uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, + chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RefrigeratorAndTemperatureControlledCabinetModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, + List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +ModeBase::Instance * RefrigeratorAndTemperatureControlledCabinetMode::Instance() +{ + return gRefrigeratorAndTemperatureControlledCabinetModeInstance; +} + +void RefrigeratorAndTemperatureControlledCabinetMode::Shutdown() +{ + if (gRefrigeratorAndTemperatureControlledCabinetModeInstance != nullptr) + { + delete gRefrigeratorAndTemperatureControlledCabinetModeInstance; + gRefrigeratorAndTemperatureControlledCabinetModeInstance = nullptr; + } + if (gRefrigeratorAndTemperatureControlledCabinetModeDelegate != nullptr) + { + delete gRefrigeratorAndTemperatureControlledCabinetModeDelegate; + gRefrigeratorAndTemperatureControlledCabinetModeDelegate = nullptr; + } +} + +void emberAfRefrigeratorAndTemperatureControlledCabinetModeClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gRefrigeratorAndTemperatureControlledCabinetModeDelegate == nullptr && + gRefrigeratorAndTemperatureControlledCabinetModeInstance == nullptr); + gRefrigeratorAndTemperatureControlledCabinetModeDelegate = + new RefrigeratorAndTemperatureControlledCabinetMode::RefrigeratorAndTemperatureControlledCabinetModeDelegate; + gRefrigeratorAndTemperatureControlledCabinetModeInstance = + new ModeBase::Instance(gRefrigeratorAndTemperatureControlledCabinetModeDelegate, 0x1, + RefrigeratorAndTemperatureControlledCabinetMode::Id, chip::to_underlying(Feature::kOnOff)); + gRefrigeratorAndTemperatureControlledCabinetModeInstance->Init(); +} diff --git a/examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip b/examples/refrigerator-app/silabs/third_party/connectedhomeip similarity index 100% rename from examples/all-clusters-minimal-app/tizen/third_party/connectedhomeip rename to examples/refrigerator-app/silabs/third_party/connectedhomeip diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index c6af761d33..4f981a8f17 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -585,6 +585,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/shell/mbed/README.md b/examples/shell/mbed/README.md index 16a9f987bc..c2991270a5 100644 --- a/examples/shell/mbed/README.md +++ b/examples/shell/mbed/README.md @@ -207,7 +207,7 @@ The example supports building and running on the following mbed-enabled devices: - More details and guidelines about porting new hardware into the Matter project with Mbed OS can be found in - [MbedNewTarget](../../../docs/guides/mbedos_add_new_target.md) + [MbedNewTarget](../../../docs/platforms/mbedos/mbedos_add_new_target.md) - Some useful information about HW platform specific settings can be found in `shell/mbed/mbed_app.json`. Information about this file syntax and its meaning in mbed-os project can be found here: diff --git a/examples/shell/openiotsdk/README.md b/examples/shell/openiotsdk/README.md index b633fa7b01..7670c19437 100644 --- a/examples/shell/openiotsdk/README.md +++ b/examples/shell/openiotsdk/README.md @@ -12,7 +12,7 @@ For more details see For information on how to build, run, test and debug this example and further information about the platform it is run on see -[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). +[Open IoT SDK examples](../../../docs/platforms/openiotsdk/openiotsdk_examples.md). The example name to use in the scripts is `shell`. diff --git a/examples/smoke-co-alarm-app/silabs/README.md b/examples/smoke-co-alarm-app/silabs/README.md index e16621df11..7928107b35 100644 --- a/examples/smoke-co-alarm-app/silabs/README.md +++ b/examples/smoke-co-alarm-app/silabs/README.md @@ -220,7 +220,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -317,7 +317,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options 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 fbba1a8ab8..a593b61e3a 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 @@ -1075,6 +1075,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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/asr/README.md b/examples/temperature-measurement-app/asr/README.md index 72c01f8973..1382849e59 100755 --- a/examples/temperature-measurement-app/asr/README.md +++ b/examples/temperature-measurement-app/asr/README.md @@ -14,7 +14,7 @@ temperature sensor. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index 71210102d9..a3276ae372 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -3,9 +3,9 @@ This example is meant to represent a minimal-sized application. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- 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 925b3ee868..84acb6b3c4 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -715,6 +715,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/asr/README.md b/examples/thermostat/asr/README.md index 0392b82086..1422efee18 100755 --- a/examples/thermostat/asr/README.md +++ b/examples/thermostat/asr/README.md @@ -14,7 +14,7 @@ temperature from local sensor. ## Building and Commissioning Please refer -[Building and Commissioning](../../../docs/guides/asr_getting_started_guide.md#building-the-example-application) +[Building and Commissioning](../../../docs/platforms/asr/asr_getting_started_guide.md#building-the-example-application) guides to get started ``` diff --git a/examples/thermostat/genio/README.md b/examples/thermostat/genio/README.md index 4ae5bba017..b9630f7e0a 100644 --- a/examples/thermostat/genio/README.md +++ b/examples/thermostat/genio/README.md @@ -86,7 +86,7 @@ MediaTek platform. Chip tool standalone, Android or iOS app [CHIP - Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md) + Tool]](https://github.com/project-chip/connectedhomeip/blob/master/docs/development_controllers/chip-tool/chip_tool_guide.md) Here is an example with the CHIP Tool controller: diff --git a/examples/thermostat/infineon/cyw30739/README.md b/examples/thermostat/infineon/cyw30739/README.md index 0b94884fe1..d514fefdf6 100644 --- a/examples/thermostat/infineon/cyw30739/README.md +++ b/examples/thermostat/infineon/cyw30739/README.md @@ -212,7 +212,7 @@ Put the CYW30739 in to the recovery mode before running the flash script. - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. - For this example to work, it is necessary to have a second CYW30739 device diff --git a/examples/thermostat/nxp/linux-imx/imx8m/README.md b/examples/thermostat/nxp/linux-imx/imx8m/README.md index e20ff1065d..01941f58e7 100644 --- a/examples/thermostat/nxp/linux-imx/imx8m/README.md +++ b/examples/thermostat/nxp/linux-imx/imx8m/README.md @@ -1,4 +1,4 @@ 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/nxp_imx8m_linux_examples.md) +[README document](../../../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details. diff --git a/examples/thermostat/nxp/linux-se05x/README.md b/examples/thermostat/nxp/linux-se05x/README.md index e20ff1065d..01941f58e7 100644 --- a/examples/thermostat/nxp/linux-se05x/README.md +++ b/examples/thermostat/nxp/linux-se05x/README.md @@ -1,4 +1,4 @@ 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/nxp_imx8m_linux_examples.md) +[README document](../../../../../docs/platforms/nxp/nxp_imx8m_linux_examples.md) for details. diff --git a/examples/thermostat/nxp/zap/thermostat_matter_br.matter b/examples/thermostat/nxp/zap/thermostat_matter_br.matter index 9b35e9d22b..72c23a4e22 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_br.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_br.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index f02c08a6a5..49856ff010 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index a583ab8f96..1aad4ca9b0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -866,6 +866,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 1f7b2191bc..86383cf904 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -913,6 +913,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thermostat/silabs/README.md b/examples/thermostat/silabs/README.md index 25ba47891b..3205352bf0 100644 --- a/examples/thermostat/silabs/README.md +++ b/examples/thermostat/silabs/README.md @@ -206,7 +206,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -324,7 +324,7 @@ tracking code inside the `trackAlloc` and `trackFree` function For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 08106665d9..1c062da0fe 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -974,6 +974,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/thread-br-app/esp32/README.md b/examples/thread-br-app/esp32/README.md index 576339cd43..2578a106ab 100644 --- a/examples/thread-br-app/esp32/README.md +++ b/examples/thread-br-app/esp32/README.md @@ -4,9 +4,9 @@ A prototype application that demonstrates OpenThread Border Router on ESP32-S3 + ESP32-H2 Thread Border Router DevKit Board. Please -[setup ESP-IDF and CHIP Environment](../../../docs/guides/esp32/setup_idf_chip.md) +[setup ESP-IDF and CHIP Environment](../../../docs/platforms/esp32/setup_idf_chip.md) and refer -[building and commissioning](../../../docs/guides/esp32/build_app_and_commission.md) +[building and commissioning](../../../docs/platforms/esp32/build_app_and_commission.md) guides to get started. --- diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.matter b/examples/thread-br-app/thread-br-common/thread-br-app.matter index ce073c319b..63a6a567a3 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.matter +++ b/examples/thread-br-app/thread-br-common/thread-br-app.matter @@ -535,6 +535,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/tv-app/openiotsdk/README.md b/examples/tv-app/openiotsdk/README.md index 8702f294e1..5a148260dd 100644 --- a/examples/tv-app/openiotsdk/README.md +++ b/examples/tv-app/openiotsdk/README.md @@ -19,7 +19,7 @@ paired into an existing Matter network and can be controlled by it. For information on how to build, run, test and debug this example and further information about the platform it is run on see -[Open IoT SDK examples](../../../docs/guides/openiotsdk_examples.md). +[Open IoT SDK examples](../../../docs/platforms/openiotsdk/openiotsdk_examples.md). The example name to use in the scripts is `tv-app`. @@ -68,7 +68,7 @@ Run the `app help` command to get all supported commands and their usage. ## Commissioning Read the -[Open IoT SDK commissioning guide](../../../docs/guides/openiotsdk_commissioning.md) +[Open IoT SDK commissioning guide](../../../docs/platforms/openiotsdk/openiotsdk_commissioning.md) to see how to use the Matter controller to commission and control the application. diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 6ea0892fac..b3a06cd2d3 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -937,6 +937,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1028,6 +1029,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; 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/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java index fc3ba6cd1d..f711096a22 100644 --- a/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java +++ b/examples/tv-casting-app/android/App/app/src/main/java/com/matter/casting/ConnectionExampleFragment.java @@ -29,6 +29,7 @@ import android.widget.TextView; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import com.R; import com.matter.casting.core.CastingPlayer; import com.matter.casting.support.CommissionerDeclaration; @@ -208,36 +209,41 @@ public void handle(CommissionerDeclaration cd) { Log.i(TAG, "CastingPlayer CommissionerDeclaration message received: "); cd.logDetail(); - getActivity() - .runOnUiThread( - () -> { - connectionFragmentStatusTextView.setText( - "CommissionerDeclaration message received from Casting Player: \n\n"); - if (cd.getCommissionerPasscode()) { + FragmentActivity activity = getActivity(); + // Prevent possible NullPointerException. This callback could be called when + // this Fragment is not attached to its host activity or when the fragment's + // lifecycle is not in a valid state for interacting with the activity. + if (activity != null && !activity.isFinishing()) { + activity.runOnUiThread( + () -> { + connectionFragmentStatusTextView.setText( + "CommissionerDeclaration message received from Casting Player: \n\n"); + if (cd.getCommissionerPasscode()) { - displayPasscodeInputDialog(getActivity()); + displayPasscodeInputDialog(activity); + connectionFragmentStatusTextView.setText( + "CommissionerDeclaration message received from Casting Player: A passcode is now displayed for the user by the Casting Player. \n\n"); + } + if (cd.getCancelPasscode()) { + if (useCommissionerGeneratedPasscode) { connectionFragmentStatusTextView.setText( - "CommissionerDeclaration message received from Casting Player: A passcode is now displayed for the user by the Casting Player. \n\n"); - } - if (cd.getCancelPasscode()) { - if (useCommissionerGeneratedPasscode) { - connectionFragmentStatusTextView.setText( - "CastingPlayer/Commissioner-Generated passcode connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); - } else { - connectionFragmentStatusTextView.setText( - "Connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); - } - if (passcodeDialog != null && passcodeDialog.isShowing()) { - passcodeDialog.dismiss(); - } + "CastingPlayer/Commissioner-Generated passcode connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); + } else { + connectionFragmentStatusTextView.setText( + "Connection attempt cancelled by the CastingPlayer/Commissioner user. \n\nRoute back to exit. \n\n"); } - if (cd.getErrorCode() != CommissionerDeclaration.CdError.noError) { - commissionerDeclarationErrorTextView.setText( - "CommissionerDeclaration error from CastingPlayer: " - + cd.getErrorCode().getDescription()); + if (passcodeDialog != null && passcodeDialog.isShowing()) { + passcodeDialog.dismiss(); } - }); + } + if (cd.getErrorCode() != CommissionerDeclaration.CdError.noError) { + commissionerDeclarationErrorTextView.setText( + "CommissionerDeclaration error from CastingPlayer: " + + cd.getErrorCode().getDescription()); + } + }); + } } }; diff --git a/examples/tv-casting-app/android/README.md b/examples/tv-casting-app/android/README.md index b620c1ac5c..047f960f81 100644 --- a/examples/tv-casting-app/android/README.md +++ b/examples/tv-casting-app/android/README.md @@ -21,7 +21,7 @@ the TV. ## Requirements for building Refer to -[this file](../../../docs/guides/android_building.md#requirements-for-building) +[this file](../../../docs/platforms/android/android_building.md#requirements-for-building) to download the recommended version for the Android SDK and NDK for your machine. Set the `$ANDROID_HOME` environment variable to where the SDK is downloaded and the `$ANDROID_NDK_HOME` environment variable to point to where diff --git a/examples/tv-casting-app/linux/simple-app-helper.cpp b/examples/tv-casting-app/linux/simple-app-helper.cpp index 115fe9f786..f354aa094f 100644 --- a/examples/tv-casting-app/linux/simple-app-helper.cpp +++ b/examples/tv-casting-app/linux/simple-app-helper.cpp @@ -289,7 +289,7 @@ void ConnectionHandler(CHIP_ERROR err, matter::casting::core::CastingPlayer * ca kDesiredEndpointVendorId); } - ChipLogProgress(AppServer, "simple-app-helper.cpp::ConnectionHandler(): Getting endpoints avaiable for demo interactions"); + ChipLogProgress(AppServer, "simple-app-helper.cpp::ConnectionHandler(): Getting endpoints available for demo interactions"); std::vector> endpoints = castingPlayer->GetEndpoints(); LogEndpointsDetails(endpoints); @@ -450,6 +450,9 @@ CHIP_ERROR CommandHandler(int argc, char ** argv) targetCastingPlayer->VerifyOrEstablishConnection(connectionCallbacks, matter::casting::core::kCommissioningWindowTimeoutSec, idOptions); + ChipLogProgress(AppServer, "CommandHandler() request, VerifyOrEstablishConnection() called, calling StopDiscovery()"); + // Stop discovery since we have discovered, and are now connecting to the desired CastingPlayer. + matter::casting::core::CastingPlayerDiscovery::GetInstance()->StopDiscovery(); return CHIP_NO_ERROR; } if (strcmp(argv[0], "setcommissionerpasscode") == 0) diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp index 83fc6b4b56..37d442f714 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingPlayer.cpp @@ -380,10 +380,10 @@ chip::Inet::IPAddress * CastingPlayer::GetIpAddressForUDCRequest() void CastingPlayer::FindOrEstablishSession(void * clientContext, chip::OnDeviceConnected onDeviceConnected, chip::OnDeviceConnectionFailure onDeviceConnectionFailure) { - ChipLogProgress(AppServer, "CastingPlayer.FindOrEstablishSession called on nodeId=0x" ChipLogFormatX64 " fabricIndex=%d", + 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")); + ChipLogError(AppServer, "CastingPlayer::FindOrEstablishSession() called on invalid nodeId/fabricIndex")); ConnectionContext * connectionContext = new ConnectionContext(clientContext, this, onDeviceConnected, onDeviceConnectionFailure); diff --git a/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp b/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp index c89b899bf5..a54d1013d3 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CommissionerDeclarationHandler.cpp @@ -38,18 +38,24 @@ CommissionerDeclarationHandler * CommissionerDeclarationHandler::GetInstance() return sCommissionerDeclarationHandler_; } -// TODO: In the following PRs. Implement setHandler() for CommissionerDeclaration messages and expose messages to higher layers for -// Linux, Android and iOS. void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( const chip::Transport::PeerAddress & source, chip::Protocols::UserDirectedCommissioning::CommissionerDeclaration cd) { - ChipLogProgress(AppServer, - "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), calling CloseCommissioningWindow()"); - // Close the commissioning window. Since we recived a CommissionerDeclaration message from the Commissioner, we know that - // commissioning via AccountLogin cluster failed. We will open a new commissioningWindow prior to sending the next - // IdentificationDeclaration Message to the Commissioner. - chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); - support::ChipDeviceEventHandler::SetUdcStatus(false); + ChipLogProgress(AppServer, "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage()"); + + // During UDC with CastingPlayer/Commissioner-Generated Passcode, the Commissioner responds with a CommissionerDeclaration + // message with CommissionerPasscode set to true. The CommissionerPasscode flag indicates that a Passcode is now displayed for + // the user by the CastingPlayer /Commissioner. With this CommissionerDeclaration message, we also know that commissioning via + // AccountLogin cluster has failed. Therefore, we close the commissioning window. We will open a new commissioning window prior + // to sending the next/2nd IdentificationDeclaration message to the Commissioner. + if (cd.GetCommissionerPasscode()) + { + ChipLogProgress(AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), calling CloseCommissioningWindow()"); + // Close the commissioning window. + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + support::ChipDeviceEventHandler::SetUdcStatus(false); + } // Flag to indicate when the CastingPlayer/Commissioner user has decided to exit the commissioning process. if (cd.GetCancelPasscode()) @@ -57,6 +63,9 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( ChipLogProgress(AppServer, "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage(), Got CancelPasscode parameter, " "CastingPlayer/Commissioner user has decided to exit the commissioning attempt. Connection aborted."); + // Close the commissioning window. + chip::Server::GetInstance().GetCommissioningWindowManager().CloseCommissioningWindow(); + support::ChipDeviceEventHandler::SetUdcStatus(false); // Since the CastingPlayer/Commissioner user has decided to exit the commissioning process, we cancel the ongoing // connection attempt without notifying the CastingPlayer/Commissioner. Therefore the // shouldSendIdentificationDeclarationMessage flag in the internal StopConnecting() API call is set to false. The @@ -65,12 +74,7 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( // and user 2 might be controlling the CastingPlayer/Commissioner TV. CastingPlayer * targetCastingPlayer = CastingPlayer::GetTargetCastingPlayer(); // Avoid crashing if we recieve this CommissionerDeclaration message when targetCastingPlayer is nullptr. - if (targetCastingPlayer == nullptr) - { - ChipLogError(AppServer, - "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage() targetCastingPlayer is nullptr"); - } - else + if (targetCastingPlayer != nullptr) { CHIP_ERROR err = targetCastingPlayer->StopConnecting(false); if (err != CHIP_NO_ERROR) @@ -82,6 +86,11 @@ void CommissionerDeclarationHandler::OnCommissionerDeclarationMessage( err.Format()); } } + else + { + ChipLogError(AppServer, + "CommissionerDeclarationHandler::OnCommissionerDeclarationMessage() targetCastingPlayer is nullptr"); + } } if (mCmmissionerDeclarationCallback_) diff --git a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h index 734f1e3d5a..85e67dbfe9 100644 --- a/examples/tv-casting-app/tv-casting-common/core/Endpoint.h +++ b/examples/tv-casting-app/tv-casting-common/core/Endpoint.h @@ -105,7 +105,6 @@ class Endpoint : public std::enable_shared_from_this */ std::vector GetServerList() { - ChipLogProgress(AppServer, "Endpoint::GetServerList() mClusters.size(): %d", static_cast(mClusters.size())); std::vector serverList; for (auto const & cluster : mClusters) { @@ -123,7 +122,6 @@ class Endpoint : public std::enable_shared_from_this template void RegisterCluster(const chip::ClusterId clusterId) { - ChipLogProgress(AppServer, "Endpoint::RegisterCluster() Registering clusterId %d for endpointId %d", clusterId, GetId()); static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); auto cluster = std::make_shared(shared_from_this()); cluster->SetUp(); @@ -137,7 +135,6 @@ class Endpoint : public std::enable_shared_from_this memory::Strong GetCluster() { static_assert(std::is_base_of::value, "T must be derived from BaseCluster"); - ChipLogProgress(AppServer, "Endpoint::GetCluster() mClusters.size(): %d", static_cast(mClusters.size())); for (const auto & pair : mClusters) { auto cluster = std::dynamic_pointer_cast(pair.second); @@ -151,8 +148,8 @@ class Endpoint : public std::enable_shared_from_this void LogDetail() const { - ChipLogProgress(AppServer, "Endpoint::LogDetail() Endpoint ID: %d, Vendor ID: %d, Product ID: %d", mAttributes.mId, - mAttributes.mVendorId, mAttributes.mProductId); + ChipLogProgress(AppServer, "Endpoint::LogDetail() Endpoint ID: %d, Vendor ID: %d, Product ID: %d, Clusters: %d", + mAttributes.mId, mAttributes.mVendorId, mAttributes.mProductId, static_cast(mClusters.size())); } }; diff --git a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp index 93bd00616d..1ddf40a9b2 100644 --- a/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/CastingStore.cpp @@ -78,8 +78,9 @@ std::vector CastingStore::ReadAll() 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())); + VerifyOrReturnValue( + err == CHIP_NO_ERROR, std::vector(), + ChipLogError(AppServer, "CastingStore::ReadAll() 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)); @@ -252,6 +253,9 @@ std::vector CastingStore::ReadAll() if (endpointContainerTagNum == kCastingPlayerEndpointIdTag) { err = reader.Get(endpointAttributes.mId); + // Log which endpoints we cached. + ChipLogProgress(AppServer, "CastingStore::ReadAll() Endpoints container endpointAttributes.mId: %d", + endpointAttributes.mId); VerifyOrReturnValue(err == CHIP_NO_ERROR, std::vector(), ChipLogError(AppServer, "TLVReader.Get failed %" CHIP_ERROR_FORMAT, err.Format())); continue; @@ -475,7 +479,7 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer for (auto & castingPlayer : castingPlayers) { - ChipLogProgress(AppServer, "CastingStore::WriteAll() writing castingPlayer:"); + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer:"); chip::TLV::TLVType castingPlayerContainerType; // CastingPlayer container starts ReturnErrorOnFailure( @@ -547,7 +551,8 @@ CHIP_ERROR CastingStore::WriteAll(std::vector castingPlayer ReturnErrorOnFailure(tlvWriter.StartContainer(chip::TLV::ContextTag(kCastingPlayerEndpointServerListContainerTag), chip::TLV::kTLVType_Structure, serverListContainerType)); std::vector serverList = endpoint->GetServerList(); - ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint ServerList:"); + ChipLogProgress(AppServer, "CastingStore::WriteAll() writing CastingPlayer Endpoint ID: %d ServerList.size(): %d", + endpoint->GetId(), static_cast(serverList.size())); for (chip::ClusterId clusterId : serverList) { ChipLogProgress(AppServer, "CastingStore::WriteAll() clusterId: %d", clusterId); @@ -586,7 +591,7 @@ CHIP_ERROR CastingStore::DeleteAll() 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()); + ChipLogProgress(AppServer, "CastingStore::DeleteAll() ignoring error %" CHIP_ERROR_FORMAT, err.Format()); return CHIP_NO_ERROR; } return err; @@ -594,7 +599,7 @@ CHIP_ERROR CastingStore::DeleteAll() CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) { - ChipLogProgress(AppServer, "CastingStore::Delete"); + ChipLogProgress(AppServer, "CastingStore::Delete()"); // Read cache of CastingPlayers std::vector castingPlayers = ReadAll(); @@ -608,7 +613,7 @@ CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) if (it != castingPlayers.end()) { - ChipLogProgress(AppServer, "CastingStore::Delete deleting CastingPlayer %s from CastingStore cache", it->GetId()); + ChipLogProgress(AppServer, "CastingStore::Delete() deleting CastingPlayer %s from CastingStore cache", it->GetId()); castingPlayers.erase(it); return WriteAll(castingPlayers); } @@ -618,7 +623,7 @@ CHIP_ERROR CastingStore::Delete(core::CastingPlayer castingPlayer) void CastingStore::OnFabricRemoved(const chip::FabricTable & fabricTable, chip::FabricIndex fabricIndex) { - ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved"); + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved()"); // Read cache of CastingPlayers std::vector castingPlayers = ReadAll(); @@ -633,12 +638,15 @@ void CastingStore::OnFabricRemoved(const chip::FabricTable & fabricTable, chip:: if (it != castingPlayers.end()) { - ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved deleting CastingPlayer %s from CastingStore cache", + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved() deleting CastingPlayer %s from CastingStore cache", it->GetId()); castingPlayers.erase(it); WriteAll(castingPlayers); } } + CHIP_ERROR err = chip::Server::GetInstance().GetSessionResumptionStorage()->DeleteAll(fabricIndex); + ChipLogProgress(AppServer, "CastingStore::OnFabricRemoved() SessionResumptionStorage.DeleteAll(%d) status %" CHIP_ERROR_FORMAT, + fabricIndex, err.Format()); } }; // namespace support diff --git a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp index cf8ca82366..f027c8d1c4 100644 --- a/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp @@ -62,6 +62,7 @@ void ChipDeviceEventHandler::Handle(const chip::DeviceLayer::ChipDeviceEvent * e CastingPlayer::GetTargetCastingPlayer()->SetNodeId(targetNodeId); CastingPlayer::GetTargetCastingPlayer()->SetFabricIndex(targetFabricIndex); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::Handle() calling FindOrEstablishSession()"); CastingPlayer::GetTargetCastingPlayer()->FindOrEstablishSession( nullptr, [](void * context, chip::Messaging::ExchangeManager & exchangeMgr, const chip::SessionHandle & sessionHandle) { @@ -144,12 +145,12 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL bool & runPostCommissioning, chip::NodeId & targetNodeId, chip::FabricIndex & targetFabricIndex) { - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster called"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() called"); if (CastingPlayer::GetTargetCastingPlayer()->IsConnected()) { // re-use existing nodeId and fabricIndex - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster already connected to video player"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() already connected to video player"); runPostCommissioning = true; targetNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); targetFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); @@ -159,7 +160,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL else if (sUdcInProgress) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster UDC is in progress while handling " + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() UDC is in progress while handling " "kBindingsChangedViaCluster with " "fabricIndex: %d", event->BindingsChanged.fabricIndex); @@ -170,7 +171,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL for (const auto & binding : chip::BindingTable::GetInstance()) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Read cached binding type=%d fabrixIndex=%d " + "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, @@ -178,7 +179,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex) { ChipLogProgress(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster Matched accessingFabricIndex with " + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() Matched accessingFabricIndex with " "nodeId=0x" ChipLogFormatX64, ChipLogValueX64(binding.nodeId)); targetNodeId = binding.nodeId; @@ -190,9 +191,10 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL if (targetNodeId == 0 && runPostCommissioning == false) { - ChipLogError(AppServer, - "ChipDeviceEventHandler::HandleBindingsChangedViaCluster accessingFabricIndex: %d did not match bindings", - event->BindingsChanged.fabricIndex); + ChipLogError( + AppServer, + "ChipDeviceEventHandler::HandleBindingsChangedViaCluster() accessingFabricIndex: %d did not match bindings", + event->BindingsChanged.fabricIndex); CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_ERROR_INCORRECT_STATE, CastingPlayer::GetTargetCastingPlayer()); return; @@ -204,7 +206,7 @@ void ChipDeviceEventHandler::HandleCommissioningComplete(const chip::DeviceLayer bool & runPostCommissioning, chip::NodeId & targetNodeId, chip::FabricIndex & targetFabricIndex) { - ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleCommissioningComplete called"); + ChipLogProgress(AppServer, "ChipDeviceEventHandler::HandleCommissioningComplete() called"); sUdcInProgress = false; targetNodeId = event->CommissioningComplete.nodeId; targetFabricIndex = event->CommissioningComplete.fabricIndex; diff --git a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp index 44e76f628b..a54c4ddc59 100644 --- a/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp +++ b/examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp @@ -51,9 +51,17 @@ void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeM mExchangeMgr = exchangeMgr; mSessionHandle = sessionHandle; + chip::NodeId targetCastingPlayerNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); + chip::FabricIndex targetCastingPlayerFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); + ChipLogProgress(AppServer, + "EndpointListLoader::Initialize() targetCastingPlayerNodeId: 0x" ChipLogFormatX64 + ", targetCastingPlayerFabricIndex: %d", + ChipLogValueX64(targetCastingPlayerNodeId), targetCastingPlayerFabricIndex); + for (const auto & binding : chip::BindingTable::GetInstance()) { - if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + if (binding.type == MATTER_UNICAST_BINDING && targetCastingPlayerNodeId == binding.nodeId && + targetCastingPlayerFabricIndex == binding.fabricIndex) { // check to see if we discovered a new endpoint in the bindings chip::EndpointId endpointId = binding.remote; @@ -66,6 +74,8 @@ void EndpointListLoader::Initialize(chip::Messaging::ExchangeManager * exchangeM } } } + ChipLogProgress(AppServer, "EndpointListLoader::Initialize() mNewEndpointsToLoad++, mNewEndpointsToLoad: %lu", + mNewEndpointsToLoad); mPendingAttributeReads = mNewEndpointsToLoad * kTotalDesiredAttributes; mEndpointAttributesList = new EndpointAttributes[mNewEndpointsToLoad]; @@ -78,16 +88,24 @@ CHIP_ERROR EndpointListLoader::Load() VerifyOrReturnError(CastingPlayer::GetTargetCastingPlayer() != nullptr, CHIP_ERROR_INCORRECT_STATE); + chip::NodeId targetCastingPlayerNodeId = CastingPlayer::GetTargetCastingPlayer()->GetNodeId(); + chip::FabricIndex targetCastingPlayerFabricIndex = CastingPlayer::GetTargetCastingPlayer()->GetFabricIndex(); + ChipLogProgress(AppServer, + "EndpointListLoader::Load() targetCastingPlayerNodeId: 0x" ChipLogFormatX64 + ", targetCastingPlayerFabricIndex: %d", + ChipLogValueX64(targetCastingPlayerNodeId), targetCastingPlayerFabricIndex); + int endpointIndex = -1; bool isLoadingRequired = false; for (const auto & binding : chip::BindingTable::GetInstance()) { ChipLogProgress(AppServer, - "Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64 + "EndpointListLoader::Load() 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.value_or(0))); - if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId) + if (binding.type == MATTER_UNICAST_BINDING && targetCastingPlayerNodeId == binding.nodeId && + targetCastingPlayerFabricIndex == binding.fabricIndex) { // if we discovered a new Endpoint from the bindings, read its EndpointAttributes chip::EndpointId endpointId = binding.remote; @@ -98,7 +116,8 @@ CHIP_ERROR EndpointListLoader::Load() }) == endpoints.end()) { // Read attributes and mEndpointAttributesList for (endpointIndex + 1) - ChipLogProgress(AppServer, "EndpointListLoader::Load Reading attributes for endpointId %d", endpointId); + ChipLogProgress(AppServer, "EndpointListLoader::Load() Reading attributes for endpointId: %d, on fabricIndex: %d", + endpointId, binding.fabricIndex); isLoadingRequired = true; mEndpointAttributesList[++endpointIndex].mId = endpointId; ReadVendorId(&mEndpointAttributesList[endpointIndex]); @@ -121,7 +140,7 @@ CHIP_ERROR EndpointListLoader::Load() void EndpointListLoader::Complete() { - ChipLogProgress(AppServer, "EndpointListLoader::Complete called with mPendingAttributeReads %lu", mPendingAttributeReads); + ChipLogProgress(AppServer, "EndpointListLoader::Complete() called with mPendingAttributeReads: %lu", mPendingAttributeReads); if (mPendingAttributeReads > 0) { mPendingAttributeReads--; @@ -161,7 +180,7 @@ void EndpointListLoader::Complete() // callback client OnCompleted VerifyOrReturn(CastingPlayer::GetTargetCastingPlayer()->mOnCompleted, - ChipLogError(AppServer, "EndpointListLoader::Complete mOnCompleted() not found")); + ChipLogError(AppServer, "EndpointListLoader::Complete() mOnCompleted() not found")); CastingPlayer::GetTargetCastingPlayer()->mOnCompleted(CHIP_NO_ERROR, CastingPlayer::GetTargetCastingPlayer()); } } @@ -180,7 +199,8 @@ CHIP_ERROR EndpointListLoader::ReadVendorId(EndpointAttributes * endpointAttribu }, [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); - ChipLogError(AppServer, "EndpointListLoader ReadAttribute(VendorID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + ChipLogError(AppServer, + "EndpointListLoader::ReadAttribute(VendorID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -201,7 +221,7 @@ CHIP_ERROR EndpointListLoader::ReadProductId(EndpointAttributes * endpointAttrib [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); ChipLogError(AppServer, - "EndpointListLoader ReadAttribute(ProductID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + "EndpointListLoader::ReadAttribute(ProductID) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -227,7 +247,7 @@ CHIP_ERROR EndpointListLoader::ReadDeviceTypeList(EndpointAttributes * endpointA [](void * context, CHIP_ERROR err) { EndpointAttributes * _endpointAttributes = static_cast(context); ChipLogError(AppServer, - "EndpointListLoader ReadAttribute(DeviceTypeList) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, + "EndpointListLoader::ReadAttribute(DeviceTypeList) failed for endpointID %d. Err: %" CHIP_ERROR_FORMAT, _endpointAttributes->mId, err.Format()); EndpointListLoader::GetInstance()->Complete(); }); @@ -251,7 +271,9 @@ CHIP_ERROR EndpointListLoader::ReadServerList(std::vector * end EndpointListLoader::GetInstance()->Complete(); }, [](void * context, CHIP_ERROR err) { - ChipLogError(AppServer, "EndpointListLoader ReadAttribute(ServerList) failed. Err: %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogError(AppServer, + "EndpointListLoader::ReadServerList() ReadAttribute(ServerList) failed. Err: %" CHIP_ERROR_FORMAT, + err.Format()); EndpointListLoader::GetInstance()->Complete(); }); } 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 6d8fb379e5..3dba518b75 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 @@ -1000,6 +1000,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/virtual-device-app/android/README.md b/examples/virtual-device-app/android/README.md index a5a1ce3a65..2bb74a79f3 100644 --- a/examples/virtual-device-app/android/README.md +++ b/examples/virtual-device-app/android/README.md @@ -23,7 +23,7 @@ This app offers the following features: ## Requirements for building For information about how to build the application, see the -[Building Android](../../../docs/guides/android_building.md) guide. +[Building Android](../../../docs/platforms/android/android_building.md) guide. ## Preparing for build 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 cbb366ad54..22b2c8999a 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 @@ -1177,6 +1177,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/all-clusters-minimal-app/tizen/.gn b/examples/water-leak-detector-app/linux/.gn similarity index 92% rename from examples/all-clusters-minimal-app/tizen/.gn rename to examples/water-leak-detector-app/linux/.gn index edd34d34bd..3b11e2ba2e 100644 --- a/examples/all-clusters-minimal-app/tizen/.gn +++ b/examples/water-leak-detector-app/linux/.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2024 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. @@ -21,7 +21,5 @@ buildconfig = "${build_root}/config/BUILDCONFIG.gn" check_system_includes = true default_args = { - target_os = "tizen" - import("//args.gni") } diff --git a/examples/water-leak-detector-app/linux/BUILD.gn b/examples/water-leak-detector-app/linux/BUILD.gn new file mode 100644 index 0000000000..c5caf26d8e --- /dev/null +++ b/examples/water-leak-detector-app/linux/BUILD.gn @@ -0,0 +1,64 @@ +# Copyright (c) 2024 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") +import("${chip_root}/third_party/imgui/imgui.gni") + +assert(chip_build_tools) + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("water-leak-detector-app") { + sources = [ + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/examples/water-leak-detector-app/water-leak-detector-common", + "${chip_root}/src/lib", + ] + + if (chip_examples_enable_imgui_ui) { + deps += [ + "${chip_root}/examples/common/imgui_ui", + "${chip_root}/examples/common/imgui_ui/windows:boolean_state", + "${chip_root}/examples/common/imgui_ui/windows:occupancy_sensing", + "${chip_root}/examples/common/imgui_ui/windows:qrcode", + ] + } + + include_dirs = [ "include" ] + + cflags = [ "-Wconversion" ] + + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":water-leak-detector-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/all-clusters-minimal-app/tizen/args.gni b/examples/water-leak-detector-app/linux/args.gni similarity index 84% rename from examples/all-clusters-minimal-app/tizen/args.gni rename to examples/water-leak-detector-app/linux/args.gni index bf1ef5219e..5be50537dd 100644 --- a/examples/all-clusters-minimal-app/tizen/args.gni +++ b/examples/water-leak-detector-app/linux/args.gni @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2024 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. @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +# CHIPProjectConfig.h + import("//build_overrides/chip.gni") import("${chip_root}/config/standalone/args.gni") @@ -21,5 +23,6 @@ chip_project_config_include = "" chip_system_project_config_include = "" chip_project_config_include_dirs = - [ "${chip_root}/examples/all-clusters-minimal-app/tizen/include" ] + [ "${chip_root}/examples/water-leak-detector-app/linux/include" ] chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] +matter_enable_tracing_support = true diff --git a/examples/water-leak-detector-app/linux/build_overrides b/examples/water-leak-detector-app/linux/build_overrides new file mode 120000 index 0000000000..e578e73312 --- /dev/null +++ b/examples/water-leak-detector-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h b/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 0000000000..14ec70af42 --- /dev/null +++ b/examples/water-leak-detector-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 + +// Bulbs do not typically use this - enabled so we can use shell to discover commissioners +#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 0x0043 // Water Leak Detector + +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 + +#define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Water Leak Detector" diff --git a/examples/water-leak-detector-app/linux/main.cpp b/examples/water-leak-detector-app/linux/main.cpp new file mode 100644 index 0000000000..02a91b82ce --- /dev/null +++ b/examples/water-leak-detector-app/linux/main.cpp @@ -0,0 +1,53 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED +#include +#include +#include +#include +#endif + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +void ApplicationInit() {} + +void ApplicationShutdown() {} + +int main(int argc, char * argv[]) +{ + VerifyOrDie(ChipLinuxAppInit(argc, argv) == 0); + +#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED + example::Ui::ImguiUi ui; + + ui.AddWindow(std::make_unique()); + ui.AddWindow(std::make_unique(chip::EndpointId(1), "Water Leak Detector")); + + ChipLinuxAppMainLoop(&ui); +#else + ChipLinuxAppMainLoop(); +#endif + + return 0; +} diff --git a/examples/water-leak-detector-app/linux/third_party/connectedhomeip b/examples/water-leak-detector-app/linux/third_party/connectedhomeip new file mode 120000 index 0000000000..c866b86874 --- /dev/null +++ b/examples/water-leak-detector-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn b/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn new file mode 100644 index 0000000000..47031e0dbc --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/BUILD.gn @@ -0,0 +1,21 @@ +# Copyright (c) 2024 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("water-leak-detector-common") { + zap_file = "water-leak-detector-app.zap" + is_server = true +} diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter new file mode 100644 index 0000000000..f2cc365f2b --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter @@ -0,0 +1,1962 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; +} + +enum RelativePositionTag : enum8 { + kUnder = 0; + kNextTo = 1; + kAround = 2; + kOn = 3; + kAbove = 4; + kFrontOf = 5; + kBehind = 6; +} + +enum TestGlobalEnum : enum8 { + kSomeValue = 0; + kSomeOtherValue = 1; + kFinalValue = 2; +} + +enum ThreeLevelAutoEnum : enum8 { + kLow = 0; + kMedium = 1; + kHigh = 2; + kAutomatic = 3; +} + +bitmap TestGlobalBitmap : bitmap32 { + kFirstBit = 0x1; + kSecondBit = 0x2; +} + +struct TestGlobalStruct { + char_string<128> name = 0; + nullable TestGlobalBitmap myBitmap = 1; + optional nullable TestGlobalEnum myEnum = 2; +} + +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + +struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +cluster Identify = 3 { + revision 4; + + enum EffectIdentifierEnum : enum8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : enum8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : enum8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + int16u identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + /** Command description for Identify */ + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + /** Command description for TriggerEffect */ + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for group configuration and manipulation. */ +cluster Groups = 4 { + revision 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; + } + + response struct AddGroupResponse = 0 { + enum8 status = 0; + group_id groupID = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + response struct ViewGroupResponse = 1 { + enum8 status = 0; + group_id groupID = 1; + char_string<16> groupName = 2; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + response struct GetGroupMembershipResponse = 2 { + nullable int8u capacity = 0; + group_id groupList[] = 1; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + response struct RemoveGroupResponse = 3 { + enum8 status = 0; + group_id groupID = 1; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + char_string<16> groupName = 1; + } + + /** Command description for AddGroup */ + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + /** Command description for ViewGroup */ + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + /** Command description for GetGroupMembership */ + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + /** Command description for RemoveGroup */ + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + /** Command description for RemoveAllGroups */ + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + /** Command description for AddGroupIfIdentifying */ + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +cluster Descriptor = 29 { + revision 2; + + bitmap Feature : bitmap32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute cluster_id serverList[] = 1; + readonly attribute cluster_id clientList[] = 2; + readonly attribute endpoint_no partsList[] = 3; + readonly attribute optional SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +cluster AccessControl = 31 { + revision 2; + + enum AccessControlEntryAuthModeEnum : enum8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : enum8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum AccessRestrictionTypeEnum : enum8 { + kAttributeAccessForbidden = 0; + kAttributeWriteForbidden = 1; + kCommandForbidden = 2; + kEventForbidden = 3; + } + + enum ChangeTypeEnum : enum8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + bitmap Feature : bitmap32 { + kExtension = 0x1; + kManagedDevice = 0x2; + } + + struct AccessRestrictionStruct { + AccessRestrictionTypeEnum type = 0; + nullable int32u id = 1; + } + + struct CommissioningAccessRestrictionEntryStruct { + endpoint_no endpoint = 0; + cluster_id cluster = 1; + AccessRestrictionStruct restrictions[] = 2; + } + + fabric_scoped struct AccessRestrictionEntryStruct { + fabric_sensitive endpoint_no endpoint = 0; + fabric_sensitive cluster_id cluster = 1; + fabric_sensitive AccessRestrictionStruct restrictions[] = 2; + fabric_idx fabricIndex = 254; + } + + 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; + } + + fabric_sensitive info event access(read: administer) FabricRestrictionReviewUpdate = 2 { + int64u token = 0; + optional long_char_string instruction = 1; + optional long_char_string ARLRequestFlowUrl = 2; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) optional AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute optional CommissioningAccessRestrictionEntryStruct commissioningARL[] = 5; + readonly attribute optional AccessRestrictionEntryStruct arl[] = 6; + 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 ReviewFabricRestrictionsRequest { + CommissioningAccessRestrictionEntryStruct arl[] = 0; + } + + response struct ReviewFabricRestrictionsResponse = 1 { + int64u token = 0; + } + + /** This command signals to the service associated with the device vendor that the fabric administrator would like a review of the current restrictions on the accessing fabric. */ + fabric command access(invoke: administer) ReviewFabricRestrictions(ReviewFabricRestrictionsRequest): ReviewFabricRestrictionsResponse = 0; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +cluster BasicInformation = 40 { + revision 3; + + enum ColorEnum : enum8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : enum8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + int32u softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute optional char_string<16> manufacturingDate = 11; + readonly attribute optional char_string<32> partNumber = 12; + readonly attribute optional long_char_string<256> productURL = 13; + readonly attribute optional char_string<64> productLabel = 14; + readonly attribute optional char_string<32> serialNumber = 15; + attribute access(write: manage) optional boolean localConfigDisabled = 16; + readonly attribute optional boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute optional ProductAppearanceStruct productAppearance = 20; + readonly attribute int32u specificationVersion = 21; + readonly attribute int16u maxPathsPerInvoke = 22; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command MfgSpecificPing(): DefaultSuccess = 0; +} + +/** 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 */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + 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; +} + +/** This cluster is used to describe the configuration and capabilities of a physical power source that provides power to the Node. */ +cluster PowerSource = 47 { + revision 1; // NOTE: Default/not specifically set + + 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 optional nullable int32u wiredAssessedInputVoltage = 3; + readonly attribute optional nullable int16u wiredAssessedInputFrequency = 4; + readonly attribute optional WiredCurrentTypeEnum wiredCurrentType = 5; + readonly attribute optional nullable int32u wiredAssessedCurrent = 6; + readonly attribute optional int32u wiredNominalVoltage = 7; + readonly attribute optional int32u wiredMaximumCurrent = 8; + readonly attribute optional boolean wiredPresent = 9; + readonly attribute optional WiredFaultEnum activeWiredFaults[] = 10; + readonly attribute optional nullable int32u batVoltage = 11; + readonly attribute optional nullable int8u batPercentRemaining = 12; + readonly attribute optional nullable int32u batTimeRemaining = 13; + readonly attribute optional BatChargeLevelEnum batChargeLevel = 14; + readonly attribute optional boolean batReplacementNeeded = 15; + readonly attribute optional BatReplaceabilityEnum batReplaceability = 16; + readonly attribute optional boolean batPresent = 17; + readonly attribute optional BatFaultEnum activeBatFaults[] = 18; + readonly attribute optional char_string<60> batReplacementDescription = 19; + readonly attribute optional BatCommonDesignationEnum batCommonDesignation = 20; + readonly attribute optional char_string<20> batANSIDesignation = 21; + readonly attribute optional char_string<20> batIECDesignation = 22; + readonly attribute optional BatApprovedChemistryEnum batApprovedChemistry = 23; + readonly attribute optional int32u batCapacity = 24; + readonly attribute optional int8u batQuantity = 25; + readonly attribute optional BatChargeStateEnum batChargeState = 26; + readonly attribute optional nullable int32u batTimeToFullCharge = 27; + readonly attribute optional boolean batFunctionalWhileCharging = 28; + readonly attribute optional nullable int32u batChargingCurrent = 29; + readonly attribute optional BatChargeFaultEnum activeBatChargeFaults[] = 30; + 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. */ +cluster GeneralCommissioning = 48 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningErrorEnum : enum8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + kRequiredTCNotAccepted = 5; + kTCAcknowledgementsNotReceived = 6; + kTCMinVersionNotMet = 7; + } + + enum RegulatoryLocationTypeEnum : enum8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + bitmap Feature : bitmap32 { + kTermsAndConditions = 0x1; + } + + 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; + provisional readonly attribute access(read: administer) optional int16u TCAcceptedVersion = 5; + provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; + provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; + provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + int16u expiryLengthSeconds = 0; + int64u breadcrumb = 1; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + char_string<128> debugText = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + char_string<2> countryCode = 1; + int64u breadcrumb = 2; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + char_string debugText = 1; + } + + request struct SetTCAcknowledgementsRequest { + int16u TCVersion = 0; + bitmap16 TCUserResponse = 1; + } + + response struct SetTCAcknowledgementsResponse = 7 { + CommissioningErrorEnum errorCode = 0; + } + + /** Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock */ + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + /** Set the regulatory configuration to be used during commissioning */ + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + /** Signals the Server that the Client has successfully completed all steps of Commissioning/Recofiguration needed during fail-safe period. */ + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; + /** This command sets the user acknowledgements received in the Enhanced Setup Flow Terms and Conditions into the node. */ + command access(invoke: administer) SetTCAcknowledgements(SetTCAcknowledgementsRequest): SetTCAcknowledgementsResponse = 6; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +cluster NetworkCommissioning = 49 { + revision 1; // NOTE: Default/not specifically set + + enum NetworkCommissioningStatusEnum : enum8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : enum8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : bitmap32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + kPerDeviceCredentials = 0x8; + } + + bitmap ThreadCapabilitiesBitmap : bitmap16 { + kIsBorderRouterCapable = 0x1; + kIsRouterCapable = 0x2; + kIsSleepyEndDeviceCapable = 0x4; + kIsFullThreadDevice = 0x8; + kIsSynchronizedSleepyEndDeviceCapable = 0x10; + } + + bitmap WiFiSecurityBitmap : bitmap8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + kWPA3MatterPDC = 0x20; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + optional nullable octet_string<20> networkIdentifier = 2; + optional nullable octet_string<20> clientIdentifier = 3; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute optional int8u scanMaxTimeSeconds = 2; + readonly attribute optional int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + provisional readonly attribute optional WiFiBandEnum supportedWiFiBands[] = 8; + provisional readonly attribute optional ThreadCapabilitiesBitmap supportedThreadFeatures = 9; + provisional readonly attribute optional int16u threadVersion = 10; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable octet_string<32> ssid = 0; + optional int64u breadcrumb = 1; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + request struct AddOrUpdateWiFiNetworkRequest { + octet_string<32> ssid = 0; + octet_string<64> credentials = 1; + optional int64u breadcrumb = 2; + optional octet_string<140> networkIdentity = 3; + optional octet_string<20> clientIdentifier = 4; + optional octet_string<32> possessionNonce = 5; + } + + request struct AddOrUpdateThreadNetworkRequest { + octet_string<254> operationalDataset = 0; + optional int64u breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string<512> debugText = 1; + optional int8u networkIndex = 2; + optional octet_string<140> clientIdentity = 3; + optional octet_string<64> possessionSignature = 4; + } + + request struct ConnectNetworkRequest { + octet_string<32> networkID = 0; + optional int64u breadcrumb = 1; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional char_string debugText = 1; + nullable int32s errorValue = 2; + } + + request struct ReorderNetworkRequest { + octet_string<32> networkID = 0; + int8u networkIndex = 1; + optional int64u breadcrumb = 2; + } + + request struct QueryIdentityRequest { + octet_string<20> keyIdentifier = 0; + optional octet_string<32> possessionNonce = 1; + } + + response struct QueryIdentityResponse = 10 { + octet_string<140> identity = 0; + optional octet_string<64> possessionSignature = 1; + } + + /** Detemine the set of networks the device sees as available. */ + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + /** Add or update the credentials for a given Wi-Fi network. */ + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + /** Add or update the credentials for a given Thread network. */ + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + /** Remove the definition of a given network (including its credentials). */ + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + /** Connect to the specified network, using previously-defined credentials. */ + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + /** Modify the order in which networks will be presented in the Networks attribute. */ + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; + /** Retrieve details about and optionally proof of possession of a network client identity. */ + command access(invoke: administer) QueryIdentity(QueryIdentityRequest): QueryIdentityResponse = 9; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +cluster DiagnosticLogs = 50 { + revision 1; // NOTE: Default/not specifically set + + 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; + } + + response struct RetrieveLogsResponse = 1 { + StatusEnum status = 0; + long_octet_string logContent = 1; + optional epoch_us UTCTimeStamp = 2; + optional systime_us timeSinceBoot = 3; + } + + /** Retrieving diagnostic logs from a Node */ + 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. */ +cluster GeneralDiagnostics = 51 { + revision 2; + + enum BootReasonEnum : enum8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : enum8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : enum8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : enum8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : enum8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + bitmap Feature : bitmap32 { + kDataModelTest = 0x1; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute optional int64u upTime = 2; + readonly attribute optional int32u totalOperationalHours = 3; + readonly attribute optional BootReasonEnum bootReason = 4; + readonly attribute optional HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute optional RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute optional NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + octet_string<16> enableKey = 0; + int64u eventTrigger = 1; + } + + response struct TimeSnapshotResponse = 2 { + systime_ms systemTimeMs = 0; + nullable posix_ms posixTimeMs = 1; + } + + request struct PayloadTestRequestRequest { + octet_string<16> enableKey = 0; + int8u value = 1; + int16u count = 2; + } + + response struct PayloadTestResponse = 4 { + octet_string payload = 0; + } + + /** Provide a means for certification tests to trigger some test-plan-specific events */ + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; + /** Take a snapshot of system time and epoch time. */ + command TimeSnapshot(): TimeSnapshotResponse = 1; + /** Request a variable length payload response. */ + command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +cluster AdministratorCommissioning = 60 { + revision 1; // NOTE: Default/not specifically set + + enum CommissioningWindowStatusEnum : enum8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : enum8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + bitmap Feature : bitmap32 { + kBasic = 0x1; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable vendor_id adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + int16u commissioningTimeout = 0; + octet_string PAKEPasscodeVerifier = 1; + int16u discriminator = 2; + int32u iterations = 3; + octet_string<32> salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + int16u commissioningTimeout = 0; + } + + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using enhanced commissioning method. */ + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + /** This command is used by a current Administrator to instruct a Node to go into commissioning mode using basic commissioning method, if the node supports it. */ + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + /** This command is used by a current Administrator to instruct a Node to revoke any active Open Commissioning Window or Open Basic Commissioning Window command. */ + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +cluster OperationalCredentials = 62 { + revision 1; // NOTE: Default/not specifically set + + enum CertificateChainTypeEnum : enum8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : enum8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute octet_string trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + octet_string<32> attestationNonce = 0; + } + + response struct AttestationResponse = 1 { + octet_string<900> attestationElements = 0; + octet_string<64> attestationSignature = 1; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + response struct CertificateChainResponse = 3 { + octet_string<600> certificate = 0; + } + + request struct CSRRequestRequest { + octet_string<32> CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + response struct CSRResponse = 5 { + octet_string NOCSRElements = 0; + octet_string attestationSignature = 1; + } + + request struct AddNOCRequest { + octet_string<400> NOCValue = 0; + optional octet_string<400> ICACValue = 1; + octet_string<16> IPKValue = 2; + int64u caseAdminSubject = 3; + vendor_id adminVendorId = 4; + } + + request struct UpdateNOCRequest { + octet_string NOCValue = 0; + optional octet_string ICACValue = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional char_string<128> debugText = 2; + } + + request struct UpdateFabricLabelRequest { + char_string<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + octet_string rootCACertificate = 0; + } + + /** Sender is requesting attestation information from the receiver. */ + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + /** Sender is requesting a device attestation certificate from the receiver. */ + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + /** Sender is requesting a certificate signing request (CSR) from the receiver. */ + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + /** Sender is requesting to add the new node operational certificates. */ + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + /** Sender is requesting to update the node operational certificates. */ + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + /** This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. */ + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + /** This command is used by Administrative Nodes to remove a given fabric index and delete all associated fabric-scoped data. */ + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + /** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */ + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +cluster GroupKeyManagement = 63 { + revision 1; // NOTE: Default/not specifically set + + enum GroupKeySecurityPolicyEnum : enum8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : bitmap32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetRemoveRequest { + int16u groupKeySetID = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + int16u groupKeySetIDs[] = 0; + } + + /** Write a new set of keys for the given key set id. */ + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + /** Read the keys for a given key set id. */ + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + /** Revoke a Root Key from a Group */ + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + /** Return the list of Group Key Sets associated with the accessing fabric */ + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** This cluster provides an interface to a boolean state called StateValue. */ +cluster BooleanState = 69 { + revision 1; + + info event StateChange = 0 { + boolean stateValue = 0; + } + + readonly attribute boolean stateValue = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to configure a boolean sensor. */ +cluster BooleanStateConfiguration = 128 { + revision 1; + + bitmap AlarmModeBitmap : bitmap8 { + kVisual = 0x1; + kAudible = 0x2; + } + + bitmap Feature : bitmap32 { + kVisual = 0x1; + kAudible = 0x2; + kAlarmSuppress = 0x4; + kSensitivityLevel = 0x8; + } + + bitmap SensorFaultBitmap : bitmap16 { + kGeneralFault = 0x1; + } + + info event AlarmsStateChanged = 0 { + AlarmModeBitmap alarmsActive = 0; + optional AlarmModeBitmap alarmsSuppressed = 1; + } + + info event SensorFault = 1 { + SensorFaultBitmap sensorFault = 0; + } + + attribute optional int8u currentSensitivityLevel = 0; + readonly attribute optional int8u supportedSensitivityLevels = 1; + readonly attribute optional int8u defaultSensitivityLevel = 2; + readonly attribute optional AlarmModeBitmap alarmsActive = 3; + readonly attribute optional AlarmModeBitmap alarmsSuppressed = 4; + readonly attribute optional AlarmModeBitmap alarmsEnabled = 5; + readonly attribute optional AlarmModeBitmap alarmsSupported = 6; + readonly attribute optional SensorFaultBitmap sensorFault = 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 SuppressAlarmRequest { + AlarmModeBitmap alarmsToSuppress = 0; + } + + request struct EnableDisableAlarmRequest { + AlarmModeBitmap alarmsToEnableDisable = 0; + } + + /** This command is used to suppress the specified alarm mode. */ + command SuppressAlarm(SuppressAlarmRequest): DefaultSuccess = 0; + /** This command is used to enable or disable the specified alarm mode. */ + command EnableDisableAlarm(EnableDisableAlarmRequest): DefaultSuccess = 1; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location; + callback attribute hardwareVersion; + callback attribute hardwareVersionString; + callback attribute softwareVersion; + callback attribute softwareVersionString; + callback attribute manufacturingDate; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute specificationVersion; + callback attribute maxPathsPerInvoke; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig; + callback attribute locationCapability; + callback attribute supportsConcurrentConnection; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 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; + handle command RetrieveLogsResponse; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount; + callback attribute upTime; + callback attribute totalOperationalHours; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute featureMap; + callback attribute clusterRevision; + + handle command TestEventTrigger; + handle command TimeSnapshot; + handle command TimeSnapshotResponse; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus; + callback attribute adminFabricIndex; + callback attribute adminVendorId; + 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; + callback attribute clusterRevision; + + handle command KeySetWrite; + handle command KeySetRead; + handle command KeySetReadResponse; + handle command KeySetRemove; + handle command KeySetReadAllIndices; + handle command KeySetReadAllIndicesResponse; + } +} +endpoint 1 { + device type ma_powersource = 17, version 1; + device type ma_water_leak_detector = 67, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + + handle command Identify; + handle command TriggerEffect; + } + + server cluster Groups { + ram attribute nameSupport; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + + 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 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; + callback attribute featureMap; + callback attribute clusterRevision; + } + + server cluster PowerSource { + ram attribute status default = 1; + ram attribute order default = 1; + ram attribute description default = "Primary Battery"; + ram attribute batVoltage default = 4100; + ram attribute batPercentRemaining default = 95; + ram attribute batTimeRemaining default = 518400; + ram attribute batChargeLevel default = 0; + ram attribute batReplacementNeeded default = 0; + ram attribute batReplaceability default = 1; + ram attribute batPresent default = 1; + ram attribute batCapacity default = 350; + ram attribute batChargeState default = 4; + ram attribute batFunctionalWhileCharging default = 1; + callback attribute endpointList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BooleanState { + ram attribute stateValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BooleanStateConfiguration { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap new file mode 100644 index 0000000000..1dc7adb63a --- /dev/null +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.zap @@ -0,0 +1,3214 @@ +{ + "fileFormat": 2, + "featureLevel": 103, + "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", + "category": "matter", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpecificationVersion", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPathsPerInvoke", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "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": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "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 + }, + { + "name": "TimeSnapshot", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "TimeSnapshotResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "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": null, + "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": null, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "code": 67, + "profileId": 259, + "label": "MA-water-leak-detector", + "name": "MA-water-leak-detector" + }, + "deviceTypes": [ + { + "code": 67, + "profileId": 259, + "label": "MA-water-leak-detector", + "name": "MA-water-leak-detector" + }, + { + "code": 17, + "profileId": 259, + "label": "MA-powersource", + "name": "MA-powersource" + } + ], + "deviceVersions": [ + 1, + 1 + ], + "deviceIdentifiers": [ + 67, + 17 + ], + "deviceTypeName": "MA-water-leak-detector", + "deviceTypeCode": 67, + "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": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "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": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "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": "1", + "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": "1", + "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": "Primary Battery", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatVoltage", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPercentRemaining", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "95", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatTimeRemaining", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "518400", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeLevel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "BatChargeLevelEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplacementNeeded", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatReplaceability", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "BatReplaceabilityEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatPresent", + "code": 17, + "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": "BatCapacity", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "350", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatChargeState", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "BatChargeStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BatFunctionalWhileCharging", + "code": 28, + "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": "EndpointList", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "Boolean State", + "code": 69, + "mfgCode": null, + "define": "BOOLEAN_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "StateValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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": "Boolean State Configuration", + "code": 128, + "mfgCode": null, + "define": "BOOLEAN_STATE_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "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 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0, + "parentEndpointIdentifier": 0 + } + ] +} diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 50a47d27c7..c7eee099b9 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1101,6 +1101,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/examples/window-app/nrfconnect/README.md b/examples/window-app/nrfconnect/README.md index 964af0c265..c743bb22f2 100644 --- a/examples/window-app/nrfconnect/README.md +++ b/examples/window-app/nrfconnect/README.md @@ -40,7 +40,7 @@ This example is running on the nRF Connect platform, which is based on Nordic Semiconductor's [nRF Connect SDK](https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html) and [Zephyr RTOS](https://zephyrproject.org/). Visit Matter's -[nRF Connect platform overview](../../../docs/guides/nrfconnect_platform_overview.md) +[nRF Connect platform overview](../../../docs/platforms/nrf/nrfconnect_platform_overview.md) to read more about the platform structure and dependencies. The Matter device that runs the window shutter application is controlled by the @@ -229,7 +229,7 @@ by default). **SEGGER J-Link USB port** can be used to get logs from the device or communicate with it using the -[command line interface](../../../docs/guides/nrfconnect_examples_cli.md). +[command line interface](../../../docs/platforms/nrf/nrfconnect_examples_cli.md). **NFC port with antenna attached** can be used to start the [rendezvous](#bluetooth-le-rendezvous) by providing the commissioning @@ -430,7 +430,7 @@ depending on the selected board: only the necessary application functionalities to optimize its performance. For more information, see the -[Configuring nRF Connect SDK examples](../../../docs/guides/nrfconnect_examples_configuration.md) +[Configuring nRF Connect SDK examples](../../../docs/platforms/nrf/nrfconnect_examples_configuration.md) page.
@@ -454,19 +454,20 @@ directory: ## Testing the example -Check the [CLI tutorial](../../../docs/guides/nrfconnect_examples_cli.md) to -learn how to use command-line interface of the application. +Check the [CLI tutorial](../../../docs/platforms/nrf/nrfconnect_examples_cli.md) +to learn how to use command-line interface of the application. ### Testing using Linux CHIPTool -Read the [CHIP Tool user guide](../../../docs/guides/chip_tool_guide.md) to see -how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to +Read the +[CHIP Tool user guide](../../../docs/development_controllers/chip-tool/chip_tool_guide.md) +to see how to use [CHIP Tool for Linux or mac OS](../../chip-tool/README.md) to commission and control the application within a Matter-enabled Thread network. ### Testing using Android CHIPTool Read the -[Android commissioning guide](../../../docs/guides/nrfconnect_android_commissioning.md) +[Android commissioning guide](../../../docs/platforms/nrf/nrfconnect_android_commissioning.md) to see how to use [CHIPTool](../../../examples/android/CHIPTool/README.md) for Android smartphones to commission and control the application within a Matter-enabled Thread network. @@ -474,5 +475,5 @@ Matter-enabled Thread network. ### Testing Device Firmware Upgrade Read the -[DFU tutorial](../../../docs/guides/nrfconnect_examples_software_update.md) to -see how to upgrade your device firmware. +[DFU tutorial](../../../docs/platforms/nrf/nrfconnect_examples_software_update.md) +to see how to upgrade your device firmware. diff --git a/examples/window-app/silabs/README.md b/examples/window-app/silabs/README.md index 47dbb77a7f..a5e985cec0 100644 --- a/examples/window-app/silabs/README.md +++ b/examples/window-app/silabs/README.md @@ -195,7 +195,7 @@ combination with JLinkRTTClient as follows: - It is assumed here that you already have an OpenThread border router configured and running. If not see the following guide - [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/openthread_border_router_pi.md) + [Openthread_border_router](https://github.com/project-chip/connectedhomeip/blob/master/docs/platforms/openthread/openthread_border_router_pi.md) for more information on how to setup a border router on a raspberryPi. Take note that the RCP code is available directly through @@ -324,7 +324,7 @@ combination with JLinkRTTClient as follows: For the description of Software Update process with EFR32 example applications see -[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md) +[EFR32 OTA Software Update](../../../docs/platforms/silabs/silabs_efr32_software_update.md) ## Building options diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 9f5456cec0..2b7aeef2b7 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -81 : [Telink] Update Docker image (Zephyr update) +82 : [Tizen] Enable RTC driver to sync time on boot diff --git a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile index 26b9183da6..d731ab2dc6 100644 --- a/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile +++ b/integrations/docker/images/stage-3/chip-build-tizen-qemu/Dockerfile @@ -46,23 +46,25 @@ RUN set -x \ && cd *linux-kernel-* \ && zcat ../*-to-*.diff.gz | patch -p1 \ && patch -p1 < $TIZEN_SDK_ROOT/files/0001-smack-add-permissive-mode.patch \ - # Compile + # Configure && export MAKEFLAGS=-j$(nproc) \ && export ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- \ && make tizen_bcm2711_defconfig \ - && ./scripts/config -e ARCH_VIRT \ - && ./scripts/config -e VIRTIO_MMIO -e HW_RANDOM_VIRTIO \ + # Add support for QEMU VirtIO devices + && ./scripts/config -e ARCH_VIRT -e VIRTIO_MMIO \ && ./scripts/config -e VIRTIO_PCI -e VIRTIO_BLK \ && ./scripts/config -e VIRTIO_NET -e VETH \ - && ./scripts/config -e IKCONFIG -e IKCONFIG_PROC \ + && ./scripts/config -e HW_RANDOM_VIRTIO \ + # Use ARM PL031 RTC and synchronize time during boot + && ./scripts/config -e RTC_DRV_PL031 -e RTC_HCTOSYS \ + # Enable vHCI driver to add support for Bluetooth virtualization && ./scripts/config -e BT_HCIVHCI -e CRYPTO_USER_API_HASH -e CRYPTO_USER_API_SKCIPHER \ - && ./scripts/config -e OVERLAY_FS \ - && ./scripts/config -e SECURITY_SMACK_PERMISSIVE_MODE \ - && ./scripts/config -e NET_9P -e NET_9P_VIRTIO \ - && ./scripts/config -e INET \ - && ./scripts/config -e 9P_FS -e 9P_FS_POSIX_ACL \ - && ./scripts/config -e PCI_HOST_GENERIC \ + # Enable overlay FS and disable SMACK to workaround permission issues + && ./scripts/config -e OVERLAY_FS -e SECURITY_SMACK_PERMISSIVE_MODE \ + # Enable 9P filesystem support to share files between host and guest + && ./scripts/config -e INET -e PCI_HOST_GENERIC -e NET_9P -e NET_9P_VIRTIO -e 9P_FS \ && make olddefconfig \ + # Compile && make -j$(nproc) zImage \ && mv arch/arm/boot/zImage $TIZEN_IOT_QEMU_KERNEL \ # Cleanup diff --git a/scripts/build/build/__init__.py b/scripts/build/build/__init__.py index c363f6c326..5f3cbbab36 100644 --- a/scripts/build/build/__init__.py +++ b/scripts/build/build/__init__.py @@ -4,9 +4,10 @@ from enum import Enum, auto from typing import Sequence -from .targets import BUILD_TARGETS from builders.builder import BuilderOptions +from .targets import BUILD_TARGETS + class BuildSteps(Enum): GENERATED = auto() @@ -18,11 +19,12 @@ class Context: to generate make/ninja instructions and to compile. """ - def __init__(self, runner, repository_path: str, output_prefix: str): + def __init__(self, runner, repository_path: str, output_prefix: str, ninja_jobs: int): self.builders = [] self.runner = runner self.repository_path = repository_path self.output_prefix = output_prefix + self.ninja_jobs = ninja_jobs self.completed_steps = set() def SetupBuilders(self, targets: Sequence[str], options: BuilderOptions): @@ -36,7 +38,7 @@ def SetupBuilders(self, targets: Sequence[str], options: BuilderOptions): found = False for choice in BUILD_TARGETS: builder = choice.Create(target, self.runner, self.repository_path, - self.output_prefix, options) + self.output_prefix, self.ninja_jobs, options) if builder: self.builders.append(builder) found = True diff --git a/scripts/build/build/target.py b/scripts/build/build/target.py index 7f17161701..78e4599fb5 100644 --- a/scripts/build/build/target.py +++ b/scripts/build/build/target.py @@ -389,7 +389,7 @@ def StringIntoTargetParts(self, value: str): return _StringIntoParts(value, suffix, self.fixed_targets, self.modifiers) def Create(self, name: str, runner, repository_path: str, output_prefix: str, - builder_options: BuilderOptions): + ninja_jobs: int, builder_options: BuilderOptions): parts = self.StringIntoTargetParts(name) @@ -406,6 +406,7 @@ def Create(self, name: str, runner, repository_path: str, output_prefix: str, builder.target = self builder.identifier = name builder.output_dir = os.path.join(output_prefix, name) + builder.ninja_jobs = ninja_jobs builder.chip_dir = os.path.abspath(repository_path) builder.options = builder_options diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 8d1b30234c..42738adce7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -146,6 +146,7 @@ def BuildHostTarget(): TargetPart('air-quality-sensor', app=HostApp.AIR_QUALITY_SENSOR), TargetPart('network-manager', app=HostApp.NETWORK_MANAGER), TargetPart('energy-management', app=HostApp.ENERGY_MANAGEMENT), + TargetPart('water-leak-detector', app=HostApp.WATER_LEAK_DETECTOR), ] if (HostBoard.NATIVE.PlatformName() == 'darwin'): @@ -668,7 +669,6 @@ def BuildTizenTarget(): # apps target.AppendFixedTargets([ TargetPart('all-clusters', app=TizenApp.ALL_CLUSTERS), - TargetPart('all-clusters-minimal', app=TizenApp.ALL_CLUSTERS_MINIMAL), TargetPart('chip-tool', app=TizenApp.CHIP_TOOL), TargetPart('light', app=TizenApp.LIGHT), TargetPart('tests', app=TizenApp.TESTS), diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index e1f37fca79..171c788c05 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -104,6 +104,13 @@ def ValidateTargetNames(context, parameter, values): default='./out', type=click.Path(file_okay=False, resolve_path=True), help='Prefix for the generated file output.') +@click.option( + '--ninja-jobs', + type=int, + is_flag=False, + flag_value=0, + default=None, + help='Number of ninja jobs') @click.option( '--pregen-dir', default=None, @@ -136,8 +143,8 @@ def ValidateTargetNames(context, parameter, values): 'for using ccache when building examples.')) @click.pass_context def main(context, log_level, target, enable_link_map_file, repo, - out_prefix, pregen_dir, clean, dry_run, dry_run_output, enable_flashbundle, - no_log_timestamps, pw_command_launcher): + out_prefix, ninja_jobs, pregen_dir, clean, dry_run, dry_run_output, + enable_flashbundle, no_log_timestamps, pw_command_launcher): # Ensures somewhat pretty logging of what is going on log_fmt = '%(asctime)s %(levelname)-7s %(message)s' if no_log_timestamps: @@ -161,7 +168,7 @@ def main(context, log_level, target, enable_link_map_file, repo, logging.info('Building targets: %s', CommaSeparate(requested_targets)) context.obj = build.Context( - repository_path=repo, output_prefix=out_prefix, runner=runner) + repository_path=repo, output_prefix=out_prefix, ninja_jobs=ninja_jobs, runner=runner) context.obj.SetupBuilders(targets=requested_targets, options=BuilderOptions( enable_link_map_file=enable_link_map_file, enable_flashbundle=enable_flashbundle, diff --git a/scripts/build/builders/ameba.py b/scripts/build/builders/ameba.py index 802ce1f73c..a4b3338b0c 100644 --- a/scripts/build/builders/ameba.py +++ b/scripts/build/builders/ameba.py @@ -85,8 +85,12 @@ def generate(self): title='Generating ' + self.identifier) def _build(self): - self._Execute(['ninja', '-C', self.output_dir], - title='Building ' + self.identifier) + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + self._Execute(cmd, title='Building ' + self.identifier) def build_outputs(self): yield BuilderOutput( diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 94d3a566a6..3f640177f1 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -466,8 +466,13 @@ def _build(self): title="Building APP " + self.identifier, ) else: + cmd = ["ninja", "-C", self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + self._Execute( - ["ninja", "-C", self.output_dir], + cmd, title="Building JNI " + self.identifier, ) diff --git a/scripts/build/builders/gn.py b/scripts/build/builders/gn.py index d2b09f393c..6d9385bd4f 100644 --- a/scripts/build/builders/gn.py +++ b/scripts/build/builders/gn.py @@ -95,6 +95,8 @@ def _build(self): self.PreBuildCommand() cmd = ['ninja', '-C', self.output_dir] + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) if self.build_command: cmd.append(self.build_command) diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 624bd9ad74..8d209d6d29 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -84,6 +84,7 @@ class HostApp(Enum): AIR_QUALITY_SENSOR = auto() NETWORK_MANAGER = auto() ENERGY_MANAGEMENT = auto() + WATER_LEAK_DETECTOR = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -154,6 +155,8 @@ def ExamplePath(self): return 'network-manager-app/linux' elif self == HostApp.ENERGY_MANAGEMENT: return 'energy-management-app/linux' + elif self == HostApp.WATER_LEAK_DETECTOR: + return 'water-leak-detector/linux' else: raise Exception('Unknown app type: %r' % self) @@ -266,6 +269,9 @@ def OutputNames(self): elif self == HostApp.ENERGY_MANAGEMENT: yield 'chip-energy-management-app' yield 'chip-energy-management-app.map' + elif self == HostApp.WATER_LEAK_DETECTOR: + yield 'water-leak-detector-app' + yield 'water-leak-detector-app.map' else: raise Exception('Unknown app type: %r' % self) @@ -564,7 +570,14 @@ def generate(self): def PreBuildCommand(self): if self.app == HostApp.TESTS and self.use_coverage: - self._Execute(['ninja', '-C', self.output_dir, 'default'], title="Build-only") + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + cmd.append('default') + + self._Execute(cmd, title="Build-only") self._Execute(['lcov', '--initial', '--capture', '--directory', os.path.join(self.output_dir, 'obj'), '--exclude', os.path.join(self.chip_dir, '**/tests/*'), '--exclude', os.path.join(self.chip_dir, 'zzz_generated/*'), diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index 5fbc417ffe..b94a695359 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -215,8 +215,12 @@ def generate(self): def _build(self): logging.info('Compiling NrfConnect at %s', self.output_dir) - self._Execute(['ninja', '-C', self.output_dir], - title='Building ' + self.identifier) + cmd = ['ninja', '-C', self.output_dir] + + if self.ninja_jobs is not None: + cmd.append('-j' + str(self.ninja_jobs)) + + self._Execute(cmd, title='Building ' + self.identifier) if self.app == NrfApp.UNIT_TESTS: # Note: running zephyr/zephyr.elf has the same result except it creates diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 6ac4c30ca2..2badbce4d1 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -238,6 +238,9 @@ def _build(self): cmd = self.get_cmd_prefixes() + ("ninja -C %s" % self.output_dir) + if self.ninja_jobs is not None: + cmd += " -j%s" % str(self.ninja_jobs) + self._Execute(['bash', '-c', cmd], title='Building ' + self.identifier) def build_outputs(self): diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index b9b9c59661..8c7968888e 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -39,11 +39,6 @@ class TizenApp(Enum): 'examples/all-clusters-app/tizen', ('chip-all-clusters-app', 'chip-all-clusters-app.map')) - ALL_CLUSTERS_MINIMAL = App( - 'chip-all-clusters-minimal-app', - 'examples/all-clusters-minimal-app/tizen', - ('chip-all-clusters-minimal-app', - 'chip-all-clusters-minimal-app.map')) LIGHT = App( 'chip-lighting-app', 'examples/lighting-app/tizen', diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 93e375c857..c9a9a40eed 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -9,7 +9,7 @@ efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing][-data-model-disabled][-data-model-enabled] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management,water-leak-detector}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] 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][-trustm] @@ -21,6 +21,6 @@ nrf-native-posix-64-tests nuttx-x64-light qpg-qpg6105-{lock,light,shell,persistent-storage,light-switch,thermostat}[-updateimage][-data-model-disabled][-data-model-enabled] stm32-stm32wb5mm-dk-light -tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] +tizen-arm-{all-clusters,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan][-with-ui] telink-{tlsr9118bdk40d,tlsr9518adk80d,tlsr9528a,tlsr9528a_retention,tlsr9258a,tlsr9258a_retention}-{air-quality-sensor,all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-ota][-dfu][-shell][-rpc][-factory-data][-4mb][-mars][-usb][-data-model-disabled][-data-model-enabled] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/icecc.sh b/scripts/icecc.sh new file mode 100755 index 0000000000..54783a4874 --- /dev/null +++ b/scripts/icecc.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2024 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. +# + +# This scripts starts or stops the iceccd. +# It's meant to be use within devcontainer. + +if [ "$1" = "start" ]; then + IFS='.' read -ra PARTS <<<"$HOSTNAME" + if iceccd -d -m 0 -N "devcontainer-${PARTS[0]}"; then + echo "iceccd started" + else + echo "Failed to start iceccd" + fi +fi + +if [ "$1" = "stop" ]; then + if pkill icecc; then + echo "iceccd stopped" + else + echo "Failed to stop iceccd" + fi +fi diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 1573cc7065..4f61d26be7 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -14,6 +14,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/binding-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml"; @@ -108,6 +109,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/wake-on-lan-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/washer-controls-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/webrtc-requestor-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/webrtc-provider-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-diagnostics-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/wifi-network-management-cluster.xml"; @@ -119,6 +121,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.x load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml"; all endpoints { // These attributes follow a different code path and do not have to be diff --git a/scripts/run-clang-tidy-on-compile-commands.py b/scripts/run-clang-tidy-on-compile-commands.py index 407caaa6f4..ee3bdc8f33 100755 --- a/scripts/run-clang-tidy-on-compile-commands.py +++ b/scripts/run-clang-tidy-on-compile-commands.py @@ -40,6 +40,7 @@ import tempfile import threading import traceback +from pathlib import Path import click import coloredlogs @@ -92,20 +93,19 @@ def __init__(self, json_entry, gcc_sysroot=None): # # However that seems to potentially disable a lot, so for now just filter out the # offending argument - command_items = [arg for arg in command_items if arg not in {'-c', '-S'}] + command_items = [arg for arg in command_items if arg not in {"-c", "-S"}] # Allow gcc/g++ invocations to also be tidied - arguments should be # compatible and on darwin gcc/g++ is actually a symlink to clang - if compiler in ['clang++', 'clang', 'gcc', 'g++']: + if compiler in ["clang++", "clang", "gcc", "g++"]: self.valid = True self.clang_arguments = command_items[1:] else: - logging.warning( - "Cannot tidy %s - not a clang compile command", self.file) + logging.warning("Cannot tidy %s - not a clang compile command", self.file) return - if compiler in ['gcc', 'g++'] and gcc_sysroot: - self.clang_arguments.insert(0, '--sysroot='+gcc_sysroot) + if compiler in ["gcc", "g++"] and gcc_sysroot: + self.clang_arguments.insert(0, "--sysroot=" + gcc_sysroot) @property def full_path(self): @@ -122,8 +122,12 @@ def SetChecks(self, checks: str): def Check(self): logging.debug("Running tidy on %s from %s", self.file, self.directory) try: - cmd = ["clang-tidy", self.file] + \ - self.tidy_arguments + ["--"] + self.clang_arguments + cmd = ( + ["clang-tidy", self.file] + + self.tidy_arguments + + ["--"] + + self.clang_arguments + ) logging.debug("Executing: %r" % cmd) proc = subprocess.Popen( @@ -156,7 +160,7 @@ def Check(self): "Use -system-headers to display errors from system headers as well.", ] - for line in err.decode('utf-8').split('\n'): + for line in err.decode("utf-8").split("\n"): line = line.strip() if any(map(lambda s: s in line, skip_strings)): @@ -165,7 +169,7 @@ def Check(self): if not line: continue # no empty lines - logging.warning('TIDY %s: %s', self.file, line) + logging.warning("TIDY %s: %s", self.file, line) if proc.returncode != 0: if proc.returncode < 0: @@ -203,18 +207,20 @@ def Failure(self, path: str): def find_darwin_gcc_sysroot(): - for line in subprocess.check_output('xcodebuild -sdk -version'.split()).decode('utf8').split('\n'): - if not line.startswith('Path: '): + for line in subprocess.check_output( + "xcodebuild -sdk -version".split(), text=True + ).splitlines(): + if not line.startswith("Path: "): continue - path = line[line.find(': ')+2:] - if '/MacOSX.platform/' not in path: + path = line[line.find(": ") + 2:] + if "/MacOSX.platform/" not in path: continue logging.info("Found %s" % path) return path # A hard-coded value that works on default installations logging.warning("Using default platform sdk path. This may be incorrect.") - return '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' + return "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" class ClangTidyRunner: @@ -228,13 +234,12 @@ def __init__(self): self.gcc_sysroot = None self.file_names_to_check = set() - if sys.platform == 'darwin': + if sys.platform == "darwin": # Darwin gcc invocation will auto select a system root, however clang requires an explicit path since # we are using the built-in pigweed clang-tidy. - logging.info( - 'Searching for a MacOS system root for gcc invocations...') + logging.info("Searching for a MacOS system root for gcc invocations...") self.gcc_sysroot = find_darwin_gcc_sysroot() - logging.info(' Chose: %s' % self.gcc_sysroot) + logging.info(" Chose: %s" % self.gcc_sysroot) def AddDatabase(self, compile_commands_json): database = json.load(open(compile_commands_json)) @@ -245,7 +250,7 @@ def AddDatabase(self, compile_commands_json): continue if item.file in self.file_names_to_check: - logging.info('Ignoring additional request for checking %s', item.file) + logging.info("Ignoring additional request for checking %s", item.file) continue self.file_names_to_check.add(item.file) @@ -270,12 +275,12 @@ def Cleanup(self): # Allow all diagnostics for distinct paths to be applied # at once but never again for future paths for d in diagnostics: - if d['DiagnosticMessage']['FilePath'] not in already_seen: + if d["DiagnosticMessage"]["FilePath"] not in already_seen: all_diagnostics.append(d) # in the future assume these files were already processed for d in diagnostics: - already_seen.add(d['DiagnosticMessage']['FilePath']) + already_seen.add(d["DiagnosticMessage"]["FilePath"]) if all_diagnostics: with open(self.fixes_file, "w") as out: @@ -304,8 +309,7 @@ def ExportFixesTo(self, f): for idx, e in enumerate(self.entries): e.ExportFixesTo( os.path.join( - self.fixes_temporary_file_dir.name, "fixes%d.yaml" % ( - idx + 1,) + self.fixes_temporary_file_dir.name, "fixes%d.yaml" % (idx + 1,) ) ) @@ -407,6 +411,12 @@ def Check(self): type=str, help="Checks to run (passed in to clang-tidy). If not set the .clang-tidy file is used.", ) +@click.option( + "--file-list-file", + default=None, + type=click.Path(exists=True), + help="When provided, only tidy files that match files mentioned in this file.", +) @click.pass_context def main( context, @@ -417,6 +427,7 @@ def main( no_log_timestamps, export_fixes, checks, + file_list_file, ): log_fmt = "%(asctime)s %(levelname)-7s %(message)s" if no_log_timestamps: @@ -452,6 +463,14 @@ def cleanup(): r = re.compile(file_exclude_regex) runner.FilterEntries(lambda e: not r.search(e.file)) + if file_list_file: + acceptable = set() + with open(file_list_file, "rt") as f: + for file_name in f.readlines(): + acceptable.add(Path(file_name.strip()).resolve().as_posix()) + + runner.FilterEntries(lambda e: e.full_path in acceptable) + if export_fixes: runner.ExportFixesTo(export_fixes) @@ -492,4 +511,4 @@ def cmd_fix(context): if __name__ == "__main__": - main(auto_envvar_prefix='CHIP') + main(auto_envvar_prefix="CHIP") diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 38dec06969..20cf55478c 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2024.08.14-nightly.1"] + "tags": ["version:2@v2024.10.11-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@v2024.08.14-nightly.1"] + "tags": ["version:2@v2024.10.11-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 5e2fd1daf0..044bdcd3d9 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2024.08.14-nightly +v2024.10.11-nightly diff --git a/scripts/spec_xml/generate_spec_xml.py b/scripts/spec_xml/generate_spec_xml.py index 0d41b3f519..43582fdb36 100755 --- a/scripts/spec_xml/generate_spec_xml.py +++ b/scripts/spec_xml/generate_spec_xml.py @@ -24,26 +24,17 @@ from pathlib import Path import click +from paths import Branch, get_chip_root, get_data_model_path, get_documentation_file_path, get_in_progress_defines -DEFAULT_CHIP_ROOT = os.path.abspath( - os.path.join(os.path.dirname(__file__), '..', '..')) -DEFAULT_OUTPUT_DIR_1_3 = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', '1.3')) -DEFAULT_OUTPUT_DIR_IN_PROGRESS = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'in_progress')) -DEFAULT_OUTPUT_DIR_TOT = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'data_model', 'master')) -DEFAULT_DOCUMENTATION_FILE = os.path.abspath( - os.path.join(DEFAULT_CHIP_ROOT, 'docs', 'spec_clusters.md')) - -# questions -# is energy-calendar still in? -# is heat-pump out? wasn't in 0.7 -# location-cluster - is this define gone now? -# queuedpreset - is this define gone now? -CURRENT_IN_PROGRESS_DEFINES = ['aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', 'energy-calendar', 'energy-drlc', - 'energy-management', 'heat-pump', 'hrap-1', 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', - 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup'] +# Use the get_in_progress_defines() function to fetch the in-progress defines +CURRENT_IN_PROGRESS_DEFINES = get_in_progress_defines() + +# Replace hardcoded paths with dynamic paths using paths.py functions +DEFAULT_CHIP_ROOT = get_chip_root() +DEFAULT_OUTPUT_DIR_1_3 = get_data_model_path(Branch.V1_3) +DEFAULT_OUTPUT_DIR_IN_PROGRESS = get_data_model_path(Branch.IN_PROGRESS) +DEFAULT_OUTPUT_DIR_TOT = get_data_model_path(Branch.MASTER) +DEFAULT_DOCUMENTATION_FILE = get_documentation_file_path() def get_xml_path(filename, output_dir): @@ -90,7 +81,6 @@ def make_asciidoc(target: str, include_in_progress: str, spec_dir: str, dry_run: '--include-in-progress', type=click.Choice(['All', 'None', 'Current']), default='All') def main(scraper, spec_root, output_dir, dry_run, include_in_progress): - # Clusters need to be scraped first because the cluster directory is passed to the device type directory if not output_dir: output_dir_map = {'All': DEFAULT_OUTPUT_DIR_TOT, 'None': DEFAULT_OUTPUT_DIR_1_3, 'Current': DEFAULT_OUTPUT_DIR_IN_PROGRESS} output_dir = output_dir_map[include_in_progress] @@ -103,30 +93,28 @@ def main(scraper, spec_root, output_dir, dry_run, include_in_progress): def scrape_clusters(scraper, spec_root, output_dir, dry_run, include_in_progress): 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')) + 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')) + media_clusters_dir = os.path.abspath(os.path.join(app_clusters_dir, 'media')) + + clusters_output_dir = os.path.join(output_dir, 'clusters') if not os.path.exists(clusters_output_dir): os.makedirs(clusters_output_dir) - print('Generating main spec to get file include list - this make take a few minutes') + print('Generating main spec to get file include list - this may take a few minutes') main_out = make_asciidoc('pdf', include_in_progress, spec_root, dry_run) - print('Generating cluster spec to get file include list - this make take a few minutes') + print('Generating cluster spec to get file include list - this may take a few minutes') cluster_out = make_asciidoc('pdf-appclusters-book', include_in_progress, spec_root, dry_run) def scrape_cluster(filename: str) -> None: base = Path(filename).stem if base not in main_out and base not in cluster_out: - print(f'skipping file: {base} as it is not compiled into the asciidoc') + print(f'Skipping file: {base} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, clusters_output_dir) - cmd = [scraper, 'cluster', '-i', filename, '-o', - xml_path, '-nd'] + cmd = [scraper, 'cluster', '-i', filename, '-o', xml_path, '-nd'] if include_in_progress == 'All': cmd.extend(['--define', 'in-progress']) elif include_in_progress == 'Current': @@ -150,33 +138,29 @@ def scrape_all_clusters(dir: str, exclude_list: list[str] = []) -> None: tree = ElementTree.parse(f'{xml_path}') root = tree.getroot() cluster = next(root.iter('cluster')) - # If there's no cluster ID table, this isn't a cluster try: next(cluster.iter('clusterIds')) except StopIteration: - # If there's no cluster ID table, this isn't a cluster just some kind of intro adoc print(f'Removing file {xml_path} as it does not include any cluster definitions') os.remove(xml_path) continue def scrape_device_types(scraper, spec_root, output_dir, dry_run, include_in_progress): - device_type_dir = os.path.abspath( - os.path.join(spec_root, 'src', 'device_types')) - device_types_output_dir = os.path.abspath( - os.path.join(output_dir, 'device_types')) + device_type_dir = os.path.abspath(os.path.join(spec_root, 'src', 'device_types')) + device_types_output_dir = os.path.abspath(os.path.join(output_dir, 'device_types')) clusters_output_dir = os.path.abspath(os.path.join(output_dir, 'clusters')) if not os.path.exists(device_types_output_dir): os.makedirs(device_types_output_dir) - print('Generating device type library to get file include list - this make take a few minutes') + print('Generating device type library to get file include list - this may take a few minutes') device_type_output = make_asciidoc('pdf-devicelibrary-book', include_in_progress, spec_root, dry_run) def scrape_device_type(filename: str) -> None: base = Path(filename).stem if base not in device_type_output: - print(f'skipping file: {filename} as it is not compiled into the asciidoc') + print(f'Skipping file: {filename} as it is not compiled into the asciidoc') return xml_path = get_xml_path(filename, device_types_output_dir) cmd = [scraper, 'devicetype', '-c', '-cls', clusters_output_dir, diff --git a/scripts/spec_xml/paths.py b/scripts/spec_xml/paths.py new file mode 100644 index 0000000000..3a5159cc51 --- /dev/null +++ b/scripts/spec_xml/paths.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 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 enum import Enum + +# Define a branch enum for different versions or branches + + +class Branch(Enum): + MASTER = "master" + V1_3 = "v1_3" + V1_4 = "v1_4" + IN_PROGRESS = "in_progress" + + +def get_chip_root(): + """ + Returns the CHIP root directory, trying the environment variable first + and falling back if necessary. + """ + chip_root = os.getenv('PW_PROJECT_ROOT') + if chip_root: + return chip_root + else: + try: + return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) + except Exception as e: + raise EnvironmentError( + "Unable to determine CHIP root directory. Please ensure the environment is activated." + ) from e + + +def get_data_model_path(branch: Branch): + """ + Returns the path to the data model directory for a given branch. + """ + chip_root = get_chip_root() + data_model_path = os.path.join(chip_root, 'data_model', branch.value) + if not os.path.exists(data_model_path): + raise FileNotFoundError(f"Data model path for branch {branch} does not exist: {data_model_path}") + return data_model_path + + +def get_spec_xml_output_path(): + """ + Returns the path to the output directory for generated XML files. + """ + chip_root = get_chip_root() + output_dir = os.path.join(chip_root, 'out', 'spec_xml') + if not os.path.exists(output_dir): + os.makedirs(output_dir) # Automatically create the directory if it doesn't exist + return output_dir + + +def get_documentation_file_path(): + """ + Returns the path to the documentation file. + """ + chip_root = get_chip_root() + documentation_file = os.path.join(chip_root, 'docs', 'spec_clusters.md') + if not os.path.exists(documentation_file): + raise FileNotFoundError(f"Documentation file does not exist: {documentation_file}") + return documentation_file + + +def get_python_testing_path(): + """ + Returns the path to the python_testing directory. + """ + chip_root = get_chip_root() + python_testing_path = os.path.join(chip_root, 'src', 'python_testing') + if not os.path.exists(python_testing_path): + raise FileNotFoundError(f"Python testing directory does not exist: {python_testing_path}") + return python_testing_path + + +def get_in_progress_defines(): + """ + Returns a list of defines that are currently in progress. + This can be updated dynamically as needed. + """ + return [ + 'aliro', 'atomicwrites', 'battery-storage', 'device-location', 'e2e-jf', + 'energy-calendar', 'energy-drlc', 'energy-management', 'heat-pump', 'hrap-1', + 'hvac', 'matter-fabric-synchronization', 'metering', 'secondary-net', + 'service-area-cluster', 'solar-power', 'tcp', 'water-heater', 'wifiSetup' + ] + + +def get_available_branches(): + """ + Return a list of available branches for the data model. + This can be expanded or dynamically fetched if necessary. + """ + return [Branch.MASTER, Branch.V1_3, Branch.V1_4] diff --git a/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py b/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py index 567bf146c7..0753c7aed1 100755 --- a/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py +++ b/scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py @@ -57,9 +57,9 @@ def run_test_section(self, app_args: str, script_args: str, factory_reset_all: b cmd = self.get_base_run_python_cmd(self.run_python_test_path, self.app_path, app_args, self.script_path, script_args) if factory_reset_all: - cmd = cmd + ' --factoryreset' + cmd = cmd + ' --factory-reset' if factory_reset_app: - cmd = cmd + ' --factoryreset-app-only' + cmd = cmd + ' --factory-reset-app-only' logging.info(f'Running cmd {cmd}') diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 161d3b8c0c..5cb891a014 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -235,6 +235,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "TestReadNoneSubscribeNone.yaml", # chip-repl does not support AnyCommands (07/27/2023) "Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023) "Test_TC_BRBINFO_2_1.yaml", # chip-repl does not support AnyCommands (24/07/2024) + "TestThermostat.yaml", # chip-repl does not support AnyCommands (14/10/2024) "TestIcdManagementCluster.yaml", # TODO(#30430): add ICD registration support in chip-repl "Test_TC_ICDM_3_4.yaml", # chip-repl does not support ICD registration # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 diff --git a/scripts/tests/run_python_test.py b/scripts/tests/run_python_test.py index d7d3c6955a..0c40f9ac30 100755 --- a/scripts/tests/run_python_test.py +++ b/scripts/tests/run_python_test.py @@ -71,9 +71,9 @@ def process_test_script_output(line, is_stderr): @click.command() @click.option("--app", type=click.Path(exists=True), default=None, help='Path to local application to use, omit to use external apps.') -@click.option("--factoryreset", is_flag=True, +@click.option("--factory-reset/--no-factory-reset", default=None, help='Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests.') -@click.option("--factoryreset-app-only", is_flag=True, +@click.option("--factory-reset-app-only/--no-factory-reset-app-only", default=None, help='Remove app config and repl configs (/tmp/chip* and /tmp/repl*) before running the tests, but not the controller config') @click.option("--app-args", type=str, default='', help='The extra arguments passed to the device. Can use placeholders like {SCRIPT_BASE_NAME}') @@ -90,9 +90,10 @@ def process_test_script_output(line, is_stderr): help='Script arguments, can use placeholders like {SCRIPT_BASE_NAME}.') @click.option("--script-gdb", is_flag=True, help='Run script through gdb') -@click.option("--quiet", is_flag=True, help="Do not print output from passing tests. Use this flag in CI to keep github log sizes manageable.") +@click.option("--quiet/--no-quiet", default=None, + help="Do not print output from passing tests. Use this flag in CI to keep GitHub log size manageable.") @click.option("--load-from-env", default=None, help="YAML file that contains values for environment variables.") -def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: str, +def main(app: str, factory_reset: bool, factory_reset_app_only: bool, app_args: str, app_ready_pattern: str, script: str, script_args: str, script_gdb: bool, quiet: bool, load_from_env): if load_from_env: reader = MetadataReader(load_from_env) @@ -106,18 +107,23 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st app_args=app_args, app_ready_pattern=app_ready_pattern, script_args=script_args, - factory_reset=factoryreset, - factory_reset_app_only=factoryreset_app_only, script_gdb=script_gdb, - quiet=quiet ) ] if not runs: - raise Exception( - "No valid runs were found. Make sure you add runs to your file, see https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md document for reference/example.") + raise click.ClickException( + "No valid runs were found. Make sure you add runs to your file, see " + "https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md document for reference/example.") - coloredlogs.install(level='INFO') + # Override runs Metadata with the command line arguments + for run in runs: + if factory_reset is not None: + run.factory_reset = factory_reset + if factory_reset_app_only is not None: + run.factory_reset_app_only = factory_reset_app_only + if quiet is not None: + run.quiet = quiet for run in runs: logging.info("Executing %s %s", run.py_script_path.split('/')[-1], run.run) @@ -215,4 +221,5 @@ def main_impl(app: str, factory_reset: bool, factory_reset_app_only: bool, app_a if __name__ == '__main__': + coloredlogs.install(level='INFO') main(auto_envvar_prefix='CHIP') diff --git a/scripts/tools/bouffalolab/generate_factory_data.py b/scripts/tools/bouffalolab/generate_factory_data.py new file mode 100755 index 0000000000..28f362ba2d --- /dev/null +++ b/scripts/tools/bouffalolab/generate_factory_data.py @@ -0,0 +1,556 @@ +#!/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 argparse +import base64 +import binascii +import logging as log +import os +import random +import secrets +import subprocess +import sys +from datetime import datetime, timedelta +from pathlib import Path + +from Crypto.Cipher import AES +from cryptography import x509 +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.primitives.serialization import load_der_private_key +from cryptography.x509.oid import ObjectIdentifier + +MATTER_ROOT = os.path.dirname(os.path.realpath(__file__))[:-len("/scripts/tools/bouffalolab")] + +TEST_CD_CERT = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Cert.pem" +TEST_CD_KEY = MATTER_ROOT + "/credentials/test/certification-declaration/Chip-Test-CD-Signing-Key.pem" +TEST_PAA_CERT = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-FFF1-Cert.pem" +TEST_PAA_KEY = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAA-FFF1-Key.pem" +TEST_PAI_CERT = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAI-FFF1-8000-Cert.pem" +TEST_PAI_KEY = MATTER_ROOT + "/credentials/test/attestation/Chip-Test-PAI-FFF1-8000-Key.pem" +TEST_CHIP_CERT = MATTER_ROOT + "/out/linux-x64-chip-cert/chip-cert" +TEST_CD_TYPE = 1 # 0 - development, 1 - provisional, 2 - official + + +def gen_test_passcode(passcode): + + INVALID_PASSCODES = [0, 11111111, 22222222, 33333333, 44444444, + 55555555, 66666666, 77777777, 88888888, 99999999, + 12345678, 87654321] + + def check_passcode(passcode): + return 0 <= passcode <= 99999999 and passcode not in INVALID_PASSCODES + + if isinstance(passcode, int): + if check_passcode(passcode): + raise Exception("passcode is invalid value.") + return passcode + + passcode = -1 + while not check_passcode(passcode): + passcode = random.randint(0, 99999999) + + return passcode + + +def gen_test_discriminator(discriminator): + + if isinstance(discriminator, int): + if discriminator > 0xfff: + raise Exception("discriminator is invalid value.") + + discriminator = random.randint(0, 0xfff) + + return discriminator + + +def gen_test_unique_id(unique_id): + + if isinstance(unique_id, bytes): + if len(unique_id) != 16: + raise Exception("rotating unique id has invalid length.") + return unique_id + + unique_id = secrets.token_bytes(16) + + return unique_id + + +def gen_test_spake2(passcode, spake2p_it, spake2p_salt, spake2p_verifier=None): + + sys.path.insert(0, os.path.join(MATTER_ROOT, 'scripts', 'tools', 'spake2p')) + from spake2p import generate_verifier + + if isinstance(spake2p_it, int): + if not 1000 <= spake2p_it <= 100000: + raise Exception("SPAKE2+ iteration count out of range.") + else: + spake2p_it = random.randint(1000, 100000) + + if spake2p_salt is None: + spake2p_salt_len = random.randint(16, 32) + spake2p_salt = bytes(random.sample(range(0, 255), spake2p_salt_len)) + else: + spake2p_salt = base64.b64decode(spake2p_salt) + if not 16 <= len(spake2p_salt) <= 32: + raise Exception("SPAKE2+ slat is invalid.") + + if spake2p_verifier is None: + spake2p_verifier = generate_verifier(passcode, spake2p_salt, spake2p_it) + else: + if generate_verifier(passcode, spake2p_salt, spake2p_it) != spake2p_verifier: + raise Exception("SPAKE2+ verifier is invalid.") + + return spake2p_it, spake2p_salt, spake2p_verifier + + +def gen_test_certs(chip_cert: str, + output: str, + vendor_id: int, + product_id: int, + device_name: str, + cd_cert: str = None, + cd_key: str = None, + cd: str = None, + paa_cert: str = None, + paa_key: str = None, + pai_cert: str = None, + pai_key: str = None, + dac_cert: str = None, + dac_key: str = None): + + def parse_cert_file(cert): + + def get_subject_attr(subject, oid): + try: + return subject.get_attributes_for_oid(oid) + except Exception: + return None + + if not os.path.isfile(cert): + return None, None, None, None, None + + with open(cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + + vendor_id = None + product_id = None + for attribute in cert.subject: + if ObjectIdentifier('1.3.6.1.4.1.37244.2.1') == attribute.oid: + vendor_id = int(attribute.value, 16) + if ObjectIdentifier('1.3.6.1.4.1.37244.2.2') == attribute.oid: + product_id = int(attribute.value, 16) + + issue_date = cert.not_valid_before + expire_date = cert.not_valid_after + + return vendor_id, product_id, issue_date, expire_date + + def verify_certificates(chip_cert, paa_cert, pai_cert, dac_cert): + + if not os.path.isfile(pai_cert) or not os.path.isfile(dac_cert): + raise Exception("PAI certificate or DAC certificate is not specified.") + + with open(pai_cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + pai_public_key = cert.public_key() + + with open(dac_cert, 'rb') as cert_file: + cert = x509.load_pem_x509_certificate(cert_file.read(), default_backend()) + + try: + pai_public_key.verify(cert.signature, cert.tbs_certificate_bytes, ec.ECDSA(hashes.SHA256())) + except Exception: + raise Exception("Failed to verify DAC signature with PAI certificate.") + + if (pai_cert != TEST_PAI_CERT and paa_cert != TEST_PAA_CERT) or (pai_cert == TEST_PAI_CERT and paa_cert == TEST_PAA_CERT): + if os.path.isfile(paa_cert): + cmd = [chip_cert, "validate-att-cert", + "--dac", dac_cert, + "--pai", pai_cert, + "--paa", paa_cert, + ] + log.info("Verify Certificate Chain: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + def gen_dac_certificate(chip_cert, device_name, vendor_id, product_id, pai_cert, pai_key, dac_cert, dac_key, pai_issue_date, pai_expire_date): + def gen_valid_times(issue_date, expire_date): + now = datetime.now() - timedelta(days=1) + + if not (issue_date <= now <= expire_date): + raise Exception("Invalid time in test PAI to generate DAC.") + + return now.strftime('%Y%m%d%H%M%SZ'), (expire_date - now).days + + if not os.path.isfile(dac_cert) or not os.path.isfile(dac_key): + if not os.path.isfile(pai_cert) or not os.path.isfile(pai_key): + raise Exception("No test PAI certificate/key specified for test DAC generation.") + + valid_from, lifetime = gen_valid_times(pai_issue_date, pai_expire_date) + cmd = [chip_cert, "gen-att-cert", + "--type", "d", # device attestation certificate + "--subject-cn", device_name + " Test DAC 0", + "--subject-vid", hex(vendor_id), + "--subject-pid", hex(product_id), + "--ca-cert", pai_cert, + "--ca-key", pai_key, + "--out", dac_cert, + "--out-key", dac_key, + "--valid-from", valid_from, + "--lifetime", str(lifetime), + ] + log.info("Generate DAC: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + def convert_pem_to_der(chip_cert, action, pem): + + if not os.path.isfile(pem): + raise Exception("File {} is not existed.".format(pem)) + + der = Path(pem).with_suffix(".der") + if not os.path.isfile(der): + cmd = [chip_cert, action, pem, der, "--x509-der", ] + subprocess.run(cmd) + + return der + + def gen_cd(chip_cert, dac_vendor_id, dac_product_id, vendor_id, product_id, cd_cert, cd_key, cd): + + if os.path.isfile(cd): + return + + cmd = [chip_cert, "gen-cd", + "--key", cd_key, + "--cert", cd_cert, + "--out", cd, + "--format-version", "1", + "--vendor-id", hex(vendor_id), + "--product-id", hex(product_id), + "--device-type-id", "0x1234", + "--certificate-id", "ZIG20141ZB330001-24", + "--security-level", "0", + "--security-info", "0", + "--certification-type", str(TEST_CD_TYPE), + "--version-number", "9876", + ] + + if dac_vendor_id != vendor_id or dac_product_id != product_id: + cmd += ["--dac-origin-vendor-id", hex(dac_vendor_id), + "--dac-origin-product-id", hex(dac_product_id), + ] + + log.info("Generate CD: {}".format(" ".join(cmd))) + subprocess.run(cmd) + + pai_vendor_id, pai_product_id, pai_issue_date, pai_expire_date = parse_cert_file(pai_cert) + + dac_vendor_id = pai_vendor_id if pai_vendor_id else vendor_id + dac_product_id = pai_product_id if pai_product_id else product_id + gen_dac_certificate(chip_cert, device_name, dac_vendor_id, dac_product_id, pai_cert, + pai_key, dac_cert, dac_key, pai_issue_date, pai_expire_date) + + dac_cert_der = convert_pem_to_der(chip_cert, "convert-cert", dac_cert) + dac_key_der = convert_pem_to_der(chip_cert, "convert-key", dac_key) + pai_cert_der = convert_pem_to_der(chip_cert, "convert-cert", pai_cert) + + dac_vendor_id, dac_product_id, *_ = parse_cert_file(dac_cert) + paa_vendor_id, paa_product_id, *_ = parse_cert_file(paa_cert) + + verify_certificates(chip_cert, paa_cert, pai_cert, dac_cert) + + gen_cd(chip_cert, dac_vendor_id, dac_product_id, vendor_id, product_id, cd_cert, cd_key, cd) + + return cd, pai_cert_der, dac_cert_der, dac_key_der + + +def gen_mfd_partition(args, mfd_output): + + def int_to_2bytearray_l(intvalue): + src = bytearray(2) + src[1] = (intvalue >> 8) & 0xFF + src[0] = (intvalue >> 0) & 0xFF + return src + + def int_to_4bytearray_l(intvalue): + src = bytearray(4) + src[3] = (intvalue >> 24) & 0xFF + src[2] = (intvalue >> 16) & 0xFF + src[1] = (intvalue >> 8) & 0xFF + src[0] = (intvalue >> 0) & 0xFF + return src + + def gen_efuse_aes_iv(): + return bytes(random.sample(range(0, 0xff), 12) + [0] * 4) + + def read_file(rfile): + with open(rfile, 'rb') as _f: + return _f.read() + + def get_private_key(der): + with open(der, 'rb') as file: + keys = load_der_private_key(file.read(), password=None, backend=default_backend()) + private_key = keys.private_numbers().private_value.to_bytes(32, byteorder='big') + + return private_key + + def encrypt_data(data_bytearray, key_bytearray, iv_bytearray): + data_bytearray += bytes([0] * (16 - (len(data_bytearray) % 16))) + cryptor = AES.new(key_bytearray, AES.MODE_CBC, iv_bytearray) + ciphertext = cryptor.encrypt(data_bytearray) + return ciphertext + + def convert_to_bytes(data): + if isinstance(data, bytes) or isinstance(data, str): + if isinstance(data, str): + return data.encode() + else: + return data + elif isinstance(data, int): + byte_len = int((data.bit_length() + 7) / 8) + return data.to_bytes(byte_len, byteorder='little') + elif data is None: + return bytes([]) + else: + raise Exception("Data is invalid type: {}".format(type(data))) + + def gen_tlvs(mfdDict, need_sec): + MFD_ID_RAW_MASK = 0x8000 + + sec_tlvs = bytes([]) + raw_tlvs = bytes([]) + + for name in mfdDict.keys(): + d = mfdDict[name] + if d["sec"] and need_sec: + if d["len"] and d["len"] < len(d["data"]): + raise Exception("Data size of {} is over {}".format(name, d["len"])) + sec_tlvs += int_to_2bytearray_l(d["id"]) + sec_tlvs += int_to_2bytearray_l(len(d["data"])) + sec_tlvs += d["data"] + + for name in mfdDict.keys(): + d = mfdDict[name] + if not d["sec"] or not need_sec: + if d["len"] and d["len"] < len(d["data"]): + raise Exception("Data size of {} is over {}".format(name, d["len"])) + raw_tlvs += int_to_2bytearray_l(d["id"] + MFD_ID_RAW_MASK) + raw_tlvs += int_to_2bytearray_l(len(d["data"])) + raw_tlvs += d["data"] + + return sec_tlvs, raw_tlvs + + mfdDict = { + "aes_iv": {'sec': False, "id": 1, "len": 16, "data": gen_efuse_aes_iv() if args.key else bytes([0] * 16)}, + "dac_cert": {'sec': False, "id": 2, "len": None, "data": read_file(args.dac_cert)}, + "dac_key": {'sec': True, "id": 3, "len": None, "data": get_private_key(args.dac_key)}, + "passcode": {'sec': False, "id": 4, "len": 4, "data": convert_to_bytes(args.passcode)}, + "pai_cert": {'sec': False, "id": 5, "len": None, "data": read_file(args.pai_cert)}, + "cd": {'sec': False, "id": 6, "len": None, "data": read_file(args.cd)}, + "sn": {'sec': False, "id": 7, "len": 32, "data": convert_to_bytes(args.sn)}, + "discriminator": {'sec': False, "id": 8, "len": 2, "data": convert_to_bytes(args.discriminator)}, + "uid": {'sec': False, "id": 9, "len": 32, "data": convert_to_bytes(args.unique_id)}, + "spake2p_it": {'sec': False, "id": 10, "len": 4, "data": convert_to_bytes(args.spake2p_it)}, + "spake2p_salt": {'sec': False, "id": 11, "len": 32, "data": convert_to_bytes(args.spake2p_salt)}, + "spake2p_verifier": {'sec': False, "id": 12, "len": None, "data": convert_to_bytes(args.spake2p_verifier)}, + "vendor_name": {'sec': False, "id": 13, "len": 32, "data": convert_to_bytes(args.vendor_name)}, + "vendor_id": {'sec': False, "id": 14, "len": 2, "data": convert_to_bytes(args.vendor_id)}, + "product_name": {'sec': False, "id": 15, "len": 32, "data": convert_to_bytes(args.product_name)}, + "product_id": {'sec': False, "id": 16, "len": 2, "data": convert_to_bytes(args.product_id)}, + "product_part_no": {'sec': False, "id": 17, "len": 32, "data": convert_to_bytes(args.product_part_no)}, + "product_url": {'sec': False, "id": 18, "len": 256, "data": convert_to_bytes(args.product_url)}, + "product_label": {'sec': False, "id": 19, "len": 64, "data": convert_to_bytes(args.product_label)}, + "manufactoring_date": {'sec': False, "id": 20, "len": 16, "data": convert_to_bytes(args.manufactoring_date)}, + "hardware_ver": {'sec': False, "id": 21, "len": 4, "data": convert_to_bytes(args.hardware_version)}, + "hardware_ver_str": {'sec': False, "id": 22, "len": 64, "data": convert_to_bytes(args.hardware_version_string)}, + } + + sec_tlvs, raw_tlvs = gen_tlvs(mfdDict, args.key) + + output = bytes([]) + + sec_tlvs = sec_tlvs and encrypt_data(sec_tlvs, args.key, mfdDict["aes_iv"]["data"]) + + output = int_to_4bytearray_l(len(sec_tlvs)) + output += sec_tlvs + output += int_to_4bytearray_l(binascii.crc32(sec_tlvs)) + output += int_to_4bytearray_l(len(raw_tlvs)) + output += raw_tlvs + output += int_to_4bytearray_l(binascii.crc32(raw_tlvs)) + + with open(mfd_output, "wb+") as fp: + fp.write(output) + + +def gen_onboarding_data(args, onboard_txt, onboard_png, rendez=6): + + try: + import qrcode + from SetupPayload import CommissioningFlow, SetupPayload + except ImportError: + sys.path.append(os.path.join(MATTER_ROOT, "src/setup_payload/python")) + try: + import qrcode + from SetupPayload import CommissioningFlow, SetupPayload + except Exception: + raise Exception("Please make sure qrcode has been installed.") + else: + raise Exception("Please make sure qrcode has been installed.") + + setup_payload = SetupPayload(discriminator=args.discriminator, + pincode=args.passcode, + rendezvous=rendez, + flow=CommissioningFlow.Standard, + vid=args.vendor_id, + pid=args.product_id) + with open(onboard_txt, "w") as manual_code_file: + manual_code_file.write("Manualcode : " + setup_payload.generate_manualcode() + "\n") + manual_code_file.write("QRCode : " + setup_payload.generate_qrcode()) + qr = qrcode.make(setup_payload.generate_qrcode()) + qr.save(onboard_png) + + return setup_payload.generate_manualcode(), setup_payload.generate_qrcode() + + +def main(): + + def check_arg(args): + + if not isinstance(args.output, str) or not os.path.exists(args.output): + raise Exception("output path is not specified or not existed.") + log.info("output path: {}".format(args.output)) + + if not isinstance(args.chip_cert, str) or not os.path.exists(args.chip_cert): + raise Exception("chip-cert should be built before and is specified.") + log.info("chip-cert path: {}".format(args.chip_cert)) + + def to_bytes(input): + if isinstance(input, str): + return bytearray.fromhex(input) + elif isinstance(input, bytes): + return input + else: + return None + + parser = argparse.ArgumentParser(description="Bouffalo Lab Factory Data generator tool") + + parser.add_argument("--dac_cert", type=str, help="DAC certificate file.") + parser.add_argument("--dac_key", type=str, help="DAC certificate privat key.") + parser.add_argument("--passcode", type=int, help="Setup pincode, optional.") + parser.add_argument("--pai_cert", type=str, default=TEST_PAI_CERT, help="PAI certificate file.") + parser.add_argument("--cd", type=str, help="Certificate Declaration file.") + parser.add_argument("--sn", type=str, default="Test SN", help="Serial Number, optional.") + parser.add_argument("--discriminator", type=int, help="Discriminator ID, optional.") + parser.add_argument("--unique_id", type=base64.b64decode, help="Rotating Unique ID in hex string, optional.") + parser.add_argument("--spake2p_it", type=int, default=None, help="Spake2+ iteration count, optional.") + parser.add_argument("--spake2p_salt", type=base64.b64decode, help="Spake2+ salt in hex string, optional.") + + parser.add_argument("--vendor_id", type=int, default=0x130D, help="Vendor Identification, mandatory.") + parser.add_argument("--vendor_name", type=str, default="Bouffalo Lab", help="Vendor Name string, optional.") + parser.add_argument("--product_id", type=int, default=0x1001, help="Product Identification, mandatory.") + parser.add_argument("--product_name", type=str, default="Test Product", help="Product Name string, optional.") + + parser.add_argument("--product_part_no", type=str, help="Product Part number, optional.") + parser.add_argument("--product_url", type=str, help="Product Web URL, optional.") + parser.add_argument("--product_label", type=str, help="Product Web URL, optional.") + parser.add_argument("--manufactoring_date", type=str, help="Product Web URL, optional.") + parser.add_argument("--hardware_version", type=int, help="Product Web URL, optional.") + parser.add_argument("--hardware_version_string", type=str, help="Product Web URL, optional.") + parser.add_argument("--rendezvous", type=int, default=6, help="Rendezvous Mode for QR code generation") + + parser.add_argument("--output", type=str, help="output path.") + parser.add_argument("--key", type=str, help="Encrypt private part in mfd.") + + parser.add_argument("--cd_cert", type=str, default=TEST_CD_CERT, help="for test, to sign certificate declaration.") + parser.add_argument("--cd_key", type=str, default=TEST_CD_KEY, help="for test, to sign certificate declaration.") + parser.add_argument("--paa_cert", type=str, default=TEST_PAA_CERT, help="for test, to verify certificate chain.") + parser.add_argument("--paa_key", type=str, default=TEST_PAA_KEY, help="for test, to sign pai certificate.") + parser.add_argument("--pai_key", type=str, default=TEST_PAI_KEY, help="for test, to sign dac certificate.") + parser.add_argument("--chip_cert", type=str, default=TEST_CHIP_CERT, help="for test, the tool to issue dac certificate.") + + args = parser.parse_args() + + log.basicConfig(format='[%(levelname)s] %(message)s', level=log.INFO) + + check_arg(args) + + passcode = gen_test_passcode(args.passcode) + discriminator = gen_test_discriminator(args.discriminator) + unique_id = gen_test_unique_id(args.unique_id) + spake2p_it, spake2p_salt, spake2p_verifier = gen_test_spake2(passcode, args.spake2p_it, args.spake2p_salt) + + vp_info = "{}_{}".format(hex(args.vendor_id), hex(args.product_id)) + vp_disc_info = "{}_{}_{}".format(hex(args.vendor_id), hex(args.product_id), discriminator) + if args.dac_cert is None: + args.dac_cert = os.path.join(args.output, "out_{}_dac_cert.pem".format(vp_disc_info)) + args.dac_key = os.path.join(args.output, "out_{}_dac_key.pem".format(vp_disc_info)) + + if args.cd is None: + args.cd = os.path.join(args.output, "out_{}_cd.der".format(vp_info)) + + cd, pai_cert_der, dac_cert_der, dac_key_der = gen_test_certs(args.chip_cert, + args.output, + args.vendor_id, + args.product_id, + args.vendor_name, + args.cd_cert, + args.cd_key, + args.cd, + args.paa_cert, + args.paa_key, + args.pai_cert, + args.pai_key, + args.dac_cert, + args.dac_key) + + mfd_output = os.path.join(args.output, "out_{}_mfd.bin".format(vp_disc_info)) + args.dac_cert = dac_cert_der + args.dac_key = dac_key_der + args.passcode = passcode + args.pai_cert = pai_cert_der + args.cd = cd + args.discriminator = discriminator + args.unique_id = unique_id + args.spake2p_it = spake2p_it + args.spake2p_salt = spake2p_salt + args.spake2p_verifier = spake2p_verifier + args.key = to_bytes(args.key) + gen_mfd_partition(args, mfd_output) + + onboard_txt = os.path.join(args.output, "out_{}_onboard.txt".format(vp_disc_info)) + onboard_png = os.path.join(args.output, "out_{}_onboard.png".format(vp_disc_info)) + manualcode, qrcode = gen_onboarding_data(args, onboard_txt, onboard_png, args.rendezvous) + + log.info("") + log.info("Output as below: ") + log.info("Passcode: {}".format(passcode)) + log.info("Discriminator ID: {}".format(discriminator)) + log.info("Rotating Unique ID: {}".format(unique_id.hex())) + log.info("Rotating Unique ID base64 code: {}".format(base64.b64encode(unique_id).decode())) + log.info("SPAKE2+ iteration: {}".format(spake2p_it)) + log.info("SPAKE2+ slat: {}".format(spake2p_salt.hex())) + log.info("SPAKE2+ slat base code: {}".format(base64.b64encode(spake2p_salt).decode())) + log.info("Manual code: {}".format(manualcode)) + log.info("QR code: {}".format(qrcode)) + + log.info("") + log.info("MFD partition file: {}".format(mfd_output)) + log.info("QR code PNG file: {}".format(onboard_png)) + + +if __name__ == "__main__": + main() diff --git a/scripts/tools/cancel_workflows_for_pr.py b/scripts/tools/cancel_workflows_for_pr.py new file mode 100755 index 0000000000..fe5f028bc3 --- /dev/null +++ b/scripts/tools/cancel_workflows_for_pr.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2024 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 datetime +import logging +import re +from typing import Optional, Set + +import click +import coloredlogs +from dateutil.tz import tzlocal +from github import Github +from github.Commit import Commit +from github.PullRequest import PullRequest + +__LOG_LEVELS__ = { + "debug": logging.DEBUG, + "info": logging.INFO, + "warn": logging.WARN, + "fatal": logging.FATAL, +} + +REPOSITORY = "project-chip/connectedhomeip" + + +class Canceller: + def __init__(self, token: str, dry_run: bool): + self.api = Github(token) + self.repo = self.api.get_repo(REPOSITORY) + self.dry_run = dry_run + + def check_all_pending_prs(self, max_age, required_runs): + cutoff = datetime.datetime.now(tzlocal()) - max_age + logging.info("Searching PRs updated after %s", cutoff) + for pr in self.repo.get_pulls(state="open", sort="updated", direction="desc"): + pr_update = pr.updated_at if pr.updated_at else pr.created_at + pr_update = pr_update.astimezone(tzlocal()) + + if pr_update < cutoff: + logging.warning( + "PR is too old (since %s, cutoff at %s). Skipping the rest...", + pr_update, + cutoff, + ) + break + logging.info( + "Examining PR %d updated at %s: %s", pr.number, pr_update, pr.title + ) + self.check_pr(pr, required_runs) + + def check_pr(self, pr: PullRequest, required_runs): + + last_commit: Optional[Commit] = None + + for commit in pr.get_commits(): + logging.debug(" Found commit %s", commit.sha) + if pr.head.sha == commit.sha: + last_commit = commit + break + + if last_commit is None: + logging.error("Could not find any commit in the pull request.") + return + + logging.info("Last commit is: %s", last_commit.sha) + + in_progress_workflows: Set[int] = set() + failed_check_names: Set[str] = set() + + # Gather all workflows along with failed workflow names + for check_suite in last_commit.get_check_suites(): + if check_suite.conclusion == "success": + # Finished without errors. Nothing to do here + continue + for run in check_suite.get_check_runs(): + if run.conclusion is not None and run.conclusion != "failure": + logging.debug( + " Run %s is not interesting: (state %s, conclusion %s)", + run.name, + run.status, + run.conclusion, + ) + continue + + # TODO: I am unclear how to really find the workflow id, however the + # HTML URL is like https://github.com/project-chip/connectedhomeip/actions/runs/11261874698/job/31316278705 + # so need whatever is after run. + m = re.match(r".*/actions/runs/([\d]+)/job/.*", run.html_url) + if not m: + logging.error( + "Failed to extract workflow number from %s", run.html_url + ) + continue + + workflow_id = int(m.group(1)) + if run.conclusion is None: + logging.info( + " Workflow %d (i.e. %s) still pending: %s", + workflow_id, + run.name, + run.status, + ) + in_progress_workflows.add(workflow_id) + elif run.conclusion == "failure": + workflow = self.repo.get_workflow_run(workflow_id) + logging.warning(" Workflow %s Failed", workflow.name) + failed_check_names.add(workflow.name) + + if not any([name in failed_check_names for name in required_runs]): + logging.info("No critical failures found") + return + + for id in in_progress_workflows: + workflow = self.repo.get_workflow_run(id) + if self.dry_run: + logging.warning("DRY RUN: Will not stop %s", workflow.name) + else: + workflow.cancel() + logging.warning("Stopping workflow %s", workflow.name) + + +@click.command() +@click.option( + "--log-level", + default="INFO", + type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output.", +) +@click.option("--gh-api-token", help="Github token to use") +@click.option("--token-file", help="Read github token from the given file") +@click.option("--dry-run", default=False, is_flag=True, help="Actually cancel or not") +@click.option( + "--max-pr-age-days", default=0, type=int, help="How many days to look at PRs" +) +@click.option( + "--max-pr-age-minutes", default=0, type=int, help="How many minutes to look at PRs" +) +@click.option("--require", multiple=True, default=[], help="Name of required runs") +def main( + log_level, + gh_api_token, + token_file, + dry_run, + max_pr_age_days, + max_pr_age_minutes, + require, +): + coloredlogs.install( + level=__LOG_LEVELS__[log_level], fmt="%(asctime)s %(levelname)-7s %(message)s" + ) + + if gh_api_token: + gh_token = gh_api_token + elif token_file: + gh_token = open(token_file, "rt").read().strip() + else: + raise Exception("Require a --gh-api-token or --token-file to access github") + + max_age = datetime.timedelta(days=max_pr_age_days, minutes=max_pr_age_minutes) + if max_age == datetime.timedelta(): + raise Exception( + "Please specifiy a max age of minutes or days (--max-pr-age-days or --max-pr-age-minutes)" + ) + + Canceller(gh_token, dry_run).check_all_pending_prs(max_age, require) + + +if __name__ == "__main__": + main() diff --git a/scripts/tools/file_size_from_nm.py b/scripts/tools/file_size_from_nm.py new file mode 100755 index 0000000000..a5d53b26dc --- /dev/null +++ b/scripts/tools/file_size_from_nm.py @@ -0,0 +1,432 @@ +#!/usr/bin/env -S python3 -B +# +# Copyright (c) 2024 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. +# + +# Displays a treemap code size as read by `nm` over a binary +# +# Example call: +# +# scripts/tools/file_size_from_nm.py \ +# --max-depth 5 \ +# out/nrf-nrf52840dk-light-data-model-enabled/nrfconnect/zephyr/zephyr.elf +# + +# Requires: +# click +# cxxfilt +# coloredlogs +# pandas +# plotly + +import logging +import subprocess +from dataclasses import dataclass +from enum import Enum, auto +from pathlib import Path +from typing import Optional + +import click +import coloredlogs +import cxxfilt +import plotly.express as px +import plotly.graph_objects as go + +# 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, +} + + +class ChartStyle(Enum): + TREE_MAP = auto() + SUNBURST = auto() + + +__CHART_STYLES__ = { + "treemap": ChartStyle.TREE_MAP, + "sunburst": ChartStyle.SUNBURST, +} + + +@dataclass +class Symbol: + name: str + symbol_type: str + offset: int + size: int + + +def tree_display_name(name: str) -> list[str]: + """ + Convert the given name from NM into a tree path. + + It splits the name by C++ namespaces, however it also specifically handles + 'emberAf' prefixes to make them common and uses 'vtable for' information + """ + + name = cxxfilt.demangle(name) + + if name.startswith("non-virtual thunk to "): + name = name[21:] + if name.startswith("vtable for "): + name = name[11:] + + # These are C-style methods really, we have no top-level namespaces named + # like this but still want to see these differently + for special_prefix in {"emberAf", "Matter"}: + if name.startswith(special_prefix): + return [special_prefix, name] + + # If the first element contains a space, it is either within `<>` for templates or it means it is a + # separator of the type. Try to find the type separator + # + # Logic: + # - try to find the first space OUTSIDE <> and before '(' + space_pos = 0 + indent = 0 + type_prefix = "" + while space_pos < len(name): + c = name[space_pos] + if c == "<": + indent += 1 + elif c == ">": + indent -= 1 + elif c == " " and indent == 0: + # FOUND A SPACE, move it to the last + type_prefix = name[:space_pos] + " " + space_pos += 1 + name = name[space_pos:] + break + elif c == "(" and indent == 0: + # a bracket not within templates means we are done! + break + space_pos += 1 + + # completely skip any arguments ... i.e. anything after ( + brace_pos = 0 + indent = 0 + type_suffix = "" + while brace_pos < len(name): + c = name[brace_pos] + if c == "<": + indent += 1 + elif c == ">": + indent -= 1 + elif c == "(" and indent == 0: + # FOUND A SPACE, move it to the last + type_suffix = name[brace_pos:] + name = name[:brace_pos] + break + brace_pos += 1 + + # name may be split by namespace and looks like foo::bar::baz + # HOWEVER for templates we want to split foo::Bar::Baz into + # [foo, Bar::Baz] + # + # General way things look like: + # TYPE FUNC # notice the space + # CONSTRUCTOR() + result = [] + while "::" in name: + ns_idx = name.find("::") + less_idx = name.find("<") + if less_idx >= 0 and ns_idx > less_idx: + # at this point, we have to find the matched `>` for this, assuming there ARE + # nested `>` entries, including multiple of them + pos = less_idx + 1 + indent = 1 + while indent > 0: + if name[pos] == ">": + indent -= 1 + elif name[pos] == "<": + indent += 1 + pos += 1 + if pos == len(name): + break + result.append(name[:pos]) + name = name[pos:] + if name.startswith("::"): + name = name[2:] + else: + result.append(name[:ns_idx]) + ns_idx += 2 + name = name[ns_idx:] + result.append(type_prefix + name + type_suffix) + + if len(result) == 1: + if result[0].startswith("ot"): # Show openthread methods a bit grouped + result = ["ot"] + result + return ["C"] + result + + return result + + +# TO run the test, install pytest and do +# pytest file_size_from_nm.py +def test_tree_display_name(): + assert tree_display_name("fooBar") == ["C", "fooBar"] + assert tree_display_name("emberAfTest") == ["emberAf", "emberAfTest"] + assert tree_display_name("MatterSomeCall") == ["Matter", "MatterSomeCall"] + assert tree_display_name("chip::Some::Constructor()") == [ + "chip", + "Some", + "Constructor()", + ] + + assert tree_display_name("chip::Some::Constructor(int arg1, int arg2)") == [ + "chip", + "Some", + "Constructor(int arg1, int arg2)", + ] + + assert tree_display_name( + "chip::Some::Constructor(int arg1, int arg2)" + ) == [ + "chip", + "Some", + "Constructor(int arg1, int arg2)", + ] + + assert tree_display_name("void my::function::call()") == [ + "my", + "function", + "void call()", + ] + assert tree_display_name("chip::ChipError my::function::call()") == [ + "my", + "function", + "chip::ChipError call()", + ] + assert tree_display_name("chip::test::baz my::function::call()") == [ + "my", + "function", + "chip::test::baz call()", + ] + assert tree_display_name( + "chip::test::baz my::function::call()" + ) == [ + "my", + "function", + "chip::test::baz call()", + ] + assert tree_display_name( + "chip::app::CommandIsFabricScoped(unsigned int, unsigned int)" + ) == ["chip", "app", "CommandIsFabricScoped(unsigned int, unsigned int)"] + assert tree_display_name("chip::app::AdvertiseAsOperational()") == [ + "chip", + "app", + "AdvertiseAsOperational()", + ] + + assert tree_display_name( + "void foo::bar::method(my::arg name, other::arg::type)" + ) == ["foo", "bar", "void method(my::arg name, other::arg::type)"] + + +def build_treemap( + name: str, + symbols: list[Symbol], + style: ChartStyle, + max_depth: int, + zoom: Optional[str], + strip: Optional[str], +): + # A treemap is based on parents (with title) + + # Naming rules: + # namespaces/prefixes are "::(::)" + # Actual names will be parented by their suffixes + + root = f"FILE: {name}" + if zoom: + root = root + f" (FILTER: {zoom})" + data: dict[str, list] = dict(name=[root], parent=[""], size=[0], hover=[""]) + + known_parents: set[str] = set() + total_sizes: dict = {} + + for symbol in symbols: + tree_name = tree_display_name(symbol.name) + + if zoom is not None: + partial = "" + # try to filter out the tree name. If it contains the zoom item, keep it, otherwise discard + while tree_name and partial != zoom: + partial += "::" + tree_name[0] + tree_name = tree_name[1:] + if not tree_name: + continue + + if strip is not None: + partial = "" + for part_name in tree_name: + partial = "::" + part_name + if partial == strip: + break + if partial == strip: + continue + + partial = "" + for name in tree_name[:-1]: + next_value = partial + "::" + name + if next_value not in known_parents: + known_parents.add(next_value) + data["name"].append(next_value) + data["parent"].append(partial if partial else root) + data["size"].append(0) + data["hover"].append(next_value) + total_sizes[next_value] = total_sizes.get(next_value, 0) + symbol.size + partial = next_value + + # the name MUST be added + data["name"].append(cxxfilt.demangle(symbol.name)) + data["parent"].append(partial if partial else root) + data["size"].append(symbol.size) + data["hover"].append(f"{symbol.name} of type {symbol.symbol_type}") + + for idx, label in enumerate(data["name"]): + if data["size"][idx] == 0: + data["hover"][idx] = f"{label}: {total_sizes.get(label, 0)}" + + if style == ChartStyle.TREE_MAP: + fig = go.Figure( + go.Treemap( + labels=data["name"], + parents=data["parent"], + values=data["size"], + textinfo="label+value+percent parent", + hovertext=data["hover"], + maxdepth=max_depth, + ) + ) + else: + fig = px.sunburst( + data, + names="name", + parents="parent", + values="size", + maxdepth=max_depth, + ) + + fig.update_traces(root_color="lightgray") + fig.show() + + +@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( + "--display-type", + default="TREEMAP", + show_default=True, + type=click.Choice(list(__CHART_STYLES__.keys()), case_sensitive=False), + help="Style of the chart", +) +@click.option( + "--max-depth", + default=4, + show_default=True, + type=int, + help="Display depth by default", +) +@click.option( + "--zoom", + default=None, + help="Zoom in the graph to ONLY the specified path as root (e.g. ::chip::app)", +) +@click.option( + "--strip", + default=None, + help="Strip out a tree subset (e.g. ::C)", +) +@click.argument("elf-file", type=Path) +def main( + log_level, + elf_file: Path, + display_type: str, + max_depth: int, + zoom: Optional[str], + strip: Optional[str], +): + log_fmt = "%(asctime)s %(levelname)-7s %(message)s" + coloredlogs.install(level=__LOG_LEVELS__[log_level], fmt=log_fmt) + + items = subprocess.check_output( + [ + "nm", + "--print-size", + "--size-sort", # Filters out empty entries + "--radix=d", + elf_file.absolute().as_posix(), + ] + ).decode("utf8") + + symbols = [] + + # OUTPUT FORMAT: + # + for line in items.split("\n"): + if not line.strip(): + continue + offset, size, t, name = line.split(" ") + + size = int(size, 10) + offset = int(offset, 10) + + if t in { + # Text section + "t", + "T", + # Weak defines + "w", + "W", + # Initialized data + "d", + "D", + # Readonly + "r", + "R", + # Weak object + "v", + "V", + }: + logging.debug("Found %s of size %d", name, size) + symbols.append(Symbol(name=name, symbol_type=t, offset=offset, size=size)) + elif t in { + # BSS - 0-initialized, not code + "b", + "B", + }: + pass + else: + logging.error("SKIPPING SECTION %s", t) + + build_treemap( + elf_file.name, symbols, __CHART_STYLES__[display_type], max_depth, zoom, strip + ) + + +if __name__ == "__main__": + main(auto_envvar_prefix="CHIP") diff --git a/scripts/tools/nxp/factory_data_generator/README.md b/scripts/tools/nxp/factory_data_generator/README.md index 0aacaeb81a..e218e5ffd8 100644 --- a/scripts/tools/nxp/factory_data_generator/README.md +++ b/scripts/tools/nxp/factory_data_generator/README.md @@ -1,7 +1,7 @@ # NXP Factory Data Generator For usage of the tool, please see -[Guide for writing manufacturing data on NXP devices](../../../../docs/guides/nxp/nxp_manufacturing_flow.md). +[Guide for writing manufacturing data on NXP devices](../../../../docs/platforms/nxp/nxp_manufacturing_flow.md). ## Tool implementation diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 40bc2e2a4b..21257ef195 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 = '2024.8.14' +MIN_ZAP_VERSION = '2024.10.11' class ZapTool: diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 98e7225549..f3565cf5d9 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -417,6 +417,7 @@ source_set("command-handler-impl") { "${chip_root}/src/access:types", "${chip_root}/src/app/MessageDef", "${chip_root}/src/app/data-model", + "${chip_root}/src/app/data-model-provider", "${chip_root}/src/app/util:callbacks", "${chip_root}/src/lib/support", "${chip_root}/src/messaging", diff --git a/src/app/CommandHandlerImpl.cpp b/src/app/CommandHandlerImpl.cpp index 366199a3b9..2142af6349 100644 --- a/src/app/CommandHandlerImpl.cpp +++ b/src/app/CommandHandlerImpl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -390,55 +391,16 @@ Status CommandHandlerImpl::ProcessCommandDataIB(CommandDataIB::Parser & aCommand VerifyOrReturnError(err == CHIP_NO_ERROR, Status::InvalidAction); { - Status commandExists = mpCallback->CommandExists(concretePath); - if (commandExists != Status::Success) - { - ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint 0x%x", - ChipLogValueMEI(concretePath.mCommandId), ChipLogValueMEI(concretePath.mClusterId), - concretePath.mEndpointId); - return FallibleAddStatus(concretePath, commandExists) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - } - - { - Access::SubjectDescriptor subjectDescriptor = GetSubjectDescriptor(); - Access::RequestPath requestPath{ .cluster = concretePath.mClusterId, - .endpoint = concretePath.mEndpointId, - .requestType = Access::RequestType::kCommandInvokeRequest, - .entityId = concretePath.mCommandId }; - Access::Privilege requestPrivilege = RequiredPrivilege::ForInvokeCommand(concretePath); - err = Access::GetAccessControl().Check(subjectDescriptor, requestPath, requestPrivilege); - if (err != CHIP_NO_ERROR) - { - if ((err != CHIP_ERROR_ACCESS_DENIED) && (err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL)) - { - return FallibleAddStatus(concretePath, Status::Failure) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - // TODO: when wildcard invokes are supported, handle them to discard rather than fail with status - Status status = err == CHIP_ERROR_ACCESS_DENIED ? Status::UnsupportedAccess : Status::AccessRestricted; - return FallibleAddStatus(concretePath, status) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - } + DataModel::InvokeRequest request; - if (CommandNeedsTimedInvoke(concretePath.mClusterId, concretePath.mCommandId) && !IsTimedInvoke()) - { - // TODO: when wildcard invokes are supported, discard a - // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::NeedsTimedInteraction) != CHIP_NO_ERROR ? Status::Failure : Status::Success; - } - - if (CommandIsFabricScoped(concretePath.mClusterId, concretePath.mCommandId)) - { - // SPEC: Else if the command in the path is fabric-scoped and there is no accessing fabric, - // a CommandStatusIB SHALL be generated with the UNSUPPORTED_ACCESS Status Code. + request.path = concretePath; + request.subjectDescriptor = GetSubjectDescriptor(); + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, IsTimedInvoke()); - // Fabric-scoped commands are not allowed before a specific accessing fabric is available. - // This is mostly just during a PASE session before AddNOC. - if (GetAccessingFabricIndex() == kUndefinedFabricIndex) + Status preCheckStatus = mpCallback->ValidateCommandCanBeDispatched(request); + if (preCheckStatus != Status::Success) { - // TODO: when wildcard invokes are supported, discard a - // wildcard-expanded path instead of returning a status. - return FallibleAddStatus(concretePath, Status::UnsupportedAccess) != CHIP_NO_ERROR ? Status::Failure : Status::Success; + return FallibleAddStatus(concretePath, preCheckStatus) != CHIP_NO_ERROR ? Status::Failure : Status::Success; } } @@ -516,11 +478,19 @@ Status CommandHandlerImpl::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo // once up front and discard all the paths at once. Ordering with respect // to ACL and command presence checks does not matter, because the behavior // is the same for all of them: ignore the path. +#if !CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + + // Without data model interface, we can query individual commands. + // Data model interface queries commands by a full path so we need endpointID as well. + // + // Since this is a performance update and group commands are never timed, + // missing this should not be that noticeable. if (CommandNeedsTimedInvoke(clusterId, commandId)) { // Group commands are never timed. return Status::Success; } +#endif // No check for `CommandIsFabricScoped` unlike in `ProcessCommandDataIB()` since group commands // always have an accessing fabric, by definition. @@ -542,30 +512,21 @@ Status CommandHandlerImpl::ProcessGroupCommandDataIB(CommandDataIB::Parser & aCo const ConcreteCommandPath concretePath(mapping.endpoint_id, clusterId, commandId); - if (mpCallback->CommandExists(concretePath) != Status::Success) { - ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint 0x%x", - ChipLogValueMEI(commandId), ChipLogValueMEI(clusterId), mapping.endpoint_id); + DataModel::InvokeRequest request; - continue; - } + request.path = concretePath; + request.subjectDescriptor = GetSubjectDescriptor(); + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, IsTimedInvoke()); - { - Access::SubjectDescriptor subjectDescriptor = GetSubjectDescriptor(); - Access::RequestPath requestPath{ .cluster = concretePath.mClusterId, - .endpoint = concretePath.mEndpointId, - .requestType = Access::RequestType::kCommandInvokeRequest, - .entityId = concretePath.mCommandId }; - Access::Privilege requestPrivilege = RequiredPrivilege::ForInvokeCommand(concretePath); - err = Access::GetAccessControl().Check(subjectDescriptor, requestPath, requestPrivilege); - if (err != CHIP_NO_ERROR) + Status preCheckStatus = mpCallback->ValidateCommandCanBeDispatched(request); + if (preCheckStatus != Status::Success) { - // NOTE: an expected error is CHIP_ERROR_ACCESS_DENIED, but there could be other unexpected errors; - // therefore, keep processing subsequent commands, and if any errors continue, those subsequent - // commands will likewise fail. + // Command failed for a specific path, but keep trying the rest of the paths. continue; } } + if ((err = DataModelCallbacks::GetInstance()->PreCommandReceived(concretePath, GetSubjectDescriptor())) == CHIP_NO_ERROR) { TLV::TLVReader dataReader(commandDataReader); diff --git a/src/app/CommandHandlerImpl.h b/src/app/CommandHandlerImpl.h index ddd499658e..2603b96f22 100644 --- a/src/app/CommandHandlerImpl.h +++ b/src/app/CommandHandlerImpl.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -50,21 +51,29 @@ class CommandHandlerImpl : public CommandHandler */ virtual void OnDone(CommandHandlerImpl & apCommandObj) = 0; + /** + * Perform pre-validation that the command dispatch can be performed. In particular: + * - check command existence/validity + * - validate ACL + * - validate timed-invoke and fabric-scoped requirements + * + * Returns Status::Success if the command can be dispatched, otherwise it will + * return the status to be forwarded to the client on failure. + * + * Possible error return codes: + * - UnsupportedEndpoint/UnsupportedCluster/UnsupportedCommand if the command path is invalid + * - NeedsTimedInteraction + * - UnsupportedAccess (ACL failure or fabric scoped without a valid fabric index) + * - AccessRestricted + */ + virtual Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) = 0; + /* * Upon processing of a CommandDataIB, this method is invoked to dispatch the command * to the right server-side handler provided by the application. */ virtual void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) = 0; - - /* - * Check to see if a command implementation exists for a specific - * concrete command path. If it does, Success will be returned. If - * not, one of UnsupportedEndpoint, UnsupportedCluster, or - * UnsupportedCommand will be returned, depending on how the command - * fails to exist. - */ - virtual Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) = 0; }; struct InvokeResponseParameters diff --git a/src/app/CommandResponseSender.cpp b/src/app/CommandResponseSender.cpp index f23786e28d..0b028510c0 100644 --- a/src/app/CommandResponseSender.cpp +++ b/src/app/CommandResponseSender.cpp @@ -132,10 +132,10 @@ void CommandResponseSender::DispatchCommand(CommandHandlerImpl & apCommandObj, c mpCommandHandlerCallback->DispatchCommand(apCommandObj, aCommandPath, apPayload); } -Status CommandResponseSender::CommandExists(const ConcreteCommandPath & aCommandPath) +Protocols::InteractionModel::Status CommandResponseSender::ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) { - VerifyOrReturnValue(mpCommandHandlerCallback, Protocols::InteractionModel::Status::UnsupportedCommand); - return mpCommandHandlerCallback->CommandExists(aCommandPath); + VerifyOrReturnValue(mpCommandHandlerCallback, Protocols::InteractionModel::Status::Failure); + return mpCommandHandlerCallback->ValidateCommandCanBeDispatched(request); } CHIP_ERROR CommandResponseSender::SendCommandResponse() diff --git a/src/app/CommandResponseSender.h b/src/app/CommandResponseSender.h index 0e03a87f1e..f0b8f11d40 100644 --- a/src/app/CommandResponseSender.h +++ b/src/app/CommandResponseSender.h @@ -64,7 +64,7 @@ class CommandResponseSender : public Messaging::ExchangeDelegate, void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) override; - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) override; + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override; /** * Gets the inner exchange context object, without ownership. diff --git a/src/app/DefaultAttributePersistenceProvider.cpp b/src/app/DefaultAttributePersistenceProvider.cpp index 6e7120999f..40ce521362 100644 --- a/src/app/DefaultAttributePersistenceProvider.cpp +++ b/src/app/DefaultAttributePersistenceProvider.cpp @@ -41,7 +41,7 @@ CHIP_ERROR DefaultAttributePersistenceProvider::InternalReadValue(const StorageK { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); - uint16_t size = static_cast(min(aValue.size(), static_cast(UINT16_MAX))); + uint16_t size = static_cast(std::min(aValue.size(), static_cast(UINT16_MAX))); ReturnErrorOnFailure(mStorage->SyncGetKeyValue(aKey.KeyName(), aValue.data(), size)); aValue.reduce_size(size); return CHIP_NO_ERROR; diff --git a/src/app/DeferredAttributePersistenceProvider.cpp b/src/app/DeferredAttributePersistenceProvider.cpp index 8265279280..9480fba14e 100644 --- a/src/app/DeferredAttributePersistenceProvider.cpp +++ b/src/app/DeferredAttributePersistenceProvider.cpp @@ -81,7 +81,7 @@ void DeferredAttributePersistenceProvider::FlushAndScheduleNext() } else { - nextFlushTime = chip::min(nextFlushTime, da.GetFlushTime()); + nextFlushTime = std::min(nextFlushTime, da.GetFlushTime()); } } diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index b122333ac2..6f326b5fdb 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -42,10 +45,9 @@ #include #include #include +#include #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE -#include - // TODO: defaulting to codegen should eventually be an application choice and not // hard-coded in the interaction model #include @@ -89,6 +91,7 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM VerifyOrReturnError(apExchangeMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(reportScheduler != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + mState = State::kInitializing; mpExchangeMgr = apExchangeMgr; mpFabricTable = apFabricTable; mpCASESessionMgr = apCASESessionMgr; @@ -111,11 +114,14 @@ CHIP_ERROR InteractionModelEngine::Init(Messaging::ExchangeManager * apExchangeM ChipLogError(InteractionModel, "WARNING └────────────────────────────────────────────────────"); #endif + mState = State::kInitialized; return CHIP_NO_ERROR; } void InteractionModelEngine::Shutdown() { + VerifyOrReturn(State::kUninitialized != mState); + mpExchangeMgr->GetSessionManager()->SystemLayer()->CancelTimer(ResumeSubscriptionsTimerCallback, this); // TODO: individual object clears the entire command handler interface registry. @@ -187,6 +193,8 @@ void InteractionModelEngine::Shutdown() // // mpFabricTable = nullptr; // mpExchangeMgr = nullptr; + + mState = State::kUninitialized; } uint32_t InteractionModelEngine::GetNumActiveReadHandlers() const @@ -1646,6 +1654,8 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, DataModel::InvokeRequest request; request.path = aCommandPath; + request.invokeFlags.Set(DataModel::InvokeFlags::kTimed, apCommandObj.IsTimedInvoke()); + request.subjectDescriptor = apCommandObj.GetSubjectDescriptor(); std::optional status = GetDataModelProvider()->Invoke(request, apPayload, &apCommandObj); @@ -1678,7 +1688,91 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, #endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE } -Protocols::InteractionModel::Status InteractionModelEngine::CommandExists(const ConcreteCommandPath & aCommandPath) +Protocols::InteractionModel::Status InteractionModelEngine::ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) +{ + + Status status = CheckCommandExistence(request.path); + + if (status != Status::Success) + { + ChipLogDetail(DataManagement, "No command " ChipLogFormatMEI " in Cluster " ChipLogFormatMEI " on Endpoint %u", + ChipLogValueMEI(request.path.mCommandId), ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId); + return status; + } + + status = CheckCommandAccess(request); + VerifyOrReturnValue(status == Status::Success, status); + + return CheckCommandFlags(request); +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandAccess(const DataModel::InvokeRequest & aRequest) +{ + if (!aRequest.subjectDescriptor.has_value()) + { + return Status::UnsupportedAccess; // we require a subject for invoke + } + + Access::RequestPath requestPath{ .cluster = aRequest.path.mClusterId, + .endpoint = aRequest.path.mEndpointId, + .requestType = Access::RequestType::kCommandInvokeRequest, + .entityId = aRequest.path.mCommandId }; +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + std::optional commandInfo = mDataModelProvider->GetAcceptedCommandInfo(aRequest.path); + Access::Privilege minimumRequiredPrivilege = + commandInfo.has_value() ? commandInfo->invokePrivilege : Access::Privilege::kOperate; +#else + Access::Privilege minimumRequiredPrivilege = RequiredPrivilege::ForInvokeCommand(aRequest.path); +#endif + CHIP_ERROR err = Access::GetAccessControl().Check(*aRequest.subjectDescriptor, requestPath, minimumRequiredPrivilege); + if (err != CHIP_NO_ERROR) + { + if ((err != CHIP_ERROR_ACCESS_DENIED) && (err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL)) + { + return Status::Failure; + } + return err == CHIP_ERROR_ACCESS_DENIED ? Status::UnsupportedAccess : Status::AccessRestricted; + } + + return Status::Success; +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandFlags(const DataModel::InvokeRequest & aRequest) +{ +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + std::optional commandInfo = mDataModelProvider->GetAcceptedCommandInfo(aRequest.path); + // This is checked by previous validations, so it should not happen + VerifyOrDie(commandInfo.has_value()); + + const bool commandNeedsTimedInvoke = commandInfo->flags.Has(DataModel::CommandQualityFlags::kTimed); + const bool commandIsFabricScoped = commandInfo->flags.Has(DataModel::CommandQualityFlags::kFabricScoped); +#else + const bool commandNeedsTimedInvoke = CommandNeedsTimedInvoke(aRequest.path.mClusterId, aRequest.path.mCommandId); + const bool commandIsFabricScoped = CommandIsFabricScoped(aRequest.path.mClusterId, aRequest.path.mCommandId); +#endif + + if (commandNeedsTimedInvoke && !aRequest.invokeFlags.Has(DataModel::InvokeFlags::kTimed)) + { + return Status::NeedsTimedInteraction; + } + + if (commandIsFabricScoped) + { + // SPEC: Else if the command in the path is fabric-scoped and there is no accessing fabric, + // a CommandStatusIB SHALL be generated with the UNSUPPORTED_ACCESS Status Code. + + // Fabric-scoped commands are not allowed before a specific accessing fabric is available. + // This is mostly just during a PASE session before AddNOC. + if (aRequest.GetAccessingFabricIndex() == kUndefinedFabricIndex) + { + return Status::UnsupportedAccess; + } + } + + return Status::Success; +} + +Protocols::InteractionModel::Status InteractionModelEngine::CheckCommandExistence(const ConcreteCommandPath & aCommandPath) { #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE auto provider = GetDataModelProvider(); @@ -1835,7 +1929,7 @@ uint16_t InteractionModelEngine::GetMinGuaranteedSubscriptionsPerFabric() const return UINT16_MAX; #else return static_cast( - min(GetReadHandlerPoolCapacityForSubscriptions() / GetConfigMaxFabrics(), static_cast(UINT16_MAX))); + std::min(GetReadHandlerPoolCapacityForSubscriptions() / GetConfigMaxFabrics(), static_cast(UINT16_MAX))); #endif } diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index ba0a099bb7..ef4b041f19 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -508,7 +509,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, void DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) override; - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) override; + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override; bool HasActiveRead(); @@ -612,6 +613,10 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, void ShutdownMatchingSubscriptions(const Optional & aFabricIndex = NullOptional, const Optional & aPeerNodeId = NullOptional); + Status CheckCommandExistence(const ConcreteCommandPath & aCommandPath); + Status CheckCommandAccess(const DataModel::InvokeRequest & aRequest); + Status CheckCommandFlags(const DataModel::InvokeRequest & aRequest); + /** * Check if the given attribute path is a valid path in the data model provider. */ @@ -713,6 +718,14 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, DataModel::Provider * mDataModelProvider = nullptr; Messaging::ExchangeContext * mCurrentExchange = nullptr; + enum class State : uint8_t + { + kUninitialized, // The object has not been initialized. + kInitializing, // Initial setup is in progress (e.g. setting up mpExchangeMgr). + kInitialized // The object has been fully initialized and is ready for use. + }; + State mState = State::kUninitialized; + // Changes the current exchange context of a InteractionModelEngine to a given context class CurrentExchangeValueScope { diff --git a/src/app/MessageDef/StatusIB.cpp b/src/app/MessageDef/StatusIB.cpp index 63012cc64f..e1f4d6a74b 100644 --- a/src/app/MessageDef/StatusIB.cpp +++ b/src/app/MessageDef/StatusIB.cpp @@ -168,7 +168,7 @@ bool FormatStatusIBError(char * buf, uint16_t bufSize, CHIP_ERROR err) // formatted string, as long as we account for the possible string formats. constexpr size_t statusNameMaxLength = #define CHIP_IM_STATUS_CODE(name, spec_name, value) \ - max(sizeof(#spec_name), + std::max(sizeof(#spec_name), #include #undef CHIP_IM_STATUS_CODE static_cast(0) @@ -177,7 +177,7 @@ bool FormatStatusIBError(char * buf, uint16_t bufSize, CHIP_ERROR err) #include #undef CHIP_IM_STATUS_CODE ; - constexpr size_t formattedSize = max(sizeof(generalFormat) + statusNameMaxLength, sizeof(clusterFormat)); + constexpr size_t formattedSize = std::max(sizeof(generalFormat) + statusNameMaxLength, sizeof(clusterFormat)); char formattedString[formattedSize]; StatusIB status(err); diff --git a/src/app/OperationalSessionSetup.cpp b/src/app/OperationalSessionSetup.cpp index 3a9c4be619..a0af8fa3d0 100644 --- a/src/app/OperationalSessionSetup.cpp +++ b/src/app/OperationalSessionSetup.cpp @@ -744,7 +744,7 @@ CHIP_ERROR OperationalSessionSetup::ScheduleSessionSetupReattempt(System::Clock: "Our backoff calculation will overflow."); System::Clock::Timeout actualTimerDelay = System::Clock::Seconds16( static_cast(CHIP_DEVICE_CONFIG_AUTOMATIC_CASE_RETRY_INITIAL_DELAY_SECONDS - << min((mAttemptsDone - 1), CHIP_DEVICE_CONFIG_AUTOMATIC_CASE_RETRY_MAX_BACKOFF))); + << std::min((mAttemptsDone - 1), CHIP_DEVICE_CONFIG_AUTOMATIC_CASE_RETRY_MAX_BACKOFF))); const bool responseWasBusy = mRequestedBusyDelay != System::Clock::kZero; if (responseWasBusy) { diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 43dae0a99f..4794ead97e 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -741,7 +741,9 @@ CHIP_ERROR ReadHandler::ProcessSubscribeRequest(System::PacketBufferHandle && aP ReturnErrorOnFailure(err); ReturnErrorOnFailure(subscribeRequestParser.GetMinIntervalFloorSeconds(&mMinIntervalFloorSeconds)); - ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalCeilingSeconds(&mMaxInterval)); + ReturnErrorOnFailure(subscribeRequestParser.GetMaxIntervalCeilingSeconds(&mSubscriberRequestedMaxInterval)); + mMaxInterval = mSubscriberRequestedMaxInterval; + VerifyOrReturnError(mMinIntervalFloorSeconds <= mMaxInterval, CHIP_ERROR_INVALID_ARGUMENT); #if CHIP_CONFIG_ENABLE_ICD_SERVER diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index 1ddcb4ebf0..85976ec6bc 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -229,12 +229,31 @@ class ReadHandler : public Messaging::ExchangeDelegate const SingleLinkedListNode * GetEventPathList() const { return mpEventPathList; } const SingleLinkedListNode * GetDataVersionFilterList() const { return mpDataVersionFilterList; } + /** + * @brief Returns the reporting intervals that will used by the ReadHandler for the subscription being requested. + * After the subscription is established, these will be the set reporting intervals and cannot be changed. + * + * @param[out] aMinInterval minimum time delta between two reports for the subscription + * @param[in] aMaxInterval maximum time delta between two reports for the subscription + */ void GetReportingIntervals(uint16_t & aMinInterval, uint16_t & aMaxInterval) const { aMinInterval = mMinIntervalFloorSeconds; aMaxInterval = mMaxInterval; } + /** + * @brief Returns the maximum reporting interval that was initially requested by the subscriber + * This is the same value as the mMaxInterval member if the max interval is not changed by the publisher. + * + * @note If the device is an ICD, the MaxInterval of a subscription is automatically set to a multiple of the IdleModeDuration. + * This function is the only way to get the requested max interval once the OnSubscriptionRequested application callback + * is called. + * + * @return uint16_t subscriber requested maximum reporting interval + */ + inline uint16_t GetSubscriberRequestedMaxInterval() const { return mSubscriberRequestedMaxInterval; } + CHIP_ERROR SetMinReportingIntervalForTests(uint16_t aMinInterval) { VerifyOrReturnError(IsIdle(), CHIP_ERROR_INCORRECT_STATE); @@ -254,7 +273,7 @@ class ReadHandler : public Messaging::ExchangeDelegate { VerifyOrReturnError(IsIdle(), CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mMinIntervalFloorSeconds <= aMaxInterval, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(aMaxInterval <= std::max(GetPublisherSelectedIntervalLimit(), mMaxInterval), + VerifyOrReturnError(aMaxInterval <= std::max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval), CHIP_ERROR_INVALID_ARGUMENT); mMaxInterval = aMaxInterval; return CHIP_NO_ERROR; @@ -542,9 +561,10 @@ class ReadHandler : public Messaging::ExchangeDelegate // engine, the "oldest" subscription is the subscription with the smallest generation. uint64_t mTransactionStartGeneration = 0; - SubscriptionId mSubscriptionId = 0; - uint16_t mMinIntervalFloorSeconds = 0; - uint16_t mMaxInterval = 0; + SubscriptionId mSubscriptionId = 0; + uint16_t mMinIntervalFloorSeconds = 0; + uint16_t mMaxInterval = 0; + uint16_t mSubscriberRequestedMaxInterval = 0; EventNumber mEventMin = 0; diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 5050cbbee2..d2fde33930 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,7 @@ #include #include #include +#include #include #include @@ -41,8 +43,7 @@ namespace chip { namespace app { using namespace Protocols::InteractionModel; -using Status = Protocols::InteractionModel::Status; -constexpr uint8_t kListAttributeType = 0x48; +using Status = Protocols::InteractionModel::Status; CHIP_ERROR WriteHandler::Init(DataModel::Provider * apProvider, WriteHandlerDelegate * apWriteHandlerDelegate) { @@ -79,6 +80,30 @@ void WriteHandler::Close() MoveToState(State::Uninitialized); } +std::optional WriteHandler::IsListAttributePath(const ConcreteAttributePath & path) +{ +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + VerifyOrReturnValue(mDataModelProvider != nullptr, std::nullopt, + ChipLogError(DataManagement, "Null data model while checking attribute properties.")); + + auto info = mDataModelProvider->GetAttributeInfo(path); + if (!info.has_value()) + { + return std::nullopt; + } + + return info->flags.Has(DataModel::AttributeQualityFlags::kListAttribute); +#else + constexpr uint8_t kListAttributeType = 0x48; + const auto attributeMetadata = GetAttributeMetadata(path); + if (attributeMetadata == nullptr) + { + return std::nullopt; + } + return (attributeMetadata->attributeType == kListAttributeType); +#endif +} + Status WriteHandler::HandleWriteRequestMessage(Messaging::ExchangeContext * apExchangeContext, System::PacketBufferHandle && aPayload, bool aIsTimedWrite) { @@ -317,10 +342,7 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataIBs(TLV::TLVReader & aAttributeData err = element.GetData(&dataReader); SuccessOrExit(err); - const auto attributeMetadata = GetAttributeMetadata(dataAttributePath); - bool currentAttributeIsList = (attributeMetadata != nullptr && attributeMetadata->attributeType == kListAttributeType); - - if (!dataAttributePath.IsListOperation() && currentAttributeIsList) + if (!dataAttributePath.IsListOperation() && IsListAttributePath(dataAttributePath).value_or(false)) { dataAttributePath.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; } @@ -446,7 +468,7 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut mProcessingAttributePath, mStateFlags.Has(StateBits::kProcessingAttributeIsList), dataAttributePath); bool shouldReportListWriteBegin = false; // This will be set below. - const EmberAfAttributeMetadata * attributeMetadata = nullptr; + std::optional isListAttribute = std::nullopt; while (iterator->Next(mapping)) { @@ -460,11 +482,11 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut // Try to get the metadata from for the attribute from one of the expanded endpoints (it doesn't really matter which // endpoint we pick, as long as it's valid) and update the path info according to it and recheck if we need to report // list write begin. - if (attributeMetadata == nullptr) + if (!isListAttribute.has_value()) { - attributeMetadata = GetAttributeMetadata(dataAttributePath); - bool currentAttributeIsList = - (attributeMetadata != nullptr && attributeMetadata->attributeType == kListAttributeType); + isListAttribute = IsListAttributePath(dataAttributePath); + bool currentAttributeIsList = isListAttribute.value_or(false); + if (!dataAttributePath.IsListOperation() && currentAttributeIsList) { dataAttributePath.mListOp = ConcreteDataAttributePath::ListOperation::ReplaceAll; diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index fe63e028b8..33c068b8cd 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -189,6 +189,12 @@ class WriteHandler : public Messaging::ExchangeDelegate CHIP_ERROR WriteClusterData(const Access::SubjectDescriptor & aSubject, const ConcreteDataAttributePath & aPath, TLV::TLVReader & aData); + /// Checks whether the given path corresponds to a list attribute + /// Return values: + /// true/false: valid attribute path, known if list or not + /// std::nulloptr - path not available/valid, unknown if attribute is a list or not + std::optional IsListAttributePath(const ConcreteAttributePath & path); + Messaging::ExchangeHolder mExchangeCtx; WriteResponseMessage::Builder mWriteResponseBuilder; Optional mProcessingAttributePath; diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index e2d05adb01..11db6d4ec6 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -70,12 +70,17 @@ endfunction() # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) - cmake_parse_arguments(ARG "" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) + set(ADD_EMBER_INTERFACE_FILES TRUE) + cmake_parse_arguments(ARG "SKIP_EMBER_INTERFACE" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() + if(ARG_SKIP_EMBER_INTERFACE) + set(ADD_EMBER_INTERFACE_FILES FALSE) + endif() + # CMAKE data model auto-includes the server side implementation target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp @@ -159,7 +164,6 @@ function(chip_configure_data_model APP_TARGET) ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp - ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/ember-global-attribute-access-interface.cpp ${CHIP_APP_BASE_DIR}/util/ember-io-storage.cpp ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp @@ -169,4 +173,10 @@ function(chip_configure_data_model APP_TARGET) ${APP_GEN_FILES} ${APP_TEMPLATES_GEN_FILES} ) + + if(ADD_EMBER_INTERFACE_FILES) + target_sources(${APP_TARGET} ${SCOPE} + ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp + ) + endif() endfunction() diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 42b221c1a9..cc998948d8 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -209,11 +209,15 @@ template("chip_data_model") { "${_app_root}/util/DataModelHandler.cpp", "${_app_root}/util/attribute-storage.cpp", "${_app_root}/util/attribute-table.cpp", - "${_app_root}/util/ember-compatibility-functions.cpp", "${_app_root}/util/ember-global-attribute-access-interface.cpp", "${_app_root}/util/ember-io-storage.cpp", "${_app_root}/util/util.cpp", ] + + if (chip_use_data_model_interface != "enabled") { + # This applies to "check" or "disabled" (i.e. use ember-only or use ember for double-checking) + sources += [ "${_app_root}/util/ember-compatibility-functions.cpp" ] + } } if (defined(invoker.zap_file)) { 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 2a85888422..d43590da31 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -1093,7 +1093,7 @@ void ColorControlServer::SetHSVRemainingTime(chip::EndpointId endpoint) { bool hsvTransitionStart = (hueTransitionState->stepsRemaining == hueTransitionState->stepsTotal) || (saturationTransitionState->stepsRemaining == saturationTransitionState->stepsTotal); - SetQuietReportRemainingTime(endpoint, max(hueTransitionState->timeRemaining, saturationTransitionState->timeRemaining), + SetQuietReportRemainingTime(endpoint, std::max(hueTransitionState->timeRemaining, saturationTransitionState->timeRemaining), hsvTransitionStart); } } @@ -1283,7 +1283,7 @@ Status ColorControlServer::moveToSaturation(uint8_t saturation, uint16_t transit // now, kick off the state machine. initSaturationTransitionState(endpoint, colorSaturationTransitionState); colorSaturationTransitionState->finalValue = saturation; - colorSaturationTransitionState->stepsRemaining = max(transitionTime, 1); + colorSaturationTransitionState->stepsRemaining = std::max(transitionTime, 1); colorSaturationTransitionState->stepsTotal = colorSaturationTransitionState->stepsRemaining; colorSaturationTransitionState->timeRemaining = transitionTime; colorSaturationTransitionState->transitionTime = transitionTime; @@ -1363,7 +1363,7 @@ Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturati } colorHueTransitionState->up = moveUp; - colorHueTransitionState->stepsRemaining = max(transitionTime, 1); + colorHueTransitionState->stepsRemaining = std::max(transitionTime, 1); colorHueTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; colorHueTransitionState->timeRemaining = transitionTime; colorHueTransitionState->transitionTime = transitionTime; @@ -1614,7 +1614,7 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons colorHueTransitionState->finalHue = static_cast(hue); } - colorHueTransitionState->stepsRemaining = max(transitionTime, 1); + colorHueTransitionState->stepsRemaining = std::max(transitionTime, 1); colorHueTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; colorHueTransitionState->timeRemaining = transitionTime; colorHueTransitionState->transitionTime = transitionTime; @@ -1758,7 +1758,7 @@ bool ColorControlServer::stepHueCommand(app::CommandHandler * commandObj, const } } - colorHueTransitionState->stepsRemaining = max(transitionTime, 1); + colorHueTransitionState->stepsRemaining = std::max(transitionTime, 1); colorHueTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; colorHueTransitionState->timeRemaining = transitionTime; colorHueTransitionState->transitionTime = transitionTime; @@ -1934,7 +1934,7 @@ bool ColorControlServer::stepSaturationCommand(app::CommandHandler * commandObj, { colorSaturationTransitionState->finalValue = subtractSaturation(currentSaturation, stepSize); } - colorSaturationTransitionState->stepsRemaining = max(transitionTime, 1); + colorSaturationTransitionState->stepsRemaining = std::max(transitionTime, 1); colorSaturationTransitionState->stepsTotal = colorSaturationTransitionState->stepsRemaining; colorSaturationTransitionState->timeRemaining = transitionTime; colorSaturationTransitionState->transitionTime = transitionTime; @@ -2276,7 +2276,7 @@ Status ColorControlServer::moveToColor(uint16_t colorX, uint16_t colorY, uint16_ Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->currentValue)); colorXTransitionState->finalValue = colorX; - colorXTransitionState->stepsRemaining = max(transitionTime, 1); + colorXTransitionState->stepsRemaining = std::max(transitionTime, 1); colorXTransitionState->stepsTotal = colorXTransitionState->stepsRemaining; colorXTransitionState->timeRemaining = transitionTime; colorXTransitionState->transitionTime = transitionTime; @@ -2402,7 +2402,7 @@ bool ColorControlServer::moveColorCommand(app::CommandHandler * commandObj, cons colorYTransitionState->lowLimit = MIN_CIE_XY_VALUE; colorYTransitionState->highLimit = MAX_CIE_XY_VALUE; - SetQuietReportRemainingTime(endpoint, max(transitionTimeX, transitionTimeY), true /* isNewTransition */); + SetQuietReportRemainingTime(endpoint, std::max(transitionTimeX, transitionTimeY), true /* isNewTransition */); // kick off the state machine: scheduleTimerCallbackMs(configureXYEventControl(endpoint), TRANSITION_UPDATE_TIME_MS.count()); @@ -2463,7 +2463,7 @@ bool ColorControlServer::stepColorCommand(app::CommandHandler * commandObj, cons colorXTransitionState->initialValue = currentColorX; colorXTransitionState->currentValue = currentColorX; colorXTransitionState->finalValue = colorX; - colorXTransitionState->stepsRemaining = max(transitionTime, 1); + colorXTransitionState->stepsRemaining = std::max(transitionTime, 1); colorXTransitionState->stepsTotal = colorXTransitionState->stepsRemaining; colorXTransitionState->timeRemaining = transitionTime; colorXTransitionState->transitionTime = transitionTime; @@ -2507,7 +2507,7 @@ void ColorControlServer::updateXYCommand(EndpointId endpoint) bool isXTransitionDone = computeNewColor16uValue(colorXTransitionState); bool isYTransitionDone = computeNewColor16uValue(colorYTransitionState); - SetQuietReportRemainingTime(endpoint, max(colorXTransitionState->timeRemaining, colorYTransitionState->timeRemaining)); + SetQuietReportRemainingTime(endpoint, std::max(colorXTransitionState->timeRemaining, colorYTransitionState->timeRemaining)); if (isXTransitionDone && isYTransitionDone) { @@ -2607,7 +2607,7 @@ Status ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorT Attributes::ColorTemperatureMireds::Get(endpoint, &(colorTempTransitionState->currentValue)); colorTempTransitionState->finalValue = colorTemperature; - colorTempTransitionState->stepsRemaining = max(transitionTime, 1); + colorTempTransitionState->stepsRemaining = std::max(transitionTime, 1); colorTempTransitionState->stepsTotal = colorTempTransitionState->stepsRemaining; colorTempTransitionState->timeRemaining = transitionTime; colorTempTransitionState->transitionTime = transitionTime; @@ -2990,7 +2990,7 @@ bool ColorControlServer::stepColorTempCommand(app::CommandHandler * commandObj, colorTempTransitionState->finalValue = static_cast(finalValue32u); } } - colorTempTransitionState->stepsRemaining = max(transitionTime, 1); + colorTempTransitionState->stepsRemaining = std::max(transitionTime, 1); colorTempTransitionState->stepsTotal = colorTempTransitionState->stepsRemaining; colorTempTransitionState->timeRemaining = transitionTime; colorTempTransitionState->transitionTime = transitionTime; diff --git a/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp b/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp index d6282f287a..ea0c9b1203 100644 --- a/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp +++ b/src/app/clusters/commissioner-control-server/commissioner-control-server.cpp @@ -132,10 +132,11 @@ CommissionerControlServer::SetSupportedDeviceCategoriesValue(EndpointId endpoint } CHIP_ERROR -CommissionerControlServer::GenerateCommissioningRequestResultEvent(const Events::CommissioningRequestResult::Type & result) +CommissionerControlServer::GenerateCommissioningRequestResultEvent(EndpointId endpoint, + const Events::CommissioningRequestResult::Type & result) { EventNumber eventNumber; - CHIP_ERROR error = LogEvent(result, kRootEndpointId, eventNumber); + CHIP_ERROR error = LogEvent(result, endpoint, eventNumber); if (CHIP_NO_ERROR != error) { ChipLogError(Zcl, "CommissionerControl: Unable to emit CommissioningRequestResult event: %" CHIP_ERROR_FORMAT, diff --git a/src/app/clusters/commissioner-control-server/commissioner-control-server.h b/src/app/clusters/commissioner-control-server/commissioner-control-server.h index e63769de1d..56f43620b5 100644 --- a/src/app/clusters/commissioner-control-server/commissioner-control-server.h +++ b/src/app/clusters/commissioner-control-server/commissioner-control-server.h @@ -120,7 +120,8 @@ class CommissionerControlServer * @brief * Called after the server return SUCCESS to a correctly formatted RequestCommissioningApproval command. */ - CHIP_ERROR GenerateCommissioningRequestResultEvent(const Events::CommissioningRequestResult::Type & result); + CHIP_ERROR GenerateCommissioningRequestResultEvent(EndpointId endpoint, + const Events::CommissioningRequestResult::Type & result); private: CommissionerControlServer() = default; diff --git a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp index 4880c1058d..5793ebfd1a 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp @@ -215,9 +215,11 @@ EcosystemLocationStruct::Builder::SetLocationDescriptorLastEdit(uint64_t aLocati std::unique_ptr EcosystemLocationStruct::Builder::Build() { VerifyOrReturnValue(!mIsAlreadyBuilt, nullptr, ChipLogError(Zcl, "Build() already called")); - VerifyOrReturnValue(!mLocationDescriptor.mLocationName.empty(), nullptr, ChipLogError(Zcl, "Must Provided Location Name")); - VerifyOrReturnValue(mLocationDescriptor.mLocationName.size() <= kLocationDescriptorNameMaxSize, nullptr, - ChipLogError(Zcl, "Must Location Name must be less than 64 bytes")); + VerifyOrReturnValue(!mLocationDescriptor.mLocationName.empty(), nullptr, ChipLogError(Zcl, "Must Provide Location Name")); + static_assert(kLocationDescriptorNameMaxSize <= std::numeric_limits::max()); + VerifyOrReturnValue( + mLocationDescriptor.mLocationName.size() <= kLocationDescriptorNameMaxSize, nullptr, + ChipLogError(Zcl, "Location Name must be less than %u bytes", static_cast(kLocationDescriptorNameMaxSize))); // std::make_unique does not have access to private constructor we workaround with using new std::unique_ptr ret{ new EcosystemLocationStruct(std::move(mLocationDescriptor), @@ -271,6 +273,7 @@ CHIP_ERROR EcosystemInformationServer::AddLocationInfo(EndpointId aEndpoint, con VerifyOrReturnError(aLocation, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError((aEndpoint != kRootEndpointId && aEndpoint != kInvalidEndpointId), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(!aLocationId.empty(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(aLocationId.size() <= kUniqueLocationIdMaxSize, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aFabricIndex >= kMinValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(aFabricIndex <= kMaxValidFabricIndex, CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h index 3fe1621813..13d2bc8a6d 100644 --- a/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h +++ b/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index 6bb3356b89..ea73b8ff23 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -233,7 +233,7 @@ class ThreadScanResponseToTLV : public chip::app::DataModel::EncodableToTLV CHIP_ERROR ThreadScanResponseToTLV::LoadResponses(Platform::ScopedMemoryBuffer & scanResponseArray, Span & validResponses) const { - VerifyOrReturnError(scanResponseArray.Alloc(chip::min(mNetworks->Count(), kMaxNetworksInScanResponse)), CHIP_ERROR_NO_MEMORY); + VerifyOrReturnError(scanResponseArray.Alloc(std::min(mNetworks->Count(), kMaxNetworksInScanResponse)), CHIP_ERROR_NO_MEMORY); ThreadScanResponse scanResponse; size_t scanResponseArrayLength = 0; diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp index d3efeaee6f..f8f54f940a 100644 --- a/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp +++ b/src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp @@ -219,17 +219,17 @@ CHIP_ERROR DefaultOTARequestorDriver::UpdateNotFound(UpdateNotFoundReason reason case UpdateNotFoundReason::kUpToDate: break; case UpdateNotFoundReason::kBusy: { - status = ScheduleQueryRetry(true, chip::max(kDefaultDelayedActionTime, delay)); + status = ScheduleQueryRetry(true, std::max(kDefaultDelayedActionTime, delay)); if (status == CHIP_ERROR_MAX_RETRY_EXCEEDED) { // If max retry exceeded with current provider, try a different provider - status = ScheduleQueryRetry(false, chip::max(kDefaultDelayedActionTime, delay)); + status = ScheduleQueryRetry(false, std::max(kDefaultDelayedActionTime, delay)); } break; } case UpdateNotFoundReason::kNotAvailable: { // Schedule a query only if a different provider is available - status = ScheduleQueryRetry(false, chip::max(kDefaultDelayedActionTime, delay)); + status = ScheduleQueryRetry(false, std::max(kDefaultDelayedActionTime, delay)); break; } } diff --git a/src/app/clusters/scenes-server/SceneTableImpl.cpp b/src/app/clusters/scenes-server/SceneTableImpl.cpp index 81cd05cd18..24d300e8f5 100644 --- a/src/app/clusters/scenes-server/SceneTableImpl.cpp +++ b/src/app/clusters/scenes-server/SceneTableImpl.cpp @@ -276,7 +276,7 @@ struct FabricSceneData : public PersistentData ReturnErrorOnFailure(reader.EnterContainer(fabricSceneContainer)); ReturnErrorOnFailure(reader.Next(TLV::ContextTag(TagScene::kSceneCount))); ReturnErrorOnFailure(reader.Get(scene_count)); - scene_count = min(scene_count, static_cast(max_scenes_per_fabric)); + scene_count = std::min(scene_count, static_cast(max_scenes_per_fabric)); ReturnErrorOnFailure(reader.Next(TLV::kTLVType_Array, TLV::ContextTag(TagScene::kStorageIDArray))); TLV::TLVType sceneMapContainer; ReturnErrorOnFailure(reader.EnterContainer(sceneMapContainer)); @@ -577,7 +577,7 @@ CHIP_ERROR DefaultSceneTableImpl::GetRemainingCapacity(FabricIndex fabric_index, remaining_capacity_fabric = static_cast(mMaxScenesPerFabric - fabric.scene_count); } - capacity = min(remaining_capacity_fabric, remaining_capacity_global); + capacity = std::min(remaining_capacity_fabric, remaining_capacity_global); return CHIP_NO_ERROR; } diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index 9e6e0f074d..bda97c5cb1 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -778,8 +778,8 @@ MatterThermostatClusterServerPreAttributeChangedCallback(const app::ConcreteAttr return Status::InvalidValue; } auto RequestedSystemMode = static_cast(*value); - if (ControlSequenceOfOperation > ControlSequenceOfOperationEnum::kCoolingAndHeatingWithReheat || - RequestedSystemMode > SystemModeEnum::kFanOnly) + if (EnsureKnownEnumValue(ControlSequenceOfOperation) == ControlSequenceOfOperationEnum::kUnknownEnumValue || + EnsureKnownEnumValue(RequestedSystemMode) == SystemModeEnum::kUnknownEnumValue) { return Status::InvalidValue; } diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.cpp index 69ec2a5e13..bf056d2e37 100644 --- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.cpp +++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.cpp @@ -214,7 +214,7 @@ CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, a } else { - lastRssi.SetNonNull(min(static_cast(0), neighInfo.mLastRssi)); + lastRssi.SetNonNull(std::min(static_cast(0), neighInfo.mLastRssi)); } neighborTable.averageRssi = averageRssi; diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index 972e056513..7f7b7e14b8 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -318,7 +318,7 @@ bool operator==(const DataModel::DeviceTypeEntry & a, const EmberAfDeviceType & /// - index == types.size() // i.e. not found or there is no next /// /// hintWherePreviousMayBe represents a search hint where previous may exist. -unsigned FindNextDeviceTypeIndex(Span types, const DataModel::DeviceTypeEntry previous, +unsigned FindNextDeviceTypeIndex(Span types, const DataModel::DeviceTypeEntry & previous, unsigned hintWherePreviousMayBe) { if (hintWherePreviousMayBe < types.size()) diff --git a/src/app/data-model-provider/OperationTypes.h b/src/app/data-model-provider/OperationTypes.h index 8758e02ef8..6bfffccc65 100644 --- a/src/app/data-model-provider/OperationTypes.h +++ b/src/app/data-model-provider/OperationTypes.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,15 @@ struct OperationRequest /// /// NOTE: once kInternal flag is removed, this will become non-optional std::optional subjectDescriptor; + + /// Accessing fabric index is the subjectDescriptor fabric index (if any). + /// This is a readability convenience function. + /// + /// Returns kUndefinedFabricIndex if no subject descriptor is available + FabricIndex GetAccessingFabricIndex() const + { + return subjectDescriptor.has_value() ? subjectDescriptor->fabricIndex : kUndefinedFabricIndex; + } }; enum class ReadFlags : uint32_t diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index 110a729d8f..2a8611ba34 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -111,6 +111,8 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv void CommissioningWindowManager::Shutdown() { + VerifyOrReturn(nullptr != mServer); + StopAdvertisement(/* aShuttingDown = */ true); ResetState(); diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 426e3c6865..e4db190c50 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -19,8 +19,10 @@ #include +#include #include #include +#include #include #include #include @@ -81,6 +83,33 @@ using chip::Transport::TcpListenParameters; namespace { +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolver +{ +public: + bool IsDeviceTypeOnEndpoint(chip::DeviceTypeId deviceType, chip::EndpointId endpoint) override + { + chip::app::DataModel::Provider * model = chip::app::InteractionModelEngine::GetInstance()->GetDataModelProvider(); + + for (auto type = model->FirstDeviceType(endpoint); type.has_value(); type = model->NextDeviceType(endpoint, *type)) + { + if (type->deviceTypeId == deviceType) + { +#if CHIP_CONFIG_USE_EMBER_DATA_MODEL + VerifyOrDie(chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint)); +#endif // CHIP_CONFIG_USE_EMBER_DATA_MODEL + return true; + } + } +#if CHIP_CONFIG_USE_EMBER_DATA_MODEL + VerifyOrDie(!chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint)); +#endif // CHIP_CONFIG_USE_EMBER_DATA_MODEL + return false; + } +} sDeviceTypeResolver; +#else // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + +// Ember implementation of the device type resolver class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolver { public: @@ -89,6 +118,7 @@ class DeviceTypeResolver : public chip::Access::AccessControl::DeviceTypeResolve return chip::app::IsDeviceTypeOnEndpoint(deviceType, endpoint); } } sDeviceTypeResolver; +#endif } // namespace diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 09dcb304ea..fbb993d49b 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -154,6 +154,18 @@ source_set("thread-border-router-management-test-srcs") { ] } +source_set("ecosystem-information-test-srcs") { + sources = [ + "${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.cpp", + "${chip_root}/src/app/clusters/ecosystem-information-server/ecosystem-information-server.h", + ] + public_deps = [ + "${chip_root}/src/app:interaction-model", + "${chip_root}/src/app/common:cluster-objects", + "${chip_root}/src/lib/core", + ] +} + source_set("app-test-stubs") { sources = [ "test-ember-api.cpp", @@ -202,6 +214,7 @@ chip_test_suite("tests") { "TestDataModelSerialization.cpp", "TestDefaultOTARequestorStorage.cpp", "TestDefaultThreadNetworkDirectoryStorage.cpp", + "TestEcosystemInformationCluster.cpp", "TestEventLoggingNoUTCTime.cpp", "TestEventOverflow.cpp", "TestEventPathParams.cpp", @@ -229,6 +242,7 @@ chip_test_suite("tests") { public_deps = [ ":app-test-stubs", ":binding-test-srcs", + ":ecosystem-information-test-srcs", ":operational-state-test-srcs", ":ota-requestor-test-srcs", ":power-cluster-test-srcs", @@ -237,6 +251,10 @@ chip_test_suite("tests") { "${chip_root}/src/app", "${chip_root}/src/app/codegen-data-model-provider:instance-header", "${chip_root}/src/app/common:cluster-objects", +<<<<<<< HEAD + "${chip_root}/src/app/data-model-provider/tests:encode-decode", +======= +>>>>>>> test_release_2.4-1.4 "${chip_root}/src/app/icd/client:handler", "${chip_root}/src/app/icd/client:manager", "${chip_root}/src/app/tests:helpers", diff --git a/src/app/tests/TestCommandInteraction.cpp b/src/app/tests/TestCommandInteraction.cpp index e4465c119d..a44d76d1fc 100644 --- a/src/app/tests/TestCommandInteraction.cpp +++ b/src/app/tests/TestCommandInteraction.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -38,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -372,9 +372,21 @@ class MockCommandHandlerCallback : public CommandHandlerImpl::Callback { DispatchSingleClusterCommand(aCommandPath, apPayload, &apCommandObj); } - Protocols::InteractionModel::Status CommandExists(const ConcreteCommandPath & aCommandPath) + + Protocols::InteractionModel::Status ValidateCommandCanBeDispatched(const DataModel::InvokeRequest & request) override { - return ServerClusterCommandExists(aCommandPath); + using Protocols::InteractionModel::Status; + + Status status = ServerClusterCommandExists(request.path); + if (status != Status::Success) + { + return status; + } + + // NOTE: IM does more validation here, however for now we do minimal options + // to pass the test. + + return Status::Success; } void ResetCounter() { onFinalCalledTimes = 0; } diff --git a/src/app/tests/TestEcosystemInformationCluster.cpp b/src/app/tests/TestEcosystemInformationCluster.cpp new file mode 100644 index 0000000000..f8d9f34642 --- /dev/null +++ b/src/app/tests/TestEcosystemInformationCluster.cpp @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "lib/support/CHIPMem.h" + +#include +#include +#include + +namespace chip { +namespace app { +namespace { + +using namespace Clusters; +using namespace Clusters::EcosystemInformation; + +const EndpointId kValidEndpointId = 1; +const Structs::DeviceTypeStruct::Type kValidDeviceType = { .deviceType = 0, .revision = 1 }; +constexpr Access::SubjectDescriptor kSubjectDescriptor = Testing::kAdminSubjectDescriptor; +const FabricIndex kValidFabricIndex = kSubjectDescriptor.fabricIndex; + +struct RequiredEcosystemDeviceParams +{ + EndpointId originalEndpointId = kValidEndpointId; + Structs::DeviceTypeStruct::Type deviceType = kValidDeviceType; + FabricIndex fabicIndex = kValidFabricIndex; +}; + +const RequiredEcosystemDeviceParams kDefaultRequiredDeviceParams; + +const EndpointId kAnotherValidEndpointId = 2; +static_assert(kValidEndpointId != kAnotherValidEndpointId); +const char * kValidLocationName = "AValidLocationName"; +const ClusterId kEcosystemInfoClusterId = EcosystemInformation::Id; +const AttributeId kDeviceDirectoryAttributeId = EcosystemInformation::Attributes::DeviceDirectory::Id; +const AttributeId kLocationDirectoryAttributeId = EcosystemInformation::Attributes::LocationDirectory::Id; + +} // namespace + +class TestEcosystemInformationCluster : public ::testing::Test +{ +public: + static void SetUpTestSuite() { ASSERT_EQ(chip::Platform::MemoryInit(), CHIP_NO_ERROR); } + static void TearDownTestSuite() { chip::Platform::MemoryShutdown(); } + + Clusters::EcosystemInformation::EcosystemInformationServer & EcoInfoCluster() { return mClusterServer; } + + std::unique_ptr + CreateSimplestValidDeviceStruct(const RequiredEcosystemDeviceParams & requiredParams = kDefaultRequiredDeviceParams) + { + std::unique_ptr deviceInfo = EcosystemDeviceStruct::Builder() + .SetOriginalEndpoint(requiredParams.originalEndpointId) + .AddDeviceType(requiredParams.deviceType) + .SetFabricIndex(requiredParams.fabicIndex) + .Build(); + VerifyOrDie(deviceInfo); + return deviceInfo; + } + + std::unique_ptr CreateValidLocationStruct(const char * requiredLocationName = kValidLocationName) + { + std::string locationName(requiredLocationName); + std::unique_ptr locationInfo = + EcosystemLocationStruct::Builder().SetLocationName(locationName).Build(); + VerifyOrDie(locationInfo); + return locationInfo; + } + +private: + Clusters::EcosystemInformation::EcosystemInformationServer mClusterServer; +}; + +TEST_F(TestEcosystemInformationCluster, UnsupportedClusterWhenReadingDeviceDirectoryOnNewClusterServer) +{ + ConcreteAttributePath path(kValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + + Testing::ReadOperation testRequest(path); + std::unique_ptr encoder = testRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(path, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); +} + +TEST_F(TestEcosystemInformationCluster, UnsupportedClusterWhenReadingLocationDirectoryOnNewClusterServer) +{ + ConcreteAttributePath path(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + + Testing::ReadOperation testRequest(path); + std::unique_ptr encoder = testRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(path, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); +} + +TEST_F(TestEcosystemInformationCluster, EmptyReadAfterAddEcosystemInformationClusterToEndpoint) +{ + ConcreteAttributePath deviceDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + ConcreteAttributePath locationDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + + ASSERT_EQ(EcoInfoCluster().AddEcosystemInformationClusterToEndpoint(kValidEndpointId), CHIP_NO_ERROR); + + Testing::ReadOperation testDeviceDirectoryRequest(deviceDirectoryPath); + std::unique_ptr deviceDirectoryEncoder = testDeviceDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(deviceDirectoryPath, *deviceDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testDeviceDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + std::vector deviceDirectoryAttributeData; + ASSERT_EQ(testDeviceDirectoryRequest.GetEncodedIBs().Decode(deviceDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(deviceDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & deviceDirectoryEncodedData = deviceDirectoryAttributeData[0]; + ASSERT_EQ(deviceDirectoryEncodedData.attributePath, testDeviceDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::DeviceDirectory::TypeInfo::DecodableType decodableDeviceDirectory; + ASSERT_EQ(decodableDeviceDirectory.Decode(deviceDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t deviceDirectorySize = 0; + ASSERT_EQ(decodableDeviceDirectory.ComputeSize(&deviceDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(deviceDirectorySize, 0u); + + Testing::ReadOperation testLocationDirectoryRequest(locationDirectoryPath); + std::unique_ptr locationDirectoryEncoder = testLocationDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(locationDirectoryPath, *locationDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testLocationDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + std::vector locationDirectoryAttributeData; + ASSERT_EQ(testLocationDirectoryRequest.GetEncodedIBs().Decode(locationDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & locationDirectoryEncodedData = locationDirectoryAttributeData[0]; + ASSERT_EQ(locationDirectoryEncodedData.attributePath, testLocationDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::LocationDirectory::TypeInfo::DecodableType decodableLocationDirectory; + ASSERT_EQ(decodableLocationDirectory.Decode(locationDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t locationDirectorySize = 0; + ASSERT_EQ(decodableLocationDirectory.ComputeSize(&locationDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectorySize, 0u); +} + +TEST_F(TestEcosystemInformationCluster, BuildingEcosystemDeviceStruct) +{ + EcosystemDeviceStruct::Builder deviceInfoBuilder; + std::unique_ptr deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetOriginalEndpoint(1); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + auto deviceType = Structs::DeviceTypeStruct::Type(); + deviceType.revision = 1; + deviceInfoBuilder.AddDeviceType(deviceType); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(1); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_TRUE(deviceInfo); + + // Building a second device info with previously successfully built deviceInfoBuilder + // is expected to fail. + std::unique_ptr secondDeviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(secondDeviceInfo); +} + +TEST_F(TestEcosystemInformationCluster, BuildingInvalidEcosystemDeviceStruct) +{ + auto deviceType = Structs::DeviceTypeStruct::Type(); + deviceType.revision = 1; + const FabricIndex kFabricIndexTooLow = 0; + const FabricIndex kFabricIndexTooHigh = kMaxValidFabricIndex + 1; + + EcosystemDeviceStruct::Builder deviceInfoBuilder; + deviceInfoBuilder.SetOriginalEndpoint(1); + deviceInfoBuilder.AddDeviceType(deviceType); + deviceInfoBuilder.SetFabricIndex(kFabricIndexTooLow); + std::unique_ptr deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(kFabricIndexTooHigh); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + deviceInfoBuilder.SetFabricIndex(1); + // At this point deviceInfoBuilder would be able to be built successfully. + + std::string nameThatsTooLong(65, 'x'); + uint64_t nameEpochValueUs = 0; // This values doesn't matter. + deviceInfoBuilder.SetDeviceName(std::move(nameThatsTooLong), nameEpochValueUs); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_FALSE(deviceInfo); + + // Ending unit test by building something that should work just to make sure + // Builder isn't silently failing on building for some other reason. + std::string nameThatsMaxLength(64, 'x'); + deviceInfoBuilder.SetDeviceName(std::move(nameThatsMaxLength), nameEpochValueUs); + deviceInfo = deviceInfoBuilder.Build(); + ASSERT_TRUE(deviceInfo); +} + +TEST_F(TestEcosystemInformationCluster, AddDeviceInfoInvalidArguments) +{ + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kValidEndpointId, nullptr), CHIP_ERROR_INVALID_ARGUMENT); + + std::unique_ptr deviceInfo = CreateSimplestValidDeviceStruct(); + ASSERT_TRUE(deviceInfo); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kRootEndpointId, std::move(deviceInfo)), CHIP_ERROR_INVALID_ARGUMENT); + + deviceInfo = CreateSimplestValidDeviceStruct(); + ASSERT_TRUE(deviceInfo); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kInvalidEndpointId, std::move(deviceInfo)), CHIP_ERROR_INVALID_ARGUMENT); +} + +TEST_F(TestEcosystemInformationCluster, AddDeviceInfo) +{ + std::unique_ptr deviceInfo = CreateSimplestValidDeviceStruct(); + // originalEndpoint and path endpoint do not need to be the same, for that reason we use a different value for + // path endpoint + static_assert(kAnotherValidEndpointId != kValidEndpointId); + ASSERT_EQ(EcoInfoCluster().AddDeviceInfo(kAnotherValidEndpointId, std::move(deviceInfo)), CHIP_NO_ERROR); + ConcreteAttributePath deviceDirectoryPath(kAnotherValidEndpointId, kEcosystemInfoClusterId, kDeviceDirectoryAttributeId); + Testing::ReadOperation testDeviceDirectoryRequest(deviceDirectoryPath); + testDeviceDirectoryRequest.SetSubjectDescriptor(kSubjectDescriptor); + std::unique_ptr deviceDirectoryEncoder = testDeviceDirectoryRequest.StartEncoding(); + + ASSERT_EQ(EcoInfoCluster().ReadAttribute(deviceDirectoryPath, *deviceDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testDeviceDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + + std::vector attributeData; + ASSERT_EQ(testDeviceDirectoryRequest.GetEncodedIBs().Decode(attributeData), CHIP_NO_ERROR); + ASSERT_EQ(attributeData.size(), 1u); + Testing::DecodedAttributeData & encodedData = attributeData[0]; + ASSERT_EQ(encodedData.attributePath, testDeviceDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::DeviceDirectory::TypeInfo::DecodableType decodableDeviceDirectory; + ASSERT_EQ(decodableDeviceDirectory.Decode(encodedData.dataReader), CHIP_NO_ERROR); + size_t size = 0; + ASSERT_EQ(decodableDeviceDirectory.ComputeSize(&size), CHIP_NO_ERROR); + ASSERT_EQ(size, 1u); + auto iterator = decodableDeviceDirectory.begin(); + ASSERT_TRUE(iterator.Next()); + auto deviceDirectoryEntry = iterator.GetValue(); + ASSERT_FALSE(deviceDirectoryEntry.deviceName.HasValue()); + ASSERT_FALSE(deviceDirectoryEntry.deviceNameLastEdit.HasValue()); + ASSERT_EQ(deviceDirectoryEntry.bridgedEndpoint, kInvalidEndpointId); + ASSERT_EQ(deviceDirectoryEntry.originalEndpoint, kValidEndpointId); + size_t deviceTypeListSize = 0; + ASSERT_EQ(deviceDirectoryEntry.deviceTypes.ComputeSize(&deviceTypeListSize), CHIP_NO_ERROR); + ASSERT_EQ(deviceTypeListSize, 1u); + auto deviceTypeIterator = deviceDirectoryEntry.deviceTypes.begin(); + ASSERT_TRUE(deviceTypeIterator.Next()); + auto deviceTypeEntry = deviceTypeIterator.GetValue(); + ASSERT_EQ(deviceTypeEntry.deviceType, 0u); + ASSERT_EQ(deviceTypeEntry.revision, 1); + ASSERT_FALSE(deviceTypeIterator.Next()); + size_t uniqueLocationIdListSize = 0; + ASSERT_EQ(deviceDirectoryEntry.uniqueLocationIDs.ComputeSize(&uniqueLocationIdListSize), CHIP_NO_ERROR); + ASSERT_EQ(uniqueLocationIdListSize, 0u); + ASSERT_EQ(deviceDirectoryEntry.uniqueLocationIDsLastEdit, 0u); + ASSERT_EQ(deviceDirectoryEntry.fabricIndex, kSubjectDescriptor.fabricIndex); + ASSERT_FALSE(iterator.Next()); +} + +TEST_F(TestEcosystemInformationCluster, BuildingEcosystemLocationStruct) +{ + EcosystemLocationStruct::Builder locationInfoBuilder; + + std::string validLocationName = "validName"; + locationInfoBuilder.SetLocationName(validLocationName); + + std::unique_ptr locationInfo = locationInfoBuilder.Build(); + ASSERT_TRUE(locationInfo); + + // Building a second device info with previously successfully built deviceInfoBuilder + // is expected to fail. + locationInfo = locationInfoBuilder.Build(); + ASSERT_FALSE(locationInfo); +} + +TEST_F(TestEcosystemInformationCluster, BuildingInvalidEcosystemLocationStruct) +{ + EcosystemLocationStruct::Builder locationInfoBuilder; + + std::string nameThatsTooLong(129, 'x'); + locationInfoBuilder.SetLocationName(nameThatsTooLong); + + std::unique_ptr locationInfo = locationInfoBuilder.Build(); + ASSERT_FALSE(locationInfo); + + // Ending unit test by building something that should work just to make sure + // Builder isn't silently failing on building for some other reason. + std::string nameThatsMaxLength(128, 'x'); + locationInfoBuilder.SetLocationName(nameThatsMaxLength); + locationInfo = locationInfoBuilder.Build(); + ASSERT_TRUE(locationInfo); +} + +TEST_F(TestEcosystemInformationCluster, AddLocationInfoInvalidArguments) +{ + const FabricIndex kFabricIndexTooLow = 0; + const FabricIndex kFabricIndexTooHigh = kMaxValidFabricIndex + 1; + const std::string kEmptyLocationIdStr; + const std::string kValidLocationIdStr = "SomeLocationString"; + const std::string kInvalidLocationIdTooLongStr(65, 'x'); + + std::unique_ptr locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kInvalidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kRootEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kEmptyLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kInvalidLocationIdTooLongStr, kValidFabricIndex, + std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kFabricIndexTooLow, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kFabricIndexTooHigh, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); + + // Sanity check that we can successfully add something after all the previously failed attempts + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_NO_ERROR); + + // Adding a second identical entry is expected to fail + locationInfo = CreateValidLocationStruct(); + ASSERT_TRUE(locationInfo); + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, kValidFabricIndex, std::move(locationInfo)), + CHIP_ERROR_INVALID_ARGUMENT); +} + +TEST_F(TestEcosystemInformationCluster, AddLocationInfo) +{ + std::unique_ptr locationInfo = CreateValidLocationStruct(); + const char * kValidLocationIdStr = "SomeLocationIdString"; + ASSERT_EQ(EcoInfoCluster().AddLocationInfo(kValidEndpointId, kValidLocationIdStr, Testing::kAdminSubjectDescriptor.fabricIndex, + std::move(locationInfo)), + CHIP_NO_ERROR); + + ConcreteAttributePath locationDirectoryPath(kValidEndpointId, kEcosystemInfoClusterId, kLocationDirectoryAttributeId); + Testing::ReadOperation testLocationDirectoryRequest(locationDirectoryPath); + testLocationDirectoryRequest.SetSubjectDescriptor(Testing::kAdminSubjectDescriptor); + std::unique_ptr locationDirectoryEncoder = testLocationDirectoryRequest.StartEncoding(); + ASSERT_EQ(EcoInfoCluster().ReadAttribute(locationDirectoryPath, *locationDirectoryEncoder), CHIP_NO_ERROR); + ASSERT_EQ(testLocationDirectoryRequest.FinishEncoding(), CHIP_NO_ERROR); + + std::vector locationDirectoryAttributeData; + ASSERT_EQ(testLocationDirectoryRequest.GetEncodedIBs().Decode(locationDirectoryAttributeData), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectoryAttributeData.size(), 1u); + Testing::DecodedAttributeData & locationDirectoryEncodedData = locationDirectoryAttributeData[0]; + ASSERT_EQ(locationDirectoryEncodedData.attributePath, testLocationDirectoryRequest.GetRequest().path); + EcosystemInformation::Attributes::LocationDirectory::TypeInfo::DecodableType decodableLocationDirectory; + ASSERT_EQ(decodableLocationDirectory.Decode(locationDirectoryEncodedData.dataReader), CHIP_NO_ERROR); + size_t locationDirectorySize = 0; + ASSERT_EQ(decodableLocationDirectory.ComputeSize(&locationDirectorySize), CHIP_NO_ERROR); + ASSERT_EQ(locationDirectorySize, 1u); + auto iterator = decodableLocationDirectory.begin(); + ASSERT_TRUE(iterator.Next()); + auto locationDirectoryEntry = iterator.GetValue(); + ASSERT_TRUE(locationDirectoryEntry.uniqueLocationID.data_equal(CharSpan::fromCharString(kValidLocationIdStr))); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.locationName.data_equal(CharSpan::fromCharString(kValidLocationName))); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.floorNumber.IsNull()); + ASSERT_TRUE(locationDirectoryEntry.locationDescriptor.areaType.IsNull()); + ASSERT_EQ(locationDirectoryEntry.locationDescriptorLastEdit, 0u); + ASSERT_EQ(locationDirectoryEntry.fabricIndex, Testing::kAdminSubjectDescriptor.fabricIndex); + ASSERT_FALSE(iterator.Next()); +} + +} // namespace app +} // namespace chip diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index f8f192d92e..5baab570f6 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -343,6 +343,7 @@ class TestReadInteraction : public chip::Test::AppContext void TestReadClient(); void TestReadUnexpectedSubscriptionId(); void TestReadHandler(); + void TestReadHandlerSetMaxReportingInterval(); void TestReadClientGenerateAttributePathList(); void TestReadClientGenerateInvalidAttributePathList(); void TestReadClientInvalidReport(); @@ -568,6 +569,115 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandler) EXPECT_EQ(GetExchangeManager().GetNumActiveExchanges(), 0u); } +TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandlerSetMaxReportingInterval) +{ + System::PacketBufferTLVWriter writer; + System::PacketBufferHandle subscribeRequestbuf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); + SubscribeRequestMessage::Builder subscribeRequestBuilder; + + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + EXPECT_EQ(engine->Init(&GetExchangeManager(), &GetFabricTable(), gReportScheduler), CHIP_NO_ERROR); + + uint16_t kIntervalInfMinInterval = 119; + uint16_t kMinInterval = 120; + uint16_t kMaxIntervalCeiling = 500; + + Messaging::ExchangeContext * exchangeCtx = NewExchangeToAlice(nullptr, false); + + { + + uint16_t minInterval; + uint16_t maxInterval; + + // Configure ReadHandler + ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, + CodegenDataModelProviderInstance()); + + writer.Init(std::move(subscribeRequestbuf)); + EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); + + subscribeRequestBuilder.KeepSubscriptions(true); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.MinIntervalFloorSeconds(kMinInterval); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.MaxIntervalCeilingSeconds(kMaxIntervalCeiling); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + AttributePathIBs::Builder & attributePathListBuilder = subscribeRequestBuilder.CreateAttributeRequests(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + AttributePathIB::Builder & attributePathBuilder = attributePathListBuilder.CreatePath(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + attributePathBuilder.Node(1).Endpoint(2).Cluster(3).Attribute(4).ListIndex(5).EndOfAttributePathIB(); + EXPECT_EQ(attributePathBuilder.GetError(), CHIP_NO_ERROR); + + attributePathListBuilder.EndOfAttributePathIBs(); + EXPECT_EQ(attributePathListBuilder.GetError(), CHIP_NO_ERROR); + + subscribeRequestBuilder.IsFabricFiltered(false).EndOfSubscribeRequestMessage(); + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + + EXPECT_EQ(subscribeRequestBuilder.GetError(), CHIP_NO_ERROR); + EXPECT_EQ(writer.Finalize(&subscribeRequestbuf), CHIP_NO_ERROR); + + EXPECT_EQ(readHandler.ProcessSubscribeRequest(std::move(subscribeRequestbuf)), CHIP_NO_ERROR); + +#if CHIP_CONFIG_ENABLE_ICD_SERVER + // When an ICD build, the default behavior is to select the IdleModeDuration as MaxInterval + kMaxIntervalCeiling = readHandler.GetPublisherSelectedIntervalLimit(); +#endif + // Try to change the MaxInterval while ReadHandler is active + EXPECT_EQ(readHandler.SetMaxReportingInterval(340), CHIP_ERROR_INCORRECT_STATE); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + // Set ReadHandler to Idle to allow MaxInterval changes + readHandler.MoveToState(ReadHandler::HandlerState::Idle); + + // TC1: MaxInterval < MinIntervalFloor + EXPECT_EQ(readHandler.SetMaxReportingInterval(kIntervalInfMinInterval), CHIP_ERROR_INVALID_ARGUMENT); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + + // TC2: MaxInterval == MinIntervalFloor + EXPECT_EQ(readHandler.SetMaxReportingInterval(kMinInterval), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMinInterval, maxInterval); + + // TC3: Minterval < MaxInterval < max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval) + EXPECT_EQ(readHandler.SetMaxReportingInterval(kMaxIntervalCeiling), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(kMaxIntervalCeiling, maxInterval); + + // TC4: MaxInterval == Subscriber Requested Max Interval + EXPECT_EQ(readHandler.SetMaxReportingInterval(readHandler.GetSubscriberRequestedMaxInterval()), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetSubscriberRequestedMaxInterval(), maxInterval); + + // TC4: MaxInterval == GetPublisherSelectedIntervalLimit() + EXPECT_EQ(readHandler.SetMaxReportingInterval(readHandler.GetPublisherSelectedIntervalLimit()), CHIP_NO_ERROR); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetPublisherSelectedIntervalLimit(), maxInterval); + + // TC5: MaxInterval > max(GetPublisherSelectedIntervalLimit(), mSubscriberRequestedMaxInterval) + EXPECT_EQ(readHandler.SetMaxReportingInterval(std::numeric_limits::max()), CHIP_ERROR_INVALID_ARGUMENT); + + readHandler.GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readHandler.GetPublisherSelectedIntervalLimit(), maxInterval); + } + + engine->Shutdown(); + EXPECT_EQ(GetExchangeManager().GetNumActiveExchanges(), 0u); +} + TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadClientGenerateAttributePathList) { MockInteractionModelApp delegate; @@ -1517,6 +1627,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMaxInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, idleModeDuration); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1584,6 +1695,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInfMaxInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, idleModeDuration); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1651,6 +1763,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMinInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, (2 * idleModeDuration)); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1716,6 +1829,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestMaxMinInt EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, kMaxIntervalCeiling); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1781,6 +1895,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInvalidId EXPECT_EQ(minInterval, kMinInterval); EXPECT_EQ(maxInterval, kMaxIntervalCeiling); + EXPECT_EQ(kMaxIntervalCeiling, readHandler.GetSubscriberRequestedMaxInterval()); } engine->Shutdown(); @@ -1959,6 +2074,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeRoundtrip) uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); // Test empty report // Advance monotonic timestamp for min interval to elapse @@ -2028,6 +2144,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeEarlyReport) uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); EXPECT_EQ(engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe), 1u); @@ -2760,6 +2877,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestSubscribeInvalidAttributePathRoundt uint16_t minInterval; uint16_t maxInterval; delegate.mpReadHandler->GetReportingIntervals(minInterval, maxInterval); + EXPECT_EQ(readPrepareParams.mMaxIntervalCeilingSeconds, delegate.mpReadHandler->GetSubscriberRequestedMaxInterval()); // Advance monotonic timestamp for min interval to elapse gMockClock.AdvanceMonotonic(System::Clock::Seconds16(maxInterval)); diff --git a/src/app/tests/suites/TestThermostat.yaml b/src/app/tests/suites/TestThermostat.yaml new file mode 100644 index 0000000000..70307db442 --- /dev/null +++ b/src/app/tests/suites/TestThermostat.yaml @@ -0,0 +1,91 @@ +# Copyright (c) 2024 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: Thermostat basic functionality tests + +config: + nodeId: 0x12344321 + cluster: "Thermostat" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read current SystemMode value" + command: "readAttribute" + attribute: "SystemMode" + response: + saveAs: originalSystemMode + + - label: "Try to set SystemMode to Sleep" + command: "writeAttribute" + attribute: "SystemMode" + arguments: + value: SystemModeEnum.Sleep + + - label: "Check that the new value is set now" + command: "readAttribute" + attribute: "SystemMode" + response: + value: SystemModeEnum.Sleep + + - label: "Try to set SystemMode to an invalid value" + # Have to use WriteById, because normal write enforces valid values for enums. + cluster: "AnyCommands" + command: "WriteById" + attribute: "SystemMode" + arguments: + values: + - name: "ClusterId" + value: 0x0201 # Thermostat + - name: "AttributeId" + value: 0x001C # SystemMode + - name: "Value" + # Note: At some point this might become a valid value, + # and then this test will need to be adjusted, but that + # seems fairly low-probability. + value: 254 + response: + error: CONSTRAINT_ERROR + + - label: "Verify that WriteById would work correctly with a valid value" + cluster: "AnyCommands" + command: "WriteById" + attribute: "SystemMode" + arguments: + values: + - name: "ClusterId" + value: 0x0201 # Thermostat + - name: "AttributeId" + value: 0x001C # SystemMode + - name: "Value" + value: 8 # SystemModeEnum.Dry + + - label: "Check that the new value is set by id" + command: "readAttribute" + attribute: "SystemMode" + response: + value: SystemModeEnum.Dry + + - label: "reset SystemMode to original value" + command: "writeAttribute" + attribute: "SystemMode" + arguments: + value: originalSystemMode diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 32ea708bd8..e211192595 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -339,6 +339,13 @@ PICS: "Does commissionee provide a Firmware Information field in the AttestationResponse?" id: MCORE.DA.ATTESTELEMENT_FW_INFO + + # + # Fabric Synchronization + # + - label: "Does the device implement Fabric Synchronization capabilities?" + id: MCORE.FS + # #IDM # diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 892961a965..1f4f1f66e9 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -922,6 +922,9 @@ MCORE.BDX.Sender=0 MCORE.BDX.SynchronousReceiver=0 MCORE.BDX.SynchronousSender=0 +# Fabric Synchronization +MCORE.FS=1 + # General Diagnostics Cluster DGGEN.S=1 diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 0d1b3827e8..adc728157c 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -255,7 +255,7 @@ uint16_t emberAfGetDynamicIndexFromEndpoint(EndpointId id) { if (emAfEndpoints[index].endpoint == id) { - return static_cast(index - FIXED_ENDPOINT_COUNT); + return static_cast(index - FIXED_ENDPOINT_COUNT); } } return kEmberInvalidEndpointIndex; @@ -322,7 +322,7 @@ EndpointId emberAfClearDynamicEndpoint(uint16_t index) { EndpointId ep = 0; - index = static_cast(index + FIXED_ENDPOINT_COUNT); + index = static_cast(index + FIXED_ENDPOINT_COUNT); if ((index < MAX_ENDPOINT_COUNT) && (emAfEndpoints[index].endpoint != kInvalidEndpointId) && (emberAfEndpointIndexIsEnabled(index))) diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp index 0d68701b63..40e690b1de 100644 --- a/src/app/util/attribute-table.cpp +++ b/src/app/util/attribute-table.cpp @@ -342,8 +342,8 @@ Status emAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWrite // if we dont support that attribute if (metadata == nullptr) { - ChipLogProgress(Zcl, "%p ep %x clus " ChipLogFormatMEI " attr " ChipLogFormatMEI " not supported", - "WRITE ERR: ", path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); + ChipLogProgress(Zcl, "WRITE ERR: ep %x clus " ChipLogFormatMEI " attr " ChipLogFormatMEI " not supported", path.mEndpointId, + ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); return status; } @@ -352,13 +352,13 @@ Status emAfWriteAttribute(const ConcreteAttributePath & path, const EmberAfWrite { if (input.dataType != metadata->attributeType) { - ChipLogProgress(Zcl, "%p invalid data type", "WRITE ERR: "); + ChipLogProgress(Zcl, "WRITE ERR: invalid data type"); return Status::InvalidDataType; } if (metadata->IsReadOnly()) { - ChipLogProgress(Zcl, "%p attr not writable", "WRITE ERR: "); + ChipLogProgress(Zcl, "WRITE ERR: attr not writable"); return Status::UnsupportedWrite; } } diff --git a/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml new file mode 100644 index 0000000000..463aa6af03 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/camera-av-stream-management-cluster.xml @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Camera AV Stream Management + 0x0551 + CAMERA_AV_STREAM_MANAGEMENT_CLUSTER + The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + MaxConcurrentVideoEncoders + MaxEncodedPixelRate + VideoSensorParams + NightVisionCapable + MinViewport + RateDistortionTradeOffPoints + MaxPreRollBufferSize + MicrophoneCapabilities + SpeakerCapabilities + TwoWayTalkSupport + SupportedSnapshotParams + MaxNetworkBandwidth + CurrentFrameRate + + HDRModeEnabled + + + + CurrentVideoCodecs + CurrentSnapshotConfig + FabricsUsingCamera + AllocatedVideoStreams + AllocatedAudioStreams + AllocatedSnapshotStreams + + RankedVideoStreamPrioritiesList + + + + SoftRecordingPrivacyModeEnabled + SoftLivestreamPrivacyModeEnabled + HardPrivacyModeOn + + NightVision + + + + + NightVisionIllum + + + + + AWBEnabled + + + + + AutoShutterSpeedEnabled + + + + + AutoISOEnabled + + + + Viewport + + SpeakerMuted + + + + + SpeakerVolumeLevel + + + + + SpeakerMaxLevel + + + + + SpeakerMinLevel + + + + + MicrophoneMuted + + + + + MicrophoneVolumeLevel + + + + + MicrophoneMaxLevel + + + + + MicrophoneMinLevel + + + + + MicrophoneAGCEnabled + + + + ImageRotation + ImageFlipHorizontal + ImageFlipVertical + + LocalVideoRecordingEnabled + + + + + LocalSnapshotRecordingEnabled + + + + + StatusLightEnabled + + + + + StatusLightBrightness + + + + + DepthSensorStatus + + + + + This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. + + + + + + + + + + + This command SHALL be sent by the camera in response to the AudioStreamAllocate command, carrying the newly allocated audio stream identifier. + + + + + This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. + + + + + + This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. + + + + + + + + + + + + + + + + + This command SHALL be sent by the camera in response to the VideoStreamAllocate command, carrying the newly allocated video stream identifier. + + + + + This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. + + + + + + + + + This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. + + + + + + This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. + + + + + + + + + + + This command SHALL be sent by the device in response to the SnapshotStreamAllocate command, carrying the newly allocated snapshot stream identifier. + + + + + This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. + + + + + + This command SHALL set the relative priorities of the various stream types on the camera. + + + + + + This command SHALL return a Snapshot from the camera. + + + + + + + This command SHALL be sent by the device in response to the CaptureSnapshot command, carrying the requested snapshot. + + + + + + + This command sets the viewport in all video streams. + + + + + + The data fields for this command SHALL be as follows: + + + + + + The data fields for this command SHALL be as follows: + + + + + + The data fields for this command SHALL be as follows: + + + + + + + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding video stream. + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding audio stream. + + + + + + + + + + + This event SHALL be generated when there is a modification in the corresponding snapshot stream. + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml index 42a538e7a0..379caa47ce 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/Chime.adoc Parameters: in-progress -Git: 0.9-fall2024-225-g1da0e33be +Git: 0.9-fall2024-301-g4e2f0c1c4 --> @@ -29,7 +29,7 @@ Git: 0.9-fall2024-225-g1da0e33be - + Chime 0x0556 CHIME_CLUSTER diff --git a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml index da813b60fe..167f7d13e3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/general-commissioning-cluster.xml @@ -77,6 +77,10 @@ limitations under the License. TCAcknowledgementsRequired + + TCUpdateDeadline + + Arm the persistent fail-safe timer with an expiry time of now + ExpiryLengthSeconds using device clock diff --git a/src/app/zap-templates/zcl/data-model/chip/global-enums.xml b/src/app/zap-templates/zcl/data-model/chip/global-enums.xml index 81ebd8506a..277ceb01aa 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-enums.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-enums.xml @@ -34,6 +34,18 @@ TODO: Make these structures global rather than defining them for each cluster. + + + + + + + + + + + + + + + + + Cameras + WebRTC Transport Requestor + 0x0554 + WEBRTC_TRANSPORT_REQUESTOR_CLUSTER + The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + true + true + + CurrentSessions + + This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. + + + + + + + + This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. + + + + + + This command provides an ICE candidate to the stream requestor in a WebRTC session. + + + + + + This command notifies the stream requestor that the provider has ended the WebRTC session. + + + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml new file mode 100644 index 0000000000..27a947b561 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/zone-management-cluster.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone Management + 0x0550 + ZONE_MANAGEMENT_CLUSTER + This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + true + + + + + + true + + SupportedZoneSources + Zones + TimeControl + Sensitivity + + This command SHALL create and store a TwoD Cartesian Zone. + + + + + + + + + + + The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. + + + + + + + The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. + + + + + + This command SHALL be generated in response to a GetTwoDCartesianZone command. + + + + + This command SHALL remove the Zone mapped to the passed in ZoneID. + + + + + + + + This event SHALL be generated when a Zone is first triggered. + + + + + + This event SHALL be generated when either when the TriggerDetectedDuration value is exceeded by the TimeSinceInitialTrigger value or when the MaxDuration value is exceeded by the TimeSinceInitialTrigger value as described in ZoneTriggeringTimeControlStruct. + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index e4c9a18e6c..3ad401afb3 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -27,6 +27,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "camera-av-stream-management-cluster.xml", "chime-cluster.xml", "chip-ota.xml", "channel-cluster.xml", @@ -132,6 +133,7 @@ "water-heater-management-cluster.xml", "water-heater-mode-cluster.xml", "webrtc-provider-cluster.xml", + "webrtc-requestor-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", @@ -139,7 +141,8 @@ "sample-mei-cluster.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", - "types/thermostat-user-interface-configuration.xml" + "types/thermostat-user-interface-configuration.xml", + "zone-management-cluster.xml" ], "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { @@ -666,7 +669,15 @@ "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] + "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"], + "Camera AV Stream Management": [ + "VideoSensorParams", + "MinViewport", + "MicrophoneCapabilities", + "SpeakerCapabilities", + "CurrentSnapshotConfig", + "Viewport" + ] }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index b306dba223..c291fc651f 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -22,6 +22,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "camera-av-stream-management-cluster.xml", "chime-cluster.xml", "chip-ota.xml", "channel-cluster.xml", @@ -126,6 +127,7 @@ "water-heater-management-cluster.xml", "water-heater-mode-cluster.xml", "webrtc-provider-cluster.xml", + "webrtc-requestor-cluster.xml", "wifi-network-diagnostics-cluster.xml", "wifi-network-management-cluster.xml", "window-covering.xml", @@ -133,7 +135,8 @@ "sample-mei-cluster.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", - "types/thermostat-user-interface-configuration.xml" + "types/thermostat-user-interface-configuration.xml", + "zone-management-cluster.xml" ], "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { @@ -660,7 +663,15 @@ "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] + "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"], + "Camera AV Stream Management": [ + "VideoSensorParams", + "MinViewport", + "MicrophoneCapabilities", + "SpeakerCapabilities", + "CurrentSnapshotConfig", + "Viewport" + ] }, "mandatoryDeviceTypes": "0x0016", "defaultReportingPolicy": "mandatory", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index c240008e1c..e38e880961 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -16,6 +16,7 @@ "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [], "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [], + "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [], "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "CHANNEL_CLUSTER": [], @@ -132,8 +133,10 @@ "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WATER_HEATER_MODE_CLUSTER": [], "WEB_RTC_PROVIDER_CLUSTER": [], + "WEBRTC_REQUESTOR_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], - "WINDOW_COVERING_CLUSTER": [] + "WINDOW_COVERING_CLUSTER": [], + "ZONE_MANAGEMENT_CLUSTER": [] }, "ServerDirectories": { "ACCESS_CONTROL_CLUSTER": ["access-control-server"], @@ -160,6 +163,7 @@ "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER": [ "bridged-device-basic-information-server" ], + "CAMERA_AV_STREAM_MANAGEMENT_CLUSTER": [], "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], @@ -312,10 +316,12 @@ "LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"], "LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"], "WEB_RTC_PROVIDER_CLUSTER": [], + "WEBRTC_REQUESTOR_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], - "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"] + "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"], + "ZONE_MANAGEMENT_CLUSTER": [] } } diff --git a/src/ble/BLEEndPoint.cpp b/src/ble/BLEEndPoint.cpp index d8e2a7b2a4..a035626781 100644 --- a/src/ble/BLEEndPoint.cpp +++ b/src/ble/BLEEndPoint.cpp @@ -1001,7 +1001,7 @@ CHIP_ERROR BLEEndPoint::HandleCapabilitiesRequestReceived(PacketBufferHandle && if (mtu > 0) // If one or both device knows connection's MTU... { resp.mFragmentSize = - chip::min(static_cast(mtu - 3), BtpEngine::sMaxFragmentSize); // Reserve 3 bytes of MTU for ATT header. + std::min(static_cast(mtu - 3), BtpEngine::sMaxFragmentSize); // Reserve 3 bytes of MTU for ATT header. } else // Else, if neither device knows MTU... { @@ -1012,7 +1012,7 @@ CHIP_ERROR BLEEndPoint::HandleCapabilitiesRequestReceived(PacketBufferHandle && // Select local and remote max receive window size based on local resources available for both incoming writes AND // GATT confirmations. mRemoteReceiveWindowSize = mLocalReceiveWindowSize = mReceiveWindowMaxSize = - chip::min(req.mWindowSize, static_cast(BLE_MAX_RECEIVE_WINDOW_SIZE)); + std::min(req.mWindowSize, static_cast(BLE_MAX_RECEIVE_WINDOW_SIZE)); resp.mWindowSize = mReceiveWindowMaxSize; ChipLogProgress(Ble, "local and remote recv window sizes = %u", resp.mWindowSize); @@ -1068,7 +1068,7 @@ CHIP_ERROR BLEEndPoint::HandleCapabilitiesResponseReceived(PacketBufferHandle && } // Set fragment size as minimum of (reported ATT MTU, BTP characteristic size) - resp.mFragmentSize = chip::min(resp.mFragmentSize, BtpEngine::sMaxFragmentSize); + resp.mFragmentSize = std::min(resp.mFragmentSize, BtpEngine::sMaxFragmentSize); mBtpEngine.SetRxFragmentSize(resp.mFragmentSize); mBtpEngine.SetTxFragmentSize(resp.mFragmentSize); diff --git a/src/ble/BtpEngine.cpp b/src/ble/BtpEngine.cpp index 75958169a7..4f52b59906 100644 --- a/src/ble/BtpEngine.cpp +++ b/src/ble/BtpEngine.cpp @@ -274,7 +274,7 @@ CHIP_ERROR BtpEngine::HandleCharacteristicReceived(System::PacketBufferHandle && // mRxFragmentSize may be smaller than the characteristic size. Make sure // we're not truncating to a data length smaller than what we have already consumed. VerifyOrExit(reader.OctetsRead() <= mRxFragmentSize, err = BLE_ERROR_REASSEMBLER_INCORRECT_STATE); - data->SetDataLength(chip::min(data->DataLength(), static_cast(mRxFragmentSize))); + data->SetDataLength(std::min(data->DataLength(), static_cast(mRxFragmentSize))); // Now mark the bytes we consumed as consumed. data->ConsumeHead(static_cast(reader.OctetsRead())); diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index c222fa904e..3b777477b2 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1582,6 +1582,7 @@ cluster GeneralCommissioning = 48 { provisional readonly attribute access(read: administer) optional int16u TCMinRequiredVersion = 6; provisional readonly attribute access(read: administer) optional bitmap16 TCAcknowledgements = 7; provisional readonly attribute access(read: administer) optional boolean TCAcknowledgementsRequired = 8; + provisional readonly attribute access(read: administer) optional int32u TCUpdateDeadline = 9; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -9415,6 +9416,464 @@ provisional cluster ContentAppObserver = 1296 { command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } +/** This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. */ +provisional cluster ZoneManagement = 1360 { + revision 1; + + enum StatusCodeEnum : enum8 { + kZoneNotFound = 2; + kZoneInUse = 3; + } + + enum ZoneEventStoppedReasonEnum : enum8 { + kActionStopped = 0; + kTimeout = 1; + } + + enum ZoneEventTriggeredReasonEnum : enum8 { + kMotion = 0; + } + + enum ZoneSourceEnum : enum8 { + kMfg = 0; + kUser = 1; + } + + enum ZoneTypeEnum : enum8 { + kTwoDCARTZone = 0; + } + + enum ZoneUseEnum : enum8 { + kMotion = 0; + kPrivacy = 1; + kFocus = 2; + } + + bitmap Feature : bitmap32 { + kTwoDimensionalCartesianZone = 0x1; + } + + struct TwoDCartesianVertexStruct { + int16u x = 0; + int16u y = 1; + } + + struct TwoDCartesianZoneStruct { + char_string<16> name = 0; + ZoneUseEnum use = 1; + TwoDCartesianVertexStruct vertices[] = 2; + optional char_string<9> color = 3; + } + + struct ZoneInformationStruct { + int16u zoneID = 0; + ZoneTypeEnum zoneType = 1; + ZoneSourceEnum zoneSource = 2; + } + + struct ZoneTriggeringTimeControlStruct { + int16u initialDuration = 0; + int16u augmentationDuration = 1; + elapsed_s maxDuration = 2; + int16u blindDuration = 3; + } + + info event ZoneTriggered = 0 { + int16u zones[] = 0; + ZoneEventTriggeredReasonEnum reason = 1; + } + + info event ZoneStopped = 1 { + int16u zones[] = 0; + ZoneEventStoppedReasonEnum reason = 1; + } + + readonly attribute ZoneSourceEnum supportedZoneSources[] = 0; + readonly attribute optional ZoneInformationStruct zones[] = 1; + attribute ZoneTriggeringTimeControlStruct timeControl[] = 2; + attribute int8u sensitivity = 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 CreateTwoDCartesianZoneRequest { + TwoDCartesianZoneStruct zone = 0; + } + + response struct CreateTwoDCartesianZoneResponse = 1 { + int16u zoneID = 0; + } + + request struct UpdateTwoDCartesianZoneRequest { + int16u zoneID = 0; + TwoDCartesianZoneStruct zone = 1; + } + + request struct GetTwoDCartesianZoneRequest { + optional nullable int16u zoneID = 0; + } + + response struct GetTwoDCartesianZoneResponse = 4 { + TwoDCartesianZoneStruct zones[] = 0; + } + + request struct RemoveZoneRequest { + int16u zoneID = 0; + } + + /** This command SHALL create and store a TwoD Cartesian Zone. */ + command access(invoke: manage) CreateTwoDCartesianZone(CreateTwoDCartesianZoneRequest): CreateTwoDCartesianZoneResponse = 0; + /** The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. */ + command access(invoke: manage) UpdateTwoDCartesianZone(UpdateTwoDCartesianZoneRequest): DefaultSuccess = 2; + /** The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. */ + command access(invoke: manage) GetTwoDCartesianZone(GetTwoDCartesianZoneRequest): GetTwoDCartesianZoneResponse = 3; + /** This command SHALL remove the Zone mapped to the passed in ZoneID. */ + command access(invoke: manage) RemoveZone(RemoveZoneRequest): DefaultSuccess = 5; +} + +/** The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. */ +cluster CameraAvStreamManagement = 1361 { + revision 1; + + enum AudioCodecEnum : enum8 { + kOPUS = 0; + kAACLC = 1; + } + + enum ImageCodecEnum : enum8 { + kJPEG = 0; + } + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + enum TriStateAutoEnum : enum8 { + kOff = 0; + kOn = 1; + kAuto = 2; + } + + enum TwoWayTalkSupportTypeEnum : enum8 { + kNotSupported = 0; + kHalfDuplex = 1; + kFullDuplex = 2; + } + + enum VideoCodecEnum : enum8 { + kH264 = 0; + kHEVC = 1; + kVVC = 2; + kAV1 = 3; + } + + bitmap Feature : bitmap32 { + kPrivacy = 0x1; + kAudio = 0x2; + kSpeaker = 0x4; + kImageControl = 0x8; + kVideo = 0x10; + kSnapshot = 0x20; + kWatermark = 0x40; + kOnScreenDisplay = 0x80; + kLocalStorage = 0x100; + } + + struct VideoResolutionStruct { + int16u width = 0; + int16u height = 1; + } + + struct VideoStreamStruct { + int16u videoStreamID = 0; + StreamTypeEnum streamType = 1; + VideoCodecEnum videoCodec = 2; + int16u minFrameRate = 3; + int16u maxFrameRate = 4; + VideoResolutionStruct minResolution = 5; + VideoResolutionStruct maxResolution = 6; + int32u minBitRate = 7; + int32u maxBitRate = 8; + int16u minFragmentLen = 9; + int16u maxFragmentLen = 10; + optional boolean watermarkEnabled = 11; + optional boolean OSDEnabled = 12; + int8u referenceCount = 13; + } + + struct SnapshotStreamStruct { + int16u snapshotStreamID = 0; + ImageCodecEnum imageCodec = 1; + int16u frameRate = 2; + int32u bitRate = 3; + VideoResolutionStruct minResolution = 4; + VideoResolutionStruct maxResolution = 5; + int8u quality = 6; + int8u referenceCount = 7; + } + + struct SnapshotParamsStruct { + VideoResolutionStruct resolution = 0; + int16u maxFrameRate = 1; + ImageCodecEnum imageCodec = 2; + } + + struct RateDistortionTradeOffPointsStruct { + VideoCodecEnum codec = 0; + VideoResolutionStruct resolution = 1; + int32u minBitRate = 2; + } + + struct AudioCapabilitiesStruct { + int8u maxNumberOfChannels = 0; + AudioCodecEnum supportedCodecs[] = 1; + int32u supportedSampleRates[] = 2; + int8u supportedBitDepths[] = 3; + } + + struct AudioStreamStruct { + int16u audioStreamID = 0; + StreamTypeEnum streamType = 1; + AudioCodecEnum audioCodec = 2; + int8u channelCount = 3; + int32u sampleRate = 4; + int32u bitRate = 5; + int8u bitDepth = 6; + int8u referenceCount = 7; + } + + struct VideoSensorParamsStruct { + int16u sensorWidth = 0; + int16u sensorHeight = 1; + boolean HDRCapable = 2; + int16u maxFPS = 3; + int16u maxHDRFPS = 4; + } + + struct ViewportStruct { + int16u x1 = 0; + int16u y1 = 1; + int16u x2 = 2; + int16u y2 = 3; + } + + info event VideoStreamChanged = 0 { + int16u videoStreamID = 0; + optional StreamTypeEnum streamType = 1; + optional VideoCodecEnum videoCodec = 2; + optional int16u minFrameRate = 3; + optional int16u maxFrameRate = 4; + optional VideoResolutionStruct minResolution = 5; + optional VideoResolutionStruct maxResolution = 6; + optional int32u minBitRate = 7; + optional int32u maxBitRate = 8; + optional int16u minFragmentLen = 9; + optional int16u maxFragmentLen = 10; + } + + info event AudioStreamChanged = 1 { + int16u audioStreamID = 0; + optional StreamTypeEnum streamType = 1; + optional AudioCodecEnum audioCodec = 2; + optional int8u channelCount = 3; + optional int32u sampleRate = 4; + optional int32u bitRate = 5; + optional int8u bitDepth = 6; + } + + info event SnapshotStreamChanged = 2 { + int16u snapshotStreamID = 0; + optional ImageCodecEnum imageCodec = 1; + optional int16u frameRate = 2; + optional int32u bitRate = 3; + optional VideoResolutionStruct minResolution = 4; + optional VideoResolutionStruct maxResolution = 5; + optional int8u quality = 6; + } + + readonly attribute optional int8u maxConcurrentVideoEncoders = 0; + readonly attribute optional int32u maxEncodedPixelRate = 1; + readonly attribute optional VideoSensorParamsStruct videoSensorParams = 2; + readonly attribute optional boolean nightVisionCapable = 3; + readonly attribute optional VideoResolutionStruct minViewport = 4; + readonly attribute optional RateDistortionTradeOffPointsStruct rateDistortionTradeOffPoints[] = 5; + readonly attribute optional int32u maxPreRollBufferSize = 6; + readonly attribute optional AudioCapabilitiesStruct microphoneCapabilities = 7; + readonly attribute optional AudioCapabilitiesStruct speakerCapabilities = 8; + readonly attribute optional TwoWayTalkSupportTypeEnum twoWayTalkSupport = 9; + readonly attribute optional SnapshotParamsStruct supportedSnapshotParams[] = 10; + readonly attribute int32u maxNetworkBandwidth = 11; + readonly attribute optional int16u currentFrameRate = 12; + attribute access(read: manage, write: manage) optional boolean HDRModeEnabled = 13; + readonly attribute optional VideoCodecEnum currentVideoCodecs[] = 14; + readonly attribute optional SnapshotParamsStruct currentSnapshotConfig = 15; + readonly attribute fabric_idx fabricsUsingCamera[] = 16; + readonly attribute optional VideoStreamStruct allocatedVideoStreams[] = 17; + readonly attribute optional AudioStreamStruct allocatedAudioStreams[] = 18; + readonly attribute optional SnapshotStreamStruct allocatedSnapshotStreams[] = 19; + attribute access(read: administer, write: administer) optional StreamTypeEnum rankedVideoStreamPrioritiesList[] = 20; + attribute optional boolean softRecordingPrivacyModeEnabled = 21; + attribute optional boolean softLivestreamPrivacyModeEnabled = 22; + readonly attribute optional boolean hardPrivacyModeOn = 23; + attribute access(read: manage, write: manage) optional TriStateAutoEnum nightVision = 24; + attribute access(read: manage, write: manage) optional TriStateAutoEnum nightVisionIllum = 25; + attribute access(read: manage, write: manage) optional boolean AWBEnabled = 26; + attribute access(read: manage, write: manage) optional boolean autoShutterSpeedEnabled = 27; + attribute access(read: manage, write: manage) optional boolean autoISOEnabled = 28; + readonly attribute optional ViewportStruct viewport = 29; + attribute access(read: manage, write: manage) optional boolean speakerMuted = 30; + attribute access(read: manage, write: manage) optional int8u speakerVolumeLevel = 31; + attribute access(read: manage, write: manage) optional int8u speakerMaxLevel = 32; + attribute access(read: manage, write: manage) optional int8u speakerMinLevel = 33; + attribute access(read: manage, write: manage) optional boolean microphoneMuted = 34; + attribute access(read: manage, write: manage) optional int8u microphoneVolumeLevel = 35; + attribute access(read: manage, write: manage) optional int8u microphoneMaxLevel = 36; + attribute access(read: manage, write: manage) optional int8u microphoneMinLevel = 37; + attribute access(read: manage, write: manage) optional boolean microphoneAGCEnabled = 38; + readonly attribute optional int16u imageRotation = 39; + readonly attribute optional boolean imageFlipHorizontal = 40; + readonly attribute optional boolean imageFlipVertical = 41; + attribute access(read: manage, write: manage) optional boolean localVideoRecordingEnabled = 42; + attribute access(read: manage, write: manage) optional boolean localSnapshotRecordingEnabled = 43; + attribute access(read: manage, write: manage) optional boolean statusLightEnabled = 44; + attribute access(read: manage, write: manage) optional ThreeLevelAutoEnum statusLightBrightness = 45; + attribute access(read: manage, write: manage) optional TriStateAutoEnum depthSensorStatus = 46; + 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 AudioStreamAllocateRequest { + StreamTypeEnum streamType = 0; + AudioCodecEnum audioCodec = 1; + int8u channelCount = 2; + int32u sampleRate = 3; + int32u bitRate = 4; + int8u bitDepth = 5; + } + + response struct AudioStreamAllocateResponse = 1 { + int16u audioStreamID = 0; + } + + request struct AudioStreamDeallocateRequest { + int16u audioStreamID = 0; + } + + request struct VideoStreamAllocateRequest { + StreamTypeEnum streamType = 0; + VideoCodecEnum videoCodec = 1; + int16u minFrameRate = 2; + int16u maxFrameRate = 3; + VideoResolutionStruct minResolution = 4; + VideoResolutionStruct maxResolution = 5; + int32u minBitRate = 6; + int32u maxBitRate = 7; + int16u minFragmentLen = 8; + int16u maxFragmentLen = 9; + optional boolean watermarkEnabled = 10; + optional boolean OSDEnabled = 11; + } + + response struct VideoStreamAllocateResponse = 4 { + int16u videoStreamID = 0; + } + + request struct VideoStreamModifyRequest { + int16u videoStreamID = 0; + optional VideoResolutionStruct resolution = 1; + optional boolean watermarkEnabled = 2; + optional boolean OSDEnabled = 3; + } + + request struct VideoStreamDeallocateRequest { + int16u videoStreamID = 0; + } + + request struct SnapshotStreamAllocateRequest { + ImageCodecEnum imageCodec = 0; + int16u frameRate = 1; + int32u bitRate = 2; + VideoResolutionStruct minResolution = 3; + VideoResolutionStruct maxResolution = 4; + int8u quality = 5; + } + + response struct SnapshotStreamAllocateResponse = 8 { + int16u snapshotStreamID = 0; + } + + request struct SnapshotStreamDeallocateRequest { + int16u snapshotStreamID = 0; + } + + request struct SetStreamPrioritiesRequest { + StreamTypeEnum streamPriorities[] = 0; + } + + request struct CaptureSnapshotRequest { + int16u snapshotStreamID = 0; + VideoResolutionStruct requestedResolution = 1; + } + + response struct CaptureSnapshotResponse = 12 { + octet_string data = 0; + ImageCodecEnum imageCodec = 1; + VideoResolutionStruct resolution = 2; + } + + request struct SetViewportRequest { + ViewportStruct viewport = 0; + } + + request struct SetImageRotationRequest { + int16u angle = 0; + } + + request struct SetImageFlipHorizontalRequest { + boolean enabled = 0; + } + + request struct SetImageFlipVerticalRequest { + boolean enabled = 0; + } + + /** This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. */ + command access(invoke: manage) AudioStreamAllocate(AudioStreamAllocateRequest): AudioStreamAllocateResponse = 0; + /** This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. */ + command access(invoke: manage) AudioStreamDeallocate(AudioStreamDeallocateRequest): DefaultSuccess = 2; + /** This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. */ + command access(invoke: manage) VideoStreamAllocate(VideoStreamAllocateRequest): VideoStreamAllocateResponse = 3; + /** This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. */ + command access(invoke: manage) VideoStreamModify(VideoStreamModifyRequest): DefaultSuccess = 5; + /** This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. */ + command access(invoke: manage) VideoStreamDeallocate(VideoStreamDeallocateRequest): DefaultSuccess = 6; + /** This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. */ + command access(invoke: manage) SnapshotStreamAllocate(SnapshotStreamAllocateRequest): SnapshotStreamAllocateResponse = 7; + /** This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. */ + command access(invoke: manage) SnapshotStreamDeallocate(SnapshotStreamDeallocateRequest): DefaultSuccess = 9; + /** This command SHALL set the relative priorities of the various stream types on the camera. */ + command access(invoke: administer) SetStreamPriorities(SetStreamPrioritiesRequest): DefaultSuccess = 10; + /** This command SHALL return a Snapshot from the camera. */ + command access(invoke: manage) CaptureSnapshot(CaptureSnapshotRequest): DefaultSuccess = 11; + /** This command sets the viewport in all video streams. */ + command access(invoke: manage) SetViewport(SetViewportRequest): DefaultSuccess = 13; + /** The data fields for this command SHALL be as follows: */ + command access(invoke: manage) SetImageRotation(SetImageRotationRequest): DefaultSuccess = 14; + /** The data fields for this command SHALL be as follows: */ + command access(invoke: manage) SetImageFlipHorizontal(SetImageFlipHorizontalRequest): DefaultSuccess = 15; + /** The data fields for this command SHALL be as follows: */ + command access(invoke: manage) SetImageFlipVertical(SetImageFlipVerticalRequest): DefaultSuccess = 16; +} + /** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */ provisional cluster WebRTCTransportProvider = 1363 { revision 1; @@ -9530,6 +9989,93 @@ provisional cluster WebRTCTransportProvider = 1363 { command EndSession(EndSessionRequest): DefaultSuccess = 7; } +/** The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. */ +cluster WebRTCTransportRequestor = 1364 { + revision 1; + + enum StreamTypeEnum : enum8 { + kInternal = 0; + kRecording = 1; + kAnalysis = 2; + kLiveView = 3; + } + + enum WebRTCEndReasonEnum : enum8 { + kIceFailed = 0; + kIceTimeout = 1; + kUserHangup = 2; + kUserBusy = 3; + kReplaced = 4; + kNoUserMedia = 5; + kInviteTimeout = 6; + kAnsweredElsewhere = 7; + kOutOfResources = 8; + kMediaTimeout = 9; + kLowPower = 10; + kUnknownReason = 11; + } + + bitmap WebRTCMetadataOptions : bitmap8 { + kDataTLV = 0x1; + } + + struct ICEServerStruct { + char_string urls[] = 1; + optional char_string username = 2; + optional char_string credential = 3; + optional int16u caid = 4; + } + + struct WebRTCSessionStruct { + int16u id = 1; + node_id peerNodeID = 2; + fabric_idx peerFabricIndex = 3; + StreamTypeEnum streamType = 4; + nullable int16u videoStreamID = 5; + nullable int16u audioStreamID = 6; + WebRTCMetadataOptions metadataOptions = 7; + } + + readonly attribute WebRTCSessionStruct currentSessions[] = 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 OfferRequest { + int16u webRTCSessionID = 0; + char_string sdp = 1; + optional ICEServerStruct ICEServers[] = 2; + optional char_string ICETransportPolicy = 3; + } + + request struct AnswerRequest { + int16u webRTCSessionID = 0; + char_string sdp = 1; + } + + request struct ICECandidateRequest { + int16u webRTCSessionID = 0; + char_string ICECandidate = 1; + } + + request struct EndRequest { + int16u webRTCSessionID = 0; + WebRTCEndReasonEnum reason = 1; + } + + /** This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. */ + command Offer(OfferRequest): DefaultSuccess = 1; + /** This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. */ + command Answer(AnswerRequest): DefaultSuccess = 2; + /** This command provides an ICE candidate to the stream requestor in a WebRTC session. */ + command ICECandidate(ICECandidateRequest): DefaultSuccess = 3; + /** This command notifies the stream requestor that the provider has ended the WebRTC session. */ + command End(EndRequest): DefaultSuccess = 4; +} + /** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ provisional cluster Chime = 1366 { revision 1; diff --git a/src/controller/java/AndroidCallbacks-ForTestJNI.cpp b/src/controller/java/AndroidCallbacks-ForTestJNI.cpp index 568e0ee847..1657aef819 100644 --- a/src/controller/java/AndroidCallbacks-ForTestJNI.cpp +++ b/src/controller/java/AndroidCallbacks-ForTestJNI.cpp @@ -43,7 +43,7 @@ JNI_METHOD(void, GetConnectedDeviceCallbackForTestJni, onDeviceConnected) } JNI_METHOD(void, GetConnectedDeviceCallbackForTestJni, onDeviceConnectionFailure) -(JNIEnv * env, jobject self, jlong callbackHandle, jint errorCode) +(JNIEnv * env, jobject self, jlong callbackHandle, jlong errorCode) { GetConnectedDeviceCallback * connectedDeviceCallback = reinterpret_cast(callbackHandle); VerifyOrReturn(connectedDeviceCallback != nullptr, ChipLogError(Controller, "GetConnectedDeviceCallbackJni handle is nullptr")); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 88e4e0fb90..5560704fd3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -7987,6 +7987,7 @@ public static class GeneralCommissioningCluster extends BaseChipCluster { private static final long TC_MIN_REQUIRED_VERSION_ATTRIBUTE_ID = 6L; private static final long TC_ACKNOWLEDGEMENTS_ATTRIBUTE_ID = 7L; private static final long TC_ACKNOWLEDGEMENTS_REQUIRED_ATTRIBUTE_ID = 8L; + private static final long TC_UPDATE_DEADLINE_ATTRIBUTE_ID = 9L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -8436,6 +8437,32 @@ public void onSuccess(byte[] tlv) { }, TC_ACKNOWLEDGEMENTS_REQUIRED_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readTCUpdateDeadlineAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TC_UPDATE_DEADLINE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TC_UPDATE_DEADLINE_ATTRIBUTE_ID, true); + } + + public void subscribeTCUpdateDeadlineAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TC_UPDATE_DEADLINE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TC_UPDATE_DEADLINE_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); @@ -59491,10 +59518,13 @@ public void onSuccess(byte[] tlv) { } } - public static class WebRTCTransportProviderCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 1363L; + public static class ZoneManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1360L; - private static final long CURRENT_SESSIONS_ATTRIBUTE_ID = 0L; + private static final long SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID = 0L; + private static final long ZONES_ATTRIBUTE_ID = 1L; + private static final long TIME_CONTROL_ATTRIBUTE_ID = 2L; + private static final long SENSITIVITY_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -59502,7 +59532,7 @@ public static class WebRTCTransportProviderCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public WebRTCTransportProviderCluster(long devicePtr, int endpointId) { + public ZoneManagementCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -59512,164 +59542,101 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void solicitOffer(SolicitOfferResponseCallback callback, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions) { - solicitOffer(callback, streamType, videoStreamID, audioStreamID, ICEServers, ICETransportPolicy, metadataOptions, 0); + public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) { + createTwoDCartesianZone(callback, zone, 0); } - public void solicitOffer(SolicitOfferResponseCallback callback, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions, int timedInvokeTimeoutMs) { - final long commandId = 1L; + public void createTwoDCartesianZone(CreateTwoDCartesianZoneResponseCallback callback, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) { + final long commandId = 0L; ArrayList elements = new ArrayList<>(); - final long streamTypeFieldID = 0L; - BaseTLVType streamTypetlvValue = new UIntType(streamType); - elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); - - final long videoStreamIDFieldID = 1L; - BaseTLVType videoStreamIDtlvValue = videoStreamID != null ? videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()) : new NullType(); - elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); - - final long audioStreamIDFieldID = 2L; - BaseTLVType audioStreamIDtlvValue = audioStreamID != null ? audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()) : new NullType(); - elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); - - final long ICEServersFieldID = 3L; - BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); - elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); - - final long ICETransportPolicyFieldID = 4L; - BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); - elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); - - final long metadataOptionsFieldID = 5L; - BaseTLVType metadataOptionstlvValue = metadataOptions.map((nonOptionalmetadataOptions) -> new UIntType(nonOptionalmetadataOptions)).orElse(new EmptyType()); - elements.add(new StructElement(metadataOptionsFieldID, metadataOptionstlvValue)); + final long zoneFieldID = 0L; + BaseTLVType zonetlvValue = zone.encodeTlv(); + elements.add(new StructElement(zoneFieldID, zonetlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - final long webRTCSessionIDFieldID = 0L; - Integer webRTCSessionID = null; - final long deferredOfferFieldID = 1L; - Boolean deferredOffer = null; - final long videoStreamIDFieldID = 2L; - @Nullable Optional videoStreamID = null; - final long audioStreamIDFieldID = 3L; - @Nullable Optional audioStreamID = null; + final long zoneIDFieldID = 0L; + Integer zoneID = null; for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == webRTCSessionIDFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - webRTCSessionID = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == deferredOfferFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { - BooleanType castingValue = element.value(BooleanType.class); - deferredOffer = castingValue.value(Boolean.class); - } - } else if (element.contextTagNum() == videoStreamIDFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - videoStreamID = Optional.of(castingValue.value(Integer.class)); - } - } else if (element.contextTagNum() == audioStreamIDFieldID) { + if (element.contextTagNum() == zoneIDFieldID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - audioStreamID = Optional.of(castingValue.value(Integer.class)); + zoneID = castingValue.value(Integer.class); } } } - callback.onSuccess(webRTCSessionID, deferredOffer, videoStreamID, audioStreamID); + callback.onSuccess(zoneID); }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void provideOffer(ProvideOfferResponseCallback callback, @Nullable Integer webRTCSessionID, String sdp, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions) { - provideOffer(callback, webRTCSessionID, sdp, streamType, videoStreamID, audioStreamID, ICEServers, ICETransportPolicy, metadataOptions, 0); + public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone) { + updateTwoDCartesianZone(callback, zoneID, zone, 0); } - public void provideOffer(ProvideOfferResponseCallback callback, @Nullable Integer webRTCSessionID, String sdp, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions, int timedInvokeTimeoutMs) { - final long commandId = 3L; + public void updateTwoDCartesianZone(DefaultClusterCallback callback, Integer zoneID, ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct zone, int timedInvokeTimeoutMs) { + final long commandId = 2L; ArrayList elements = new ArrayList<>(); - final long webRTCSessionIDFieldID = 0L; - BaseTLVType webRTCSessionIDtlvValue = webRTCSessionID != null ? new UIntType(webRTCSessionID) : new NullType(); - elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); - - final long sdpFieldID = 1L; - BaseTLVType sdptlvValue = new StringType(sdp); - elements.add(new StructElement(sdpFieldID, sdptlvValue)); - - final long streamTypeFieldID = 2L; - BaseTLVType streamTypetlvValue = new UIntType(streamType); - elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = new UIntType(zoneID); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); - final long videoStreamIDFieldID = 3L; - BaseTLVType videoStreamIDtlvValue = videoStreamID != null ? videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()) : new NullType(); - elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + final long zoneFieldID = 1L; + BaseTLVType zonetlvValue = zone.encodeTlv(); + elements.add(new StructElement(zoneFieldID, zonetlvValue)); - final long audioStreamIDFieldID = 4L; - BaseTLVType audioStreamIDtlvValue = audioStreamID != null ? audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()) : new NullType(); - elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } - final long ICEServersFieldID = 5L; - BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); - elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); + public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID) { + getTwoDCartesianZone(callback, zoneID, 0); + } - final long ICETransportPolicyFieldID = 6L; - BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); - elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); + public void getTwoDCartesianZone(GetTwoDCartesianZoneResponseCallback callback, @Nullable Optional zoneID, int timedInvokeTimeoutMs) { + final long commandId = 3L; - final long metadataOptionsFieldID = 7L; - BaseTLVType metadataOptionstlvValue = metadataOptions.map((nonOptionalmetadataOptions) -> new UIntType(nonOptionalmetadataOptions)).orElse(new EmptyType()); - elements.add(new StructElement(metadataOptionsFieldID, metadataOptionstlvValue)); + ArrayList elements = new ArrayList<>(); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = zoneID != null ? zoneID.map((nonOptionalzoneID) -> new UIntType(nonOptionalzoneID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - final long webRTCSessionIDFieldID = 0L; - Integer webRTCSessionID = null; - final long videoStreamIDFieldID = 1L; - Integer videoStreamID = null; - final long audioStreamIDFieldID = 2L; - Integer audioStreamID = null; + final long zonesFieldID = 0L; + ArrayList zones = null; for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == webRTCSessionIDFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - webRTCSessionID = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == videoStreamIDFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - videoStreamID = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == audioStreamIDFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - audioStreamID = castingValue.value(Integer.class); + if (element.contextTagNum() == zonesFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct.decodeTlv(elementcastingValue)); } } } - callback.onSuccess(webRTCSessionID, videoStreamID, audioStreamID); + callback.onSuccess(zones); }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void provideAnswer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp) { - provideAnswer(callback, webRTCSessionID, sdp, 0); + public void removeZone(DefaultClusterCallback callback, Integer zoneID) { + removeZone(callback, zoneID, 0); } - public void provideAnswer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, int timedInvokeTimeoutMs) { + public void removeZone(DefaultClusterCallback callback, Integer zoneID, int timedInvokeTimeoutMs) { final long commandId = 5L; ArrayList elements = new ArrayList<>(); - final long webRTCSessionIDFieldID = 0L; - BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); - elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); - - final long sdpFieldID = 1L; - BaseTLVType sdptlvValue = new StringType(sdp); - elements.add(new StructElement(sdpFieldID, sdptlvValue)); + final long zoneIDFieldID = 0L; + BaseTLVType zoneIDtlvValue = new UIntType(zoneID); + elements.add(new StructElement(zoneIDFieldID, zoneIDtlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @@ -59679,103 +59646,3061 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { - provideICECandidate(callback, webRTCSessionID, ICECandidate, 0); + public interface CreateTwoDCartesianZoneResponseCallback extends BaseClusterCallback { + void onSuccess(Integer zoneID); } - public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { - final long commandId = 6L; + public interface GetTwoDCartesianZoneResponseCallback extends BaseClusterCallback { + void onSuccess(ArrayList zones); + } - ArrayList elements = new ArrayList<>(); - final long webRTCSessionIDFieldID = 0L; - BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); - elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + public interface SupportedZoneSourcesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - final long ICECandidateFieldID = 1L; - BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate); - elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue)); + public interface ZonesAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { + public interface TimeControlAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readSupportedZoneSourcesAttribute( + SupportedZoneSourcesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, true); } - public void endSession(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason) { - endSession(callback, webRTCSessionID, reason, 0); + public void subscribeSupportedZoneSourcesAttribute( + SupportedZoneSourcesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_ZONE_SOURCES_ATTRIBUTE_ID, minInterval, maxInterval); } - public void endSession(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason, int timedInvokeTimeoutMs) { - final long commandId = 7L; + public void readZonesAttribute( + ZonesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID); - ArrayList elements = new ArrayList<>(); - final long webRTCSessionIDFieldID = 0L; - BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); - elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZONES_ATTRIBUTE_ID, true); + } - final long reasonFieldID = 1L; - BaseTLVType reasontlvValue = new UIntType(reason); - elements.add(new StructElement(reasonFieldID, reasontlvValue)); + public void subscribeZonesAttribute( + ZonesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ZONES_ATTRIBUTE_ID); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { + subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ZONES_ATTRIBUTE_ID, minInterval, maxInterval); } - public interface SolicitOfferResponseCallback extends BaseClusterCallback { - void onSuccess(Integer webRTCSessionID, Boolean deferredOffer, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID); + public void readTimeControlAttribute( + TimeControlAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TIME_CONTROL_ATTRIBUTE_ID, true); } - public interface ProvideOfferResponseCallback extends BaseClusterCallback { - void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID); + public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value) { + writeTimeControlAttribute(callback, value, 0); } - public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void writeTimeControlAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> elementvalue.encodeTlv()); + writeAttribute(new WriteAttributesCallbackImpl(callback), TIME_CONTROL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void subscribeTimeControlAttribute( + TimeControlAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TIME_CONTROL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TIME_CONTROL_ATTRIBUTE_ID, minInterval, maxInterval); } - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void readSensitivityAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SENSITIVITY_ATTRIBUTE_ID, true); } - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value) { + writeSensitivityAttribute(callback, value, 0); } - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public void writeSensitivityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SENSITIVITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void readCurrentSessionsAttribute( - CurrentSessionsAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + public void subscribeSensitivityAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SENSITIVITY_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SENSITIVITY_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, CURRENT_SESSIONS_ATTRIBUTE_ID, true); + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); } - public void subscribeCurrentSessionsAttribute( - CurrentSessionsAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + + public static class CameraAvStreamManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1361L; + + private static final long MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID = 0L; + private static final long MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID = 1L; + private static final long VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID = 2L; + private static final long NIGHT_VISION_CAPABLE_ATTRIBUTE_ID = 3L; + private static final long MIN_VIEWPORT_ATTRIBUTE_ID = 4L; + private static final long RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID = 5L; + private static final long MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID = 6L; + private static final long MICROPHONE_CAPABILITIES_ATTRIBUTE_ID = 7L; + private static final long SPEAKER_CAPABILITIES_ATTRIBUTE_ID = 8L; + private static final long TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID = 9L; + private static final long SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID = 10L; + private static final long MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID = 11L; + private static final long CURRENT_FRAME_RATE_ATTRIBUTE_ID = 12L; + private static final long HDR_MODE_ENABLED_ATTRIBUTE_ID = 13L; + private static final long CURRENT_VIDEO_CODECS_ATTRIBUTE_ID = 14L; + private static final long CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID = 15L; + private static final long FABRICS_USING_CAMERA_ATTRIBUTE_ID = 16L; + private static final long ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID = 17L; + private static final long ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID = 18L; + private static final long ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID = 19L; + private static final long RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID = 20L; + private static final long SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID = 21L; + private static final long SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID = 22L; + private static final long HARD_PRIVACY_MODE_ON_ATTRIBUTE_ID = 23L; + private static final long NIGHT_VISION_ATTRIBUTE_ID = 24L; + private static final long NIGHT_VISION_ILLUM_ATTRIBUTE_ID = 25L; + private static final long AWB_ENABLED_ATTRIBUTE_ID = 26L; + private static final long AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID = 27L; + private static final long AUTO_ISO_ENABLED_ATTRIBUTE_ID = 28L; + private static final long VIEWPORT_ATTRIBUTE_ID = 29L; + private static final long SPEAKER_MUTED_ATTRIBUTE_ID = 30L; + private static final long SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID = 31L; + private static final long SPEAKER_MAX_LEVEL_ATTRIBUTE_ID = 32L; + private static final long SPEAKER_MIN_LEVEL_ATTRIBUTE_ID = 33L; + private static final long MICROPHONE_MUTED_ATTRIBUTE_ID = 34L; + private static final long MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID = 35L; + private static final long MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID = 36L; + private static final long MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID = 37L; + private static final long MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID = 38L; + private static final long IMAGE_ROTATION_ATTRIBUTE_ID = 39L; + private static final long IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID = 40L; + private static final long IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID = 41L; + private static final long LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID = 42L; + private static final long LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID = 43L; + private static final long STATUS_LIGHT_ENABLED_ATTRIBUTE_ID = 44L; + private static final long STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID = 45L; + private static final long DEPTH_SENSOR_STATUS_ATTRIBUTE_ID = 46L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public CameraAvStreamManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void audioStreamAllocate(AudioStreamAllocateResponseCallback callback, Integer streamType, Integer audioCodec, Integer channelCount, Long sampleRate, Long bitRate, Integer bitDepth) { + audioStreamAllocate(callback, streamType, audioCodec, channelCount, sampleRate, bitRate, bitDepth, 0); + } + + public void audioStreamAllocate(AudioStreamAllocateResponseCallback callback, Integer streamType, Integer audioCodec, Integer channelCount, Long sampleRate, Long bitRate, Integer bitDepth, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + final long streamTypeFieldID = 0L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long audioCodecFieldID = 1L; + BaseTLVType audioCodectlvValue = new UIntType(audioCodec); + elements.add(new StructElement(audioCodecFieldID, audioCodectlvValue)); + + final long channelCountFieldID = 2L; + BaseTLVType channelCounttlvValue = new UIntType(channelCount); + elements.add(new StructElement(channelCountFieldID, channelCounttlvValue)); + + final long sampleRateFieldID = 3L; + BaseTLVType sampleRatetlvValue = new UIntType(sampleRate); + elements.add(new StructElement(sampleRateFieldID, sampleRatetlvValue)); + + final long bitRateFieldID = 4L; + BaseTLVType bitRatetlvValue = new UIntType(bitRate); + elements.add(new StructElement(bitRateFieldID, bitRatetlvValue)); + + final long bitDepthFieldID = 5L; + BaseTLVType bitDepthtlvValue = new UIntType(bitDepth); + elements.add(new StructElement(bitDepthFieldID, bitDepthtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long audioStreamIDFieldID = 0L; + Integer audioStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == audioStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(audioStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void audioStreamDeallocate(DefaultClusterCallback callback, Integer audioStreamID) { + audioStreamDeallocate(callback, audioStreamID, 0); + } + + public void audioStreamDeallocate(DefaultClusterCallback callback, Integer audioStreamID, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long audioStreamIDFieldID = 0L; + BaseTLVType audioStreamIDtlvValue = new UIntType(audioStreamID); + elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamAllocate(VideoStreamAllocateResponseCallback callback, Integer streamType, Integer videoCodec, Integer minFrameRate, Integer maxFrameRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Long minBitRate, Long maxBitRate, Integer minFragmentLen, Integer maxFragmentLen, Optional watermarkEnabled, Optional OSDEnabled) { + videoStreamAllocate(callback, streamType, videoCodec, minFrameRate, maxFrameRate, minResolution, maxResolution, minBitRate, maxBitRate, minFragmentLen, maxFragmentLen, watermarkEnabled, OSDEnabled, 0); + } + + public void videoStreamAllocate(VideoStreamAllocateResponseCallback callback, Integer streamType, Integer videoCodec, Integer minFrameRate, Integer maxFrameRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Long minBitRate, Long maxBitRate, Integer minFragmentLen, Integer maxFragmentLen, Optional watermarkEnabled, Optional OSDEnabled, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long streamTypeFieldID = 0L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long videoCodecFieldID = 1L; + BaseTLVType videoCodectlvValue = new UIntType(videoCodec); + elements.add(new StructElement(videoCodecFieldID, videoCodectlvValue)); + + final long minFrameRateFieldID = 2L; + BaseTLVType minFrameRatetlvValue = new UIntType(minFrameRate); + elements.add(new StructElement(minFrameRateFieldID, minFrameRatetlvValue)); + + final long maxFrameRateFieldID = 3L; + BaseTLVType maxFrameRatetlvValue = new UIntType(maxFrameRate); + elements.add(new StructElement(maxFrameRateFieldID, maxFrameRatetlvValue)); + + final long minResolutionFieldID = 4L; + BaseTLVType minResolutiontlvValue = minResolution.encodeTlv(); + elements.add(new StructElement(minResolutionFieldID, minResolutiontlvValue)); + + final long maxResolutionFieldID = 5L; + BaseTLVType maxResolutiontlvValue = maxResolution.encodeTlv(); + elements.add(new StructElement(maxResolutionFieldID, maxResolutiontlvValue)); + + final long minBitRateFieldID = 6L; + BaseTLVType minBitRatetlvValue = new UIntType(minBitRate); + elements.add(new StructElement(minBitRateFieldID, minBitRatetlvValue)); + + final long maxBitRateFieldID = 7L; + BaseTLVType maxBitRatetlvValue = new UIntType(maxBitRate); + elements.add(new StructElement(maxBitRateFieldID, maxBitRatetlvValue)); + + final long minFragmentLenFieldID = 8L; + BaseTLVType minFragmentLentlvValue = new UIntType(minFragmentLen); + elements.add(new StructElement(minFragmentLenFieldID, minFragmentLentlvValue)); + + final long maxFragmentLenFieldID = 9L; + BaseTLVType maxFragmentLentlvValue = new UIntType(maxFragmentLen); + elements.add(new StructElement(maxFragmentLenFieldID, maxFragmentLentlvValue)); + + final long watermarkEnabledFieldID = 10L; + BaseTLVType watermarkEnabledtlvValue = watermarkEnabled.map((nonOptionalwatermarkEnabled) -> new BooleanType(nonOptionalwatermarkEnabled)).orElse(new EmptyType()); + elements.add(new StructElement(watermarkEnabledFieldID, watermarkEnabledtlvValue)); + + final long OSDEnabledFieldID = 11L; + BaseTLVType OSDEnabledtlvValue = OSDEnabled.map((nonOptionalOSDEnabled) -> new BooleanType(nonOptionalOSDEnabled)).orElse(new EmptyType()); + elements.add(new StructElement(OSDEnabledFieldID, OSDEnabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long videoStreamIDFieldID = 0L; + Integer videoStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == videoStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(videoStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamModify(DefaultClusterCallback callback, Integer videoStreamID, Optional resolution, Optional watermarkEnabled, Optional OSDEnabled) { + videoStreamModify(callback, videoStreamID, resolution, watermarkEnabled, OSDEnabled, 0); + } + + public void videoStreamModify(DefaultClusterCallback callback, Integer videoStreamID, Optional resolution, Optional watermarkEnabled, Optional OSDEnabled, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long resolutionFieldID = 1L; + BaseTLVType resolutiontlvValue = resolution.map((nonOptionalresolution) -> nonOptionalresolution.encodeTlv()).orElse(new EmptyType()); + elements.add(new StructElement(resolutionFieldID, resolutiontlvValue)); + + final long watermarkEnabledFieldID = 2L; + BaseTLVType watermarkEnabledtlvValue = watermarkEnabled.map((nonOptionalwatermarkEnabled) -> new BooleanType(nonOptionalwatermarkEnabled)).orElse(new EmptyType()); + elements.add(new StructElement(watermarkEnabledFieldID, watermarkEnabledtlvValue)); + + final long OSDEnabledFieldID = 3L; + BaseTLVType OSDEnabledtlvValue = OSDEnabled.map((nonOptionalOSDEnabled) -> new BooleanType(nonOptionalOSDEnabled)).orElse(new EmptyType()); + elements.add(new StructElement(OSDEnabledFieldID, OSDEnabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void videoStreamDeallocate(DefaultClusterCallback callback, Integer videoStreamID) { + videoStreamDeallocate(callback, videoStreamID, 0); + } + + public void videoStreamDeallocate(DefaultClusterCallback callback, Integer videoStreamID, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long videoStreamIDFieldID = 0L; + BaseTLVType videoStreamIDtlvValue = new UIntType(videoStreamID); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void snapshotStreamAllocate(SnapshotStreamAllocateResponseCallback callback, Integer imageCodec, Integer frameRate, Long bitRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Integer quality) { + snapshotStreamAllocate(callback, imageCodec, frameRate, bitRate, minResolution, maxResolution, quality, 0); + } + + public void snapshotStreamAllocate(SnapshotStreamAllocateResponseCallback callback, Integer imageCodec, Integer frameRate, Long bitRate, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, Integer quality, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + final long imageCodecFieldID = 0L; + BaseTLVType imageCodectlvValue = new UIntType(imageCodec); + elements.add(new StructElement(imageCodecFieldID, imageCodectlvValue)); + + final long frameRateFieldID = 1L; + BaseTLVType frameRatetlvValue = new UIntType(frameRate); + elements.add(new StructElement(frameRateFieldID, frameRatetlvValue)); + + final long bitRateFieldID = 2L; + BaseTLVType bitRatetlvValue = new UIntType(bitRate); + elements.add(new StructElement(bitRateFieldID, bitRatetlvValue)); + + final long minResolutionFieldID = 3L; + BaseTLVType minResolutiontlvValue = minResolution.encodeTlv(); + elements.add(new StructElement(minResolutionFieldID, minResolutiontlvValue)); + + final long maxResolutionFieldID = 4L; + BaseTLVType maxResolutiontlvValue = maxResolution.encodeTlv(); + elements.add(new StructElement(maxResolutionFieldID, maxResolutiontlvValue)); + + final long qualityFieldID = 5L; + BaseTLVType qualitytlvValue = new UIntType(quality); + elements.add(new StructElement(qualityFieldID, qualitytlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long snapshotStreamIDFieldID = 0L; + Integer snapshotStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == snapshotStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(snapshotStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void snapshotStreamDeallocate(DefaultClusterCallback callback, Integer snapshotStreamID) { + snapshotStreamDeallocate(callback, snapshotStreamID, 0); + } + + public void snapshotStreamDeallocate(DefaultClusterCallback callback, Integer snapshotStreamID, int timedInvokeTimeoutMs) { + final long commandId = 9L; + + ArrayList elements = new ArrayList<>(); + final long snapshotStreamIDFieldID = 0L; + BaseTLVType snapshotStreamIDtlvValue = new UIntType(snapshotStreamID); + elements.add(new StructElement(snapshotStreamIDFieldID, snapshotStreamIDtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setStreamPriorities(DefaultClusterCallback callback, ArrayList streamPriorities) { + setStreamPriorities(callback, streamPriorities, 0); + } + + public void setStreamPriorities(DefaultClusterCallback callback, ArrayList streamPriorities, int timedInvokeTimeoutMs) { + final long commandId = 10L; + + ArrayList elements = new ArrayList<>(); + final long streamPrioritiesFieldID = 0L; + BaseTLVType streamPrioritiestlvValue = ArrayType.generateArrayType(streamPriorities, (elementstreamPriorities) -> new UIntType(elementstreamPriorities)); + elements.add(new StructElement(streamPrioritiesFieldID, streamPrioritiestlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void captureSnapshot(DefaultClusterCallback callback, Integer snapshotStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct requestedResolution) { + captureSnapshot(callback, snapshotStreamID, requestedResolution, 0); + } + + public void captureSnapshot(DefaultClusterCallback callback, Integer snapshotStreamID, ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct requestedResolution, int timedInvokeTimeoutMs) { + final long commandId = 11L; + + ArrayList elements = new ArrayList<>(); + final long snapshotStreamIDFieldID = 0L; + BaseTLVType snapshotStreamIDtlvValue = new UIntType(snapshotStreamID); + elements.add(new StructElement(snapshotStreamIDFieldID, snapshotStreamIDtlvValue)); + + final long requestedResolutionFieldID = 1L; + BaseTLVType requestedResolutiontlvValue = requestedResolution.encodeTlv(); + elements.add(new StructElement(requestedResolutionFieldID, requestedResolutiontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setViewport(DefaultClusterCallback callback, ChipStructs.CameraAvStreamManagementClusterViewportStruct viewport) { + setViewport(callback, viewport, 0); + } + + public void setViewport(DefaultClusterCallback callback, ChipStructs.CameraAvStreamManagementClusterViewportStruct viewport, int timedInvokeTimeoutMs) { + final long commandId = 13L; + + ArrayList elements = new ArrayList<>(); + final long viewportFieldID = 0L; + BaseTLVType viewporttlvValue = viewport.encodeTlv(); + elements.add(new StructElement(viewportFieldID, viewporttlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageRotation(DefaultClusterCallback callback, Integer angle) { + setImageRotation(callback, angle, 0); + } + + public void setImageRotation(DefaultClusterCallback callback, Integer angle, int timedInvokeTimeoutMs) { + final long commandId = 14L; + + ArrayList elements = new ArrayList<>(); + final long angleFieldID = 0L; + BaseTLVType angletlvValue = new UIntType(angle); + elements.add(new StructElement(angleFieldID, angletlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageFlipHorizontal(DefaultClusterCallback callback, Boolean enabled) { + setImageFlipHorizontal(callback, enabled, 0); + } + + public void setImageFlipHorizontal(DefaultClusterCallback callback, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 15L; + + ArrayList elements = new ArrayList<>(); + final long enabledFieldID = 0L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void setImageFlipVertical(DefaultClusterCallback callback, Boolean enabled) { + setImageFlipVertical(callback, enabled, 0); + } + + public void setImageFlipVertical(DefaultClusterCallback callback, Boolean enabled, int timedInvokeTimeoutMs) { + final long commandId = 16L; + + ArrayList elements = new ArrayList<>(); + final long enabledFieldID = 0L; + BaseTLVType enabledtlvValue = new BooleanType(enabled); + elements.add(new StructElement(enabledFieldID, enabledtlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface AudioStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer audioStreamID); + } + + public interface VideoStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer videoStreamID); + } + + public interface SnapshotStreamAllocateResponseCallback extends BaseClusterCallback { + void onSuccess(Integer snapshotStreamID); + } + + public interface VideoSensorParamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value); + } + + public interface MinViewportAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value); + } + + public interface RateDistortionTradeOffPointsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface MicrophoneCapabilitiesAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value); + } + + public interface SpeakerCapabilitiesAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value); + } + + public interface SupportedSnapshotParamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface CurrentVideoCodecsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface CurrentSnapshotConfigAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value); + } + + public interface FabricsUsingCameraAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedVideoStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedAudioStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AllocatedSnapshotStreamsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface RankedVideoStreamPrioritiesListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface ViewportAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.CameraAvStreamManagementClusterViewportStruct value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readMaxConcurrentVideoEncodersAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID, true); + } + + public void subscribeMaxConcurrentVideoEncodersAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_CONCURRENT_VIDEO_ENCODERS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxEncodedPixelRateAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID, true); + } + + public void subscribeMaxEncodedPixelRateAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_ENCODED_PIXEL_RATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readVideoSensorParamsAttribute( + VideoSensorParamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID, true); + } + + public void subscribeVideoSensorParamsAttribute( + VideoSensorParamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIDEO_SENSOR_PARAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionCapableAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID, true); + } + + public void subscribeNightVisionCapableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_CAPABLE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMinViewportAttribute( + MinViewportAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEWPORT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEWPORT_ATTRIBUTE_ID, true); + } + + public void subscribeMinViewportAttribute( + MinViewportAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MIN_VIEWPORT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MIN_VIEWPORT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRateDistortionTradeOffPointsAttribute( + RateDistortionTradeOffPointsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID, true); + } + + public void subscribeRateDistortionTradeOffPointsAttribute( + RateDistortionTradeOffPointsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RATE_DISTORTION_TRADE_OFF_POINTS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxPreRollBufferSizeAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, true); + } + + public void subscribeMaxPreRollBufferSizeAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_PRE_ROLL_BUFFER_SIZE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneCapabilitiesAttribute( + MicrophoneCapabilitiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID, true); + } + + public void subscribeMicrophoneCapabilitiesAttribute( + MicrophoneCapabilitiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_CAPABILITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerCapabilitiesAttribute( + SpeakerCapabilitiesAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_CAPABILITIES_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_CAPABILITIES_ATTRIBUTE_ID, true); + } + + public void subscribeSpeakerCapabilitiesAttribute( + SpeakerCapabilitiesAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_CAPABILITIES_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_CAPABILITIES_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readTwoWayTalkSupportAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID, true); + } + + public void subscribeTwoWayTalkSupportAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, TWO_WAY_TALK_SUPPORT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSupportedSnapshotParamsAttribute( + SupportedSnapshotParamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID, true); + } + + public void subscribeSupportedSnapshotParamsAttribute( + SupportedSnapshotParamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SUPPORTED_SNAPSHOT_PARAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMaxNetworkBandwidthAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID, true); + } + + public void subscribeMaxNetworkBandwidthAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MAX_NETWORK_BANDWIDTH_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentFrameRateAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_FRAME_RATE_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_FRAME_RATE_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentFrameRateAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_FRAME_RATE_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_FRAME_RATE_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHDRModeEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_MODE_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_MODE_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeHDRModeEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeHDRModeEnabledAttribute(callback, value, 0); + } + + public void writeHDRModeEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), HDR_MODE_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeHDRModeEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HDR_MODE_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HDR_MODE_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentVideoCodecsAttribute( + CurrentVideoCodecsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentVideoCodecsAttribute( + CurrentVideoCodecsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_VIDEO_CODECS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readCurrentSnapshotConfigAttribute( + CurrentSnapshotConfigAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentSnapshotConfigAttribute( + CurrentSnapshotConfigAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SNAPSHOT_CONFIG_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFabricsUsingCameraAttribute( + FabricsUsingCameraAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRICS_USING_CAMERA_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FABRICS_USING_CAMERA_ATTRIBUTE_ID, true); + } + + public void subscribeFabricsUsingCameraAttribute( + FabricsUsingCameraAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FABRICS_USING_CAMERA_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FABRICS_USING_CAMERA_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedVideoStreamsAttribute( + AllocatedVideoStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedVideoStreamsAttribute( + AllocatedVideoStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_VIDEO_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedAudioStreamsAttribute( + AllocatedAudioStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedAudioStreamsAttribute( + AllocatedAudioStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_AUDIO_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAllocatedSnapshotStreamsAttribute( + AllocatedSnapshotStreamsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID, true); + } + + public void subscribeAllocatedSnapshotStreamsAttribute( + AllocatedSnapshotStreamsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ALLOCATED_SNAPSHOT_STREAMS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readRankedVideoStreamPrioritiesListAttribute( + RankedVideoStreamPrioritiesListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, true); + } + + public void writeRankedVideoStreamPrioritiesListAttribute(DefaultClusterCallback callback, ArrayList value) { + writeRankedVideoStreamPrioritiesListAttribute(callback, value, 0); + } + + public void writeRankedVideoStreamPrioritiesListAttribute(DefaultClusterCallback callback, ArrayList value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = ArrayType.generateArrayType(value, (elementvalue) -> new UIntType(elementvalue)); + writeAttribute(new WriteAttributesCallbackImpl(callback), RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeRankedVideoStreamPrioritiesListAttribute( + RankedVideoStreamPrioritiesListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, RANKED_VIDEO_STREAM_PRIORITIES_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSoftRecordingPrivacyModeEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeSoftRecordingPrivacyModeEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeSoftRecordingPrivacyModeEnabledAttribute(callback, value, 0); + } + + public void writeSoftRecordingPrivacyModeEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSoftRecordingPrivacyModeEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_RECORDING_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSoftLivestreamPrivacyModeEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeSoftLivestreamPrivacyModeEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeSoftLivestreamPrivacyModeEnabledAttribute(callback, value, 0); + } + + public void writeSoftLivestreamPrivacyModeEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSoftLivestreamPrivacyModeEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SOFT_LIVESTREAM_PRIVACY_MODE_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readHardPrivacyModeOnAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARD_PRIVACY_MODE_ON_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HARD_PRIVACY_MODE_ON_ATTRIBUTE_ID, true); + } + + public void subscribeHardPrivacyModeOnAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARD_PRIVACY_MODE_ON_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, HARD_PRIVACY_MODE_ON_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ATTRIBUTE_ID, true); + } + + public void writeNightVisionAttribute(DefaultClusterCallback callback, Integer value) { + writeNightVisionAttribute(callback, value, 0); + } + + public void writeNightVisionAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), NIGHT_VISION_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNightVisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNightVisionIllumAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ILLUM_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ILLUM_ATTRIBUTE_ID, true); + } + + public void writeNightVisionIllumAttribute(DefaultClusterCallback callback, Integer value) { + writeNightVisionIllumAttribute(callback, value, 0); + } + + public void writeNightVisionIllumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), NIGHT_VISION_ILLUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNightVisionIllumAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NIGHT_VISION_ILLUM_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NIGHT_VISION_ILLUM_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAWBEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AWB_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AWB_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeAWBEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeAWBEnabledAttribute(callback, value, 0); + } + + public void writeAWBEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AWB_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAWBEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AWB_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AWB_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAutoShutterSpeedEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeAutoShutterSpeedEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeAutoShutterSpeedEnabledAttribute(callback, value, 0); + } + + public void writeAutoShutterSpeedEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAutoShutterSpeedEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AUTO_SHUTTER_SPEED_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAutoISOEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AUTO_ISO_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AUTO_ISO_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeAutoISOEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeAutoISOEnabledAttribute(callback, value, 0); + } + + public void writeAutoISOEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), AUTO_ISO_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeAutoISOEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AUTO_ISO_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, AUTO_ISO_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readViewportAttribute( + ViewportAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIEWPORT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterViewportStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIEWPORT_ATTRIBUTE_ID, true); + } + + public void subscribeViewportAttribute( + ViewportAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VIEWPORT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.CameraAvStreamManagementClusterViewportStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, VIEWPORT_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerMutedAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MUTED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MUTED_ATTRIBUTE_ID, true); + } + + public void writeSpeakerMutedAttribute(DefaultClusterCallback callback, Boolean value) { + writeSpeakerMutedAttribute(callback, value, 0); + } + + public void writeSpeakerMutedAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_MUTED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerMutedAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MUTED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MUTED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerVolumeLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerVolumeLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerVolumeLevelAttribute(callback, value, 0); + } + + public void writeSpeakerVolumeLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerVolumeLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_VOLUME_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerMaxLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerMaxLevelAttribute(callback, value, 0); + } + + public void writeSpeakerMaxLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MAX_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readSpeakerMinLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeSpeakerMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeSpeakerMinLevelAttribute(callback, value, 0); + } + + public void writeSpeakerMinLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeSpeakerMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, SPEAKER_MIN_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneMutedAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MUTED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MUTED_ATTRIBUTE_ID, true); + } + + public void writeMicrophoneMutedAttribute(DefaultClusterCallback callback, Boolean value) { + writeMicrophoneMutedAttribute(callback, value, 0); + } + + public void writeMicrophoneMutedAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MICROPHONE_MUTED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicrophoneMutedAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MUTED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MUTED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneVolumeLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicrophoneVolumeLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicrophoneVolumeLevelAttribute(callback, value, 0); + } + + public void writeMicrophoneVolumeLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicrophoneVolumeLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_VOLUME_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneMaxLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicrophoneMaxLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicrophoneMaxLevelAttribute(callback, value, 0); + } + + public void writeMicrophoneMaxLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicrophoneMaxLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MAX_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneMinLevelAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID, true); + } + + public void writeMicrophoneMinLevelAttribute(DefaultClusterCallback callback, Integer value) { + writeMicrophoneMinLevelAttribute(callback, value, 0); + } + + public void writeMicrophoneMinLevelAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicrophoneMinLevelAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_MIN_LEVEL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readMicrophoneAGCEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeMicrophoneAGCEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeMicrophoneAGCEnabledAttribute(callback, value, 0); + } + + public void writeMicrophoneAGCEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeMicrophoneAGCEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, MICROPHONE_AGC_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageRotationAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_ROTATION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_ROTATION_ATTRIBUTE_ID, true); + } + + public void subscribeImageRotationAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_ROTATION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_ROTATION_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageFlipHorizontalAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID, true); + } + + public void subscribeImageFlipHorizontalAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_HORIZONTAL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readImageFlipVerticalAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID, true); + } + + public void subscribeImageFlipVerticalAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, IMAGE_FLIP_VERTICAL_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readLocalVideoRecordingEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeLocalVideoRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeLocalVideoRecordingEnabledAttribute(callback, value, 0); + } + + public void writeLocalVideoRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeLocalVideoRecordingEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_VIDEO_RECORDING_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readLocalSnapshotRecordingEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeLocalSnapshotRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeLocalSnapshotRecordingEnabledAttribute(callback, value, 0); + } + + public void writeLocalSnapshotRecordingEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeLocalSnapshotRecordingEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, LOCAL_SNAPSHOT_RECORDING_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStatusLightEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_ENABLED_ATTRIBUTE_ID, true); + } + + public void writeStatusLightEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeStatusLightEnabledAttribute(callback, value, 0); + } + + public void writeStatusLightEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), STATUS_LIGHT_ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeStatusLightEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readStatusLightBrightnessAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, true); + } + + public void writeStatusLightBrightnessAttribute(DefaultClusterCallback callback, Integer value) { + writeStatusLightBrightnessAttribute(callback, value, 0); + } + + public void writeStatusLightBrightnessAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeStatusLightBrightnessAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, STATUS_LIGHT_BRIGHTNESS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readDepthSensorStatusAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, true); + } + + public void writeDepthSensorStatusAttribute(DefaultClusterCallback callback, Integer value) { + writeDepthSensorStatusAttribute(callback, value, 0); + } + + public void writeDepthSensorStatusAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeDepthSensorStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEPTH_SENSOR_STATUS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + + public static class WebRTCTransportProviderCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1363L; + + private static final long CURRENT_SESSIONS_ATTRIBUTE_ID = 0L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public WebRTCTransportProviderCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void solicitOffer(SolicitOfferResponseCallback callback, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions) { + solicitOffer(callback, streamType, videoStreamID, audioStreamID, ICEServers, ICETransportPolicy, metadataOptions, 0); + } + + public void solicitOffer(SolicitOfferResponseCallback callback, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long streamTypeFieldID = 0L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long videoStreamIDFieldID = 1L; + BaseTLVType videoStreamIDtlvValue = videoStreamID != null ? videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long audioStreamIDFieldID = 2L; + BaseTLVType audioStreamIDtlvValue = audioStreamID != null ? audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); + + final long ICEServersFieldID = 3L; + BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); + + final long ICETransportPolicyFieldID = 4L; + BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); + elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); + + final long metadataOptionsFieldID = 5L; + BaseTLVType metadataOptionstlvValue = metadataOptions.map((nonOptionalmetadataOptions) -> new UIntType(nonOptionalmetadataOptions)).orElse(new EmptyType()); + elements.add(new StructElement(metadataOptionsFieldID, metadataOptionstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long webRTCSessionIDFieldID = 0L; + Integer webRTCSessionID = null; + final long deferredOfferFieldID = 1L; + Boolean deferredOffer = null; + final long videoStreamIDFieldID = 2L; + @Nullable Optional videoStreamID = null; + final long audioStreamIDFieldID = 3L; + @Nullable Optional audioStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == webRTCSessionIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + webRTCSessionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == deferredOfferFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + deferredOffer = castingValue.value(Boolean.class); + } + } else if (element.contextTagNum() == videoStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == audioStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = Optional.of(castingValue.value(Integer.class)); + } + } + } + callback.onSuccess(webRTCSessionID, deferredOffer, videoStreamID, audioStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void provideOffer(ProvideOfferResponseCallback callback, @Nullable Integer webRTCSessionID, String sdp, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions) { + provideOffer(callback, webRTCSessionID, sdp, streamType, videoStreamID, audioStreamID, ICEServers, ICETransportPolicy, metadataOptions, 0); + } + + public void provideOffer(ProvideOfferResponseCallback callback, @Nullable Integer webRTCSessionID, String sdp, Integer streamType, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID, Optional> ICEServers, Optional ICETransportPolicy, Optional metadataOptions, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = webRTCSessionID != null ? new UIntType(webRTCSessionID) : new NullType(); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + final long streamTypeFieldID = 2L; + BaseTLVType streamTypetlvValue = new UIntType(streamType); + elements.add(new StructElement(streamTypeFieldID, streamTypetlvValue)); + + final long videoStreamIDFieldID = 3L; + BaseTLVType videoStreamIDtlvValue = videoStreamID != null ? videoStreamID.map((nonOptionalvideoStreamID) -> new UIntType(nonOptionalvideoStreamID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(videoStreamIDFieldID, videoStreamIDtlvValue)); + + final long audioStreamIDFieldID = 4L; + BaseTLVType audioStreamIDtlvValue = audioStreamID != null ? audioStreamID.map((nonOptionalaudioStreamID) -> new UIntType(nonOptionalaudioStreamID)).orElse(new EmptyType()) : new NullType(); + elements.add(new StructElement(audioStreamIDFieldID, audioStreamIDtlvValue)); + + final long ICEServersFieldID = 5L; + BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); + + final long ICETransportPolicyFieldID = 6L; + BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); + elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); + + final long metadataOptionsFieldID = 7L; + BaseTLVType metadataOptionstlvValue = metadataOptions.map((nonOptionalmetadataOptions) -> new UIntType(nonOptionalmetadataOptions)).orElse(new EmptyType()); + elements.add(new StructElement(metadataOptionsFieldID, metadataOptionstlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long webRTCSessionIDFieldID = 0L; + Integer webRTCSessionID = null; + final long videoStreamIDFieldID = 1L; + Integer videoStreamID = null; + final long audioStreamIDFieldID = 2L; + Integer audioStreamID = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == webRTCSessionIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + webRTCSessionID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == videoStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == audioStreamIDFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(webRTCSessionID, videoStreamID, audioStreamID); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void provideAnswer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp) { + provideAnswer(callback, webRTCSessionID, sdp, 0); + } + + public void provideAnswer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, int timedInvokeTimeoutMs) { + final long commandId = 5L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { + provideICECandidate(callback, webRTCSessionID, ICECandidate, 0); + } + + public void provideICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { + final long commandId = 6L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long ICECandidateFieldID = 1L; + BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate); + elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void endSession(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason) { + endSession(callback, webRTCSessionID, reason, 0); + } + + public void endSession(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason, int timedInvokeTimeoutMs) { + final long commandId = 7L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long reasonFieldID = 1L; + BaseTLVType reasontlvValue = new UIntType(reason); + elements.add(new StructElement(reasonFieldID, reasontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface SolicitOfferResponseCallback extends BaseClusterCallback { + void onSuccess(Integer webRTCSessionID, Boolean deferredOffer, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID); + } + + public interface ProvideOfferResponseCallback extends BaseClusterCallback { + void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID); + } + + public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SESSIONS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SESSIONS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + + public static class WebRTCTransportRequestorCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1364L; + + private static final long CURRENT_SESSIONS_ATTRIBUTE_ID = 0L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public WebRTCTransportRequestorCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void offer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, Optional> ICEServers, Optional ICETransportPolicy) { + offer(callback, webRTCSessionID, sdp, ICEServers, ICETransportPolicy, 0); + } + + public void offer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, Optional> ICEServers, Optional ICETransportPolicy, int timedInvokeTimeoutMs) { + final long commandId = 1L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + final long ICEServersFieldID = 2L; + BaseTLVType ICEServerstlvValue = ICEServers.map((nonOptionalICEServers) -> ArrayType.generateArrayType(nonOptionalICEServers, (elementnonOptionalICEServers) -> elementnonOptionalICEServers.encodeTlv())).orElse(new EmptyType()); + elements.add(new StructElement(ICEServersFieldID, ICEServerstlvValue)); + + final long ICETransportPolicyFieldID = 3L; + BaseTLVType ICETransportPolicytlvValue = ICETransportPolicy.map((nonOptionalICETransportPolicy) -> new StringType(nonOptionalICETransportPolicy)).orElse(new EmptyType()); + elements.add(new StructElement(ICETransportPolicyFieldID, ICETransportPolicytlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void answer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp) { + answer(callback, webRTCSessionID, sdp, 0); + } + + public void answer(DefaultClusterCallback callback, Integer webRTCSessionID, String sdp, int timedInvokeTimeoutMs) { + final long commandId = 2L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long sdpFieldID = 1L; + BaseTLVType sdptlvValue = new StringType(sdp); + elements.add(new StructElement(sdpFieldID, sdptlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate) { + ICECandidate(callback, webRTCSessionID, ICECandidate, 0); + } + + public void ICECandidate(DefaultClusterCallback callback, Integer webRTCSessionID, String ICECandidate, int timedInvokeTimeoutMs) { + final long commandId = 3L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long ICECandidateFieldID = 1L; + BaseTLVType ICECandidatetlvValue = new StringType(ICECandidate); + elements.add(new StructElement(ICECandidateFieldID, ICECandidatetlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public void end(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason) { + end(callback, webRTCSessionID, reason, 0); + } + + public void end(DefaultClusterCallback callback, Integer webRTCSessionID, Integer reason, int timedInvokeTimeoutMs) { + final long commandId = 4L; + + ArrayList elements = new ArrayList<>(); + final long webRTCSessionIDFieldID = 0L; + BaseTLVType webRTCSessionIDtlvValue = new UIntType(webRTCSessionID); + elements.add(new StructElement(webRTCSessionIDFieldID, webRTCSessionIDtlvValue)); + + final long reasonFieldID = 1L; + BaseTLVType reasontlvValue = new UIntType(reason); + elements.add(new StructElement(reasonFieldID, reasontlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface CurrentSessionsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CURRENT_SESSIONS_ATTRIBUTE_ID, true); + } + + public void subscribeCurrentSessionsAttribute( + CurrentSessionsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_SESSIONS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } }, CURRENT_SESSIONS_ATTRIBUTE_ID, minInterval, maxInterval); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 737462f3da..59892d0518 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6187,6 +6187,596 @@ public String toString() { return output.toString(); } } +public static class ZoneManagementClusterZoneTriggeredEvent { + public ArrayList zones; + public Integer reason; + private static final long ZONES_ID = 0L; + private static final long REASON_ID = 1L; + + public ZoneManagementClusterZoneTriggeredEvent( + ArrayList zones, + Integer reason + ) { + this.zones = zones; + this.reason = reason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones)))); + values.add(new StructElement(REASON_ID, new UIntType(reason))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneTriggeredEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList zones = null; + Integer reason = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + reason = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneTriggeredEvent( + zones, + reason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneTriggeredEvent {\n"); + output.append("\tzones: "); + output.append(zones); + output.append("\n"); + output.append("\treason: "); + output.append(reason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneStoppedEvent { + public ArrayList zones; + public Integer reason; + private static final long ZONES_ID = 0L; + private static final long REASON_ID = 1L; + + public ZoneManagementClusterZoneStoppedEvent( + ArrayList zones, + Integer reason + ) { + this.zones = zones; + this.reason = reason; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONES_ID, ArrayType.generateArrayType(zones, (elementzones) -> new UIntType(elementzones)))); + values.add(new StructElement(REASON_ID, new UIntType(reason))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneStoppedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList zones = null; + Integer reason = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + zones = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == REASON_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + reason = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneStoppedEvent( + zones, + reason + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneStoppedEvent {\n"); + output.append("\tzones: "); + output.append(zones); + output.append("\n"); + output.append("\treason: "); + output.append(reason); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoStreamChangedEvent { + public Integer videoStreamID; + public Optional streamType; + public Optional videoCodec; + public Optional minFrameRate; + public Optional maxFrameRate; + public Optional minResolution; + public Optional maxResolution; + public Optional minBitRate; + public Optional maxBitRate; + public Optional minFragmentLen; + public Optional maxFragmentLen; + private static final long VIDEO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long VIDEO_CODEC_ID = 2L; + private static final long MIN_FRAME_RATE_ID = 3L; + private static final long MAX_FRAME_RATE_ID = 4L; + private static final long MIN_RESOLUTION_ID = 5L; + private static final long MAX_RESOLUTION_ID = 6L; + private static final long MIN_BIT_RATE_ID = 7L; + private static final long MAX_BIT_RATE_ID = 8L; + private static final long MIN_FRAGMENT_LEN_ID = 9L; + private static final long MAX_FRAGMENT_LEN_ID = 10L; + + public CameraAvStreamManagementClusterVideoStreamChangedEvent( + Integer videoStreamID, + Optional streamType, + Optional videoCodec, + Optional minFrameRate, + Optional maxFrameRate, + Optional minResolution, + Optional maxResolution, + Optional minBitRate, + Optional maxBitRate, + Optional minFragmentLen, + Optional maxFragmentLen + ) { + this.videoStreamID = videoStreamID; + this.streamType = streamType; + this.videoCodec = videoCodec; + this.minFrameRate = minFrameRate; + this.maxFrameRate = maxFrameRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.minBitRate = minBitRate; + this.maxBitRate = maxBitRate; + this.minFragmentLen = minFragmentLen; + this.maxFragmentLen = maxFragmentLen; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(VIDEO_STREAM_ID_ID, new UIntType(videoStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, streamType.map((nonOptionalstreamType) -> new UIntType(nonOptionalstreamType)).orElse(new EmptyType()))); + values.add(new StructElement(VIDEO_CODEC_ID, videoCodec.map((nonOptionalvideoCodec) -> new UIntType(nonOptionalvideoCodec)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_FRAME_RATE_ID, minFrameRate.map((nonOptionalminFrameRate) -> new UIntType(nonOptionalminFrameRate)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_FRAME_RATE_ID, maxFrameRate.map((nonOptionalmaxFrameRate) -> new UIntType(nonOptionalmaxFrameRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.map((nonOptionalminResolution) -> nonOptionalminResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.map((nonOptionalmaxResolution) -> nonOptionalmaxResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MIN_BIT_RATE_ID, minBitRate.map((nonOptionalminBitRate) -> new UIntType(nonOptionalminBitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_BIT_RATE_ID, maxBitRate.map((nonOptionalmaxBitRate) -> new UIntType(nonOptionalmaxBitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_FRAGMENT_LEN_ID, minFragmentLen.map((nonOptionalminFragmentLen) -> new UIntType(nonOptionalminFragmentLen)).orElse(new EmptyType()))); + values.add(new StructElement(MAX_FRAGMENT_LEN_ID, maxFragmentLen.map((nonOptionalmaxFragmentLen) -> new UIntType(nonOptionalmaxFragmentLen)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer videoStreamID = null; + Optional streamType = Optional.empty(); + Optional videoCodec = Optional.empty(); + Optional minFrameRate = Optional.empty(); + Optional maxFrameRate = Optional.empty(); + Optional minResolution = Optional.empty(); + Optional maxResolution = Optional.empty(); + Optional minBitRate = Optional.empty(); + Optional maxBitRate = Optional.empty(); + Optional minFragmentLen = Optional.empty(); + Optional maxFragmentLen = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == VIDEO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MIN_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFrameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == MAX_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxBitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == MIN_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFragmentLen = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == MAX_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFragmentLen = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoCodec: "); + output.append(videoCodec); + output.append("\n"); + output.append("\tminFrameRate: "); + output.append(minFrameRate); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("\tmaxBitRate: "); + output.append(maxBitRate); + output.append("\n"); + output.append("\tminFragmentLen: "); + output.append(minFragmentLen); + output.append("\n"); + output.append("\tmaxFragmentLen: "); + output.append(maxFragmentLen); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioStreamChangedEvent { + public Integer audioStreamID; + public Optional streamType; + public Optional audioCodec; + public Optional channelCount; + public Optional sampleRate; + public Optional bitRate; + public Optional bitDepth; + private static final long AUDIO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long AUDIO_CODEC_ID = 2L; + private static final long CHANNEL_COUNT_ID = 3L; + private static final long SAMPLE_RATE_ID = 4L; + private static final long BIT_RATE_ID = 5L; + private static final long BIT_DEPTH_ID = 6L; + + public CameraAvStreamManagementClusterAudioStreamChangedEvent( + Integer audioStreamID, + Optional streamType, + Optional audioCodec, + Optional channelCount, + Optional sampleRate, + Optional bitRate, + Optional bitDepth + ) { + this.audioStreamID = audioStreamID; + this.streamType = streamType; + this.audioCodec = audioCodec; + this.channelCount = channelCount; + this.sampleRate = sampleRate; + this.bitRate = bitRate; + this.bitDepth = bitDepth; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(AUDIO_STREAM_ID_ID, new UIntType(audioStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, streamType.map((nonOptionalstreamType) -> new UIntType(nonOptionalstreamType)).orElse(new EmptyType()))); + values.add(new StructElement(AUDIO_CODEC_ID, audioCodec.map((nonOptionalaudioCodec) -> new UIntType(nonOptionalaudioCodec)).orElse(new EmptyType()))); + values.add(new StructElement(CHANNEL_COUNT_ID, channelCount.map((nonOptionalchannelCount) -> new UIntType(nonOptionalchannelCount)).orElse(new EmptyType()))); + values.add(new StructElement(SAMPLE_RATE_ID, sampleRate.map((nonOptionalsampleRate) -> new UIntType(nonOptionalsampleRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_RATE_ID, bitRate.map((nonOptionalbitRate) -> new UIntType(nonOptionalbitRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_DEPTH_ID, bitDepth.map((nonOptionalbitDepth) -> new UIntType(nonOptionalbitDepth)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer audioStreamID = null; + Optional streamType = Optional.empty(); + Optional audioCodec = Optional.empty(); + Optional channelCount = Optional.empty(); + Optional sampleRate = Optional.empty(); + Optional bitRate = Optional.empty(); + Optional bitDepth = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == AUDIO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == CHANNEL_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + channelCount = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == SAMPLE_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sampleRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == BIT_DEPTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitDepth = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\taudioCodec: "); + output.append(audioCodec); + output.append("\n"); + output.append("\tchannelCount: "); + output.append(channelCount); + output.append("\n"); + output.append("\tsampleRate: "); + output.append(sampleRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tbitDepth: "); + output.append(bitDepth); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + public Integer snapshotStreamID; + public Optional imageCodec; + public Optional frameRate; + public Optional bitRate; + public Optional minResolution; + public Optional maxResolution; + public Optional quality; + private static final long SNAPSHOT_STREAM_ID_ID = 0L; + private static final long IMAGE_CODEC_ID = 1L; + private static final long FRAME_RATE_ID = 2L; + private static final long BIT_RATE_ID = 3L; + private static final long MIN_RESOLUTION_ID = 4L; + private static final long MAX_RESOLUTION_ID = 5L; + private static final long QUALITY_ID = 6L; + + public CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + Integer snapshotStreamID, + Optional imageCodec, + Optional frameRate, + Optional bitRate, + Optional minResolution, + Optional maxResolution, + Optional quality + ) { + this.snapshotStreamID = snapshotStreamID; + this.imageCodec = imageCodec; + this.frameRate = frameRate; + this.bitRate = bitRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.quality = quality; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SNAPSHOT_STREAM_ID_ID, new UIntType(snapshotStreamID))); + values.add(new StructElement(IMAGE_CODEC_ID, imageCodec.map((nonOptionalimageCodec) -> new UIntType(nonOptionalimageCodec)).orElse(new EmptyType()))); + values.add(new StructElement(FRAME_RATE_ID, frameRate.map((nonOptionalframeRate) -> new UIntType(nonOptionalframeRate)).orElse(new EmptyType()))); + values.add(new StructElement(BIT_RATE_ID, bitRate.map((nonOptionalbitRate) -> new UIntType(nonOptionalbitRate)).orElse(new EmptyType()))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.map((nonOptionalminResolution) -> nonOptionalminResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.map((nonOptionalmaxResolution) -> nonOptionalmaxResolution.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(QUALITY_ID, quality.map((nonOptionalquality) -> new UIntType(nonOptionalquality)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotStreamChangedEvent decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer snapshotStreamID = null; + Optional imageCodec = Optional.empty(); + Optional frameRate = Optional.empty(); + Optional bitRate = Optional.empty(); + Optional minResolution = Optional.empty(); + Optional maxResolution = Optional.empty(); + Optional quality = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SNAPSHOT_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + frameRate = Optional.of(castingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = Optional.of(castingValue.value(Long.class)); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = Optional.of(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == QUALITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + quality = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n"); + output.append("\tsnapshotStreamID: "); + output.append(snapshotStreamID); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("\tframeRate: "); + output.append(frameRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tquality: "); + output.append(quality); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class CommissionerControlClusterCommissioningRequestResultEvent { public Long requestID; public Long clientNodeID; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 4c04d0ec0e..b3fcd6df3b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12724,6 +12724,1369 @@ public String toString() { return output.toString(); } } +public static class ZoneManagementClusterTwoDCartesianVertexStruct { + public Integer x; + public Integer y; + private static final long X_ID = 0L; + private static final long Y_ID = 1L; + + public ZoneManagementClusterTwoDCartesianVertexStruct( + Integer x, + Integer y + ) { + this.x = x; + this.y = y; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(X_ID, new UIntType(x))); + values.add(new StructElement(Y_ID, new UIntType(y))); + + return new StructType(values); + } + + public static ZoneManagementClusterTwoDCartesianVertexStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer x = null; + Integer y = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == X_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterTwoDCartesianVertexStruct( + x, + y + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterTwoDCartesianVertexStruct {\n"); + output.append("\tx: "); + output.append(x); + output.append("\n"); + output.append("\ty: "); + output.append(y); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterTwoDCartesianZoneStruct { + public String name; + public Integer use; + public ArrayList vertices; + public Optional color; + private static final long NAME_ID = 0L; + private static final long USE_ID = 1L; + private static final long VERTICES_ID = 2L; + private static final long COLOR_ID = 3L; + + public ZoneManagementClusterTwoDCartesianZoneStruct( + String name, + Integer use, + ArrayList vertices, + Optional color + ) { + this.name = name; + this.use = use; + this.vertices = vertices; + this.color = color; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(USE_ID, new UIntType(use))); + values.add(new StructElement(VERTICES_ID, ArrayType.generateArrayType(vertices, (elementvertices) -> elementvertices.encodeTlv()))); + values.add(new StructElement(COLOR_ID, color.map((nonOptionalcolor) -> new StringType(nonOptionalcolor)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static ZoneManagementClusterTwoDCartesianZoneStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String name = null; + Integer use = null; + ArrayList vertices = null; + Optional color = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } else if (element.contextTagNum() == USE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + use = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VERTICES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + vertices = castingValue.map((elementcastingValue) -> ChipStructs.ZoneManagementClusterTwoDCartesianVertexStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == COLOR_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + color = Optional.of(castingValue.value(String.class)); + } + } + } + return new ZoneManagementClusterTwoDCartesianZoneStruct( + name, + use, + vertices, + color + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterTwoDCartesianZoneStruct {\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tuse: "); + output.append(use); + output.append("\n"); + output.append("\tvertices: "); + output.append(vertices); + output.append("\n"); + output.append("\tcolor: "); + output.append(color); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneInformationStruct { + public Integer zoneID; + public Integer zoneType; + public Integer zoneSource; + private static final long ZONE_ID_ID = 0L; + private static final long ZONE_TYPE_ID = 1L; + private static final long ZONE_SOURCE_ID = 2L; + + public ZoneManagementClusterZoneInformationStruct( + Integer zoneID, + Integer zoneType, + Integer zoneSource + ) { + this.zoneID = zoneID; + this.zoneType = zoneType; + this.zoneSource = zoneSource; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ZONE_ID_ID, new UIntType(zoneID))); + values.add(new StructElement(ZONE_TYPE_ID, new UIntType(zoneType))); + values.add(new StructElement(ZONE_SOURCE_ID, new UIntType(zoneSource))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneInformationStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer zoneID = null; + Integer zoneType = null; + Integer zoneSource = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ZONE_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ZONE_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == ZONE_SOURCE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + zoneSource = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneInformationStruct( + zoneID, + zoneType, + zoneSource + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneInformationStruct {\n"); + output.append("\tzoneID: "); + output.append(zoneID); + output.append("\n"); + output.append("\tzoneType: "); + output.append(zoneType); + output.append("\n"); + output.append("\tzoneSource: "); + output.append(zoneSource); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class ZoneManagementClusterZoneTriggeringTimeControlStruct { + public Integer initialDuration; + public Integer augmentationDuration; + public Long maxDuration; + public Integer blindDuration; + private static final long INITIAL_DURATION_ID = 0L; + private static final long AUGMENTATION_DURATION_ID = 1L; + private static final long MAX_DURATION_ID = 2L; + private static final long BLIND_DURATION_ID = 3L; + + public ZoneManagementClusterZoneTriggeringTimeControlStruct( + Integer initialDuration, + Integer augmentationDuration, + Long maxDuration, + Integer blindDuration + ) { + this.initialDuration = initialDuration; + this.augmentationDuration = augmentationDuration; + this.maxDuration = maxDuration; + this.blindDuration = blindDuration; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(INITIAL_DURATION_ID, new UIntType(initialDuration))); + values.add(new StructElement(AUGMENTATION_DURATION_ID, new UIntType(augmentationDuration))); + values.add(new StructElement(MAX_DURATION_ID, new UIntType(maxDuration))); + values.add(new StructElement(BLIND_DURATION_ID, new UIntType(blindDuration))); + + return new StructType(values); + } + + public static ZoneManagementClusterZoneTriggeringTimeControlStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer initialDuration = null; + Integer augmentationDuration = null; + Long maxDuration = null; + Integer blindDuration = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == INITIAL_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + initialDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUGMENTATION_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + augmentationDuration = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxDuration = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BLIND_DURATION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + blindDuration = castingValue.value(Integer.class); + } + } + } + return new ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n"); + output.append("\tinitialDuration: "); + output.append(initialDuration); + output.append("\n"); + output.append("\taugmentationDuration: "); + output.append(augmentationDuration); + output.append("\n"); + output.append("\tmaxDuration: "); + output.append(maxDuration); + output.append("\n"); + output.append("\tblindDuration: "); + output.append(blindDuration); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoResolutionStruct { + public Integer width; + public Integer height; + private static final long WIDTH_ID = 0L; + private static final long HEIGHT_ID = 1L; + + public CameraAvStreamManagementClusterVideoResolutionStruct( + Integer width, + Integer height + ) { + this.width = width; + this.height = height; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(WIDTH_ID, new UIntType(width))); + values.add(new StructElement(HEIGHT_ID, new UIntType(height))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoResolutionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer width = null; + Integer height = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == WIDTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + width = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == HEIGHT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + height = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoResolutionStruct( + width, + height + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoResolutionStruct {\n"); + output.append("\twidth: "); + output.append(width); + output.append("\n"); + output.append("\theight: "); + output.append(height); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoStreamStruct { + public Integer videoStreamID; + public Integer streamType; + public Integer videoCodec; + public Integer minFrameRate; + public Integer maxFrameRate; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution; + public Long minBitRate; + public Long maxBitRate; + public Integer minFragmentLen; + public Integer maxFragmentLen; + public Optional watermarkEnabled; + public Optional OSDEnabled; + public Integer referenceCount; + private static final long VIDEO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long VIDEO_CODEC_ID = 2L; + private static final long MIN_FRAME_RATE_ID = 3L; + private static final long MAX_FRAME_RATE_ID = 4L; + private static final long MIN_RESOLUTION_ID = 5L; + private static final long MAX_RESOLUTION_ID = 6L; + private static final long MIN_BIT_RATE_ID = 7L; + private static final long MAX_BIT_RATE_ID = 8L; + private static final long MIN_FRAGMENT_LEN_ID = 9L; + private static final long MAX_FRAGMENT_LEN_ID = 10L; + private static final long WATERMARK_ENABLED_ID = 11L; + private static final long OSD_ENABLED_ID = 12L; + private static final long REFERENCE_COUNT_ID = 13L; + + public CameraAvStreamManagementClusterVideoStreamStruct( + Integer videoStreamID, + Integer streamType, + Integer videoCodec, + Integer minFrameRate, + Integer maxFrameRate, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, + Long minBitRate, + Long maxBitRate, + Integer minFragmentLen, + Integer maxFragmentLen, + Optional watermarkEnabled, + Optional OSDEnabled, + Integer referenceCount + ) { + this.videoStreamID = videoStreamID; + this.streamType = streamType; + this.videoCodec = videoCodec; + this.minFrameRate = minFrameRate; + this.maxFrameRate = maxFrameRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.minBitRate = minBitRate; + this.maxBitRate = maxBitRate; + this.minFragmentLen = minFragmentLen; + this.maxFragmentLen = maxFragmentLen; + this.watermarkEnabled = watermarkEnabled; + this.OSDEnabled = OSDEnabled; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(VIDEO_STREAM_ID_ID, new UIntType(videoStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(VIDEO_CODEC_ID, new UIntType(videoCodec))); + values.add(new StructElement(MIN_FRAME_RATE_ID, new UIntType(minFrameRate))); + values.add(new StructElement(MAX_FRAME_RATE_ID, new UIntType(maxFrameRate))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.encodeTlv())); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.encodeTlv())); + values.add(new StructElement(MIN_BIT_RATE_ID, new UIntType(minBitRate))); + values.add(new StructElement(MAX_BIT_RATE_ID, new UIntType(maxBitRate))); + values.add(new StructElement(MIN_FRAGMENT_LEN_ID, new UIntType(minFragmentLen))); + values.add(new StructElement(MAX_FRAGMENT_LEN_ID, new UIntType(maxFragmentLen))); + values.add(new StructElement(WATERMARK_ENABLED_ID, watermarkEnabled.map((nonOptionalwatermarkEnabled) -> new BooleanType(nonOptionalwatermarkEnabled)).orElse(new EmptyType()))); + values.add(new StructElement(OSD_ENABLED_ID, OSDEnabled.map((nonOptionalOSDEnabled) -> new BooleanType(nonOptionalOSDEnabled)).orElse(new EmptyType()))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer videoStreamID = null; + Integer streamType = null; + Integer videoCodec = null; + Integer minFrameRate = null; + Integer maxFrameRate = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution = null; + Long minBitRate = null; + Long maxBitRate = null; + Integer minFragmentLen = null; + Integer maxFragmentLen = null; + Optional watermarkEnabled = Optional.empty(); + Optional OSDEnabled = Optional.empty(); + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VIDEO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MIN_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MAX_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxBitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MIN_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minFragmentLen = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_FRAGMENT_LEN_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFragmentLen = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == WATERMARK_ENABLED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + watermarkEnabled = Optional.of(castingValue.value(Boolean.class)); + } + } else if (element.contextTagNum() == OSD_ENABLED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + OSDEnabled = Optional.of(castingValue.value(Boolean.class)); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + watermarkEnabled, + OSDEnabled, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoStreamStruct {\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoCodec: "); + output.append(videoCodec); + output.append("\n"); + output.append("\tminFrameRate: "); + output.append(minFrameRate); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("\tmaxBitRate: "); + output.append(maxBitRate); + output.append("\n"); + output.append("\tminFragmentLen: "); + output.append(minFragmentLen); + output.append("\n"); + output.append("\tmaxFragmentLen: "); + output.append(maxFragmentLen); + output.append("\n"); + output.append("\twatermarkEnabled: "); + output.append(watermarkEnabled); + output.append("\n"); + output.append("\tOSDEnabled: "); + output.append(OSDEnabled); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotStreamStruct { + public Integer snapshotStreamID; + public Integer imageCodec; + public Integer frameRate; + public Long bitRate; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution; + public Integer quality; + public Integer referenceCount; + private static final long SNAPSHOT_STREAM_ID_ID = 0L; + private static final long IMAGE_CODEC_ID = 1L; + private static final long FRAME_RATE_ID = 2L; + private static final long BIT_RATE_ID = 3L; + private static final long MIN_RESOLUTION_ID = 4L; + private static final long MAX_RESOLUTION_ID = 5L; + private static final long QUALITY_ID = 6L; + private static final long REFERENCE_COUNT_ID = 7L; + + public CameraAvStreamManagementClusterSnapshotStreamStruct( + Integer snapshotStreamID, + Integer imageCodec, + Integer frameRate, + Long bitRate, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution, + Integer quality, + Integer referenceCount + ) { + this.snapshotStreamID = snapshotStreamID; + this.imageCodec = imageCodec; + this.frameRate = frameRate; + this.bitRate = bitRate; + this.minResolution = minResolution; + this.maxResolution = maxResolution; + this.quality = quality; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SNAPSHOT_STREAM_ID_ID, new UIntType(snapshotStreamID))); + values.add(new StructElement(IMAGE_CODEC_ID, new UIntType(imageCodec))); + values.add(new StructElement(FRAME_RATE_ID, new UIntType(frameRate))); + values.add(new StructElement(BIT_RATE_ID, new UIntType(bitRate))); + values.add(new StructElement(MIN_RESOLUTION_ID, minResolution.encodeTlv())); + values.add(new StructElement(MAX_RESOLUTION_ID, maxResolution.encodeTlv())); + values.add(new StructElement(QUALITY_ID, new UIntType(quality))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer snapshotStreamID = null; + Integer imageCodec = null; + Integer frameRate = null; + Long bitRate = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct minResolution = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct maxResolution = null; + Integer quality = null; + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SNAPSHOT_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + snapshotStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + frameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MIN_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + minResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + maxResolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == QUALITY_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + quality = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n"); + output.append("\tsnapshotStreamID: "); + output.append(snapshotStreamID); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("\tframeRate: "); + output.append(frameRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tminResolution: "); + output.append(minResolution); + output.append("\n"); + output.append("\tmaxResolution: "); + output.append(maxResolution); + output.append("\n"); + output.append("\tquality: "); + output.append(quality); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterSnapshotParamsStruct { + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution; + public Integer maxFrameRate; + public Integer imageCodec; + private static final long RESOLUTION_ID = 0L; + private static final long MAX_FRAME_RATE_ID = 1L; + private static final long IMAGE_CODEC_ID = 2L; + + public CameraAvStreamManagementClusterSnapshotParamsStruct( + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution, + Integer maxFrameRate, + Integer imageCodec + ) { + this.resolution = resolution; + this.maxFrameRate = maxFrameRate; + this.imageCodec = imageCodec; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(RESOLUTION_ID, resolution.encodeTlv())); + values.add(new StructElement(MAX_FRAME_RATE_ID, new UIntType(maxFrameRate))); + values.add(new StructElement(IMAGE_CODEC_ID, new UIntType(imageCodec))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterSnapshotParamsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution = null; + Integer maxFrameRate = null; + Integer imageCodec = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + resolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MAX_FRAME_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFrameRate = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == IMAGE_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + imageCodec = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n"); + output.append("\tresolution: "); + output.append(resolution); + output.append("\n"); + output.append("\tmaxFrameRate: "); + output.append(maxFrameRate); + output.append("\n"); + output.append("\timageCodec: "); + output.append(imageCodec); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + public Integer codec; + public ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution; + public Long minBitRate; + private static final long CODEC_ID = 0L; + private static final long RESOLUTION_ID = 1L; + private static final long MIN_BIT_RATE_ID = 2L; + + public CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + Integer codec, + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution, + Long minBitRate + ) { + this.codec = codec; + this.resolution = resolution; + this.minBitRate = minBitRate; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CODEC_ID, new UIntType(codec))); + values.add(new StructElement(RESOLUTION_ID, resolution.encodeTlv())); + values.add(new StructElement(MIN_BIT_RATE_ID, new UIntType(minBitRate))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer codec = null; + ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct resolution = null; + Long minBitRate = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + codec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == RESOLUTION_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + resolution = ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == MIN_BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + minBitRate = castingValue.value(Long.class); + } + } + } + return new CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n"); + output.append("\tcodec: "); + output.append(codec); + output.append("\n"); + output.append("\tresolution: "); + output.append(resolution); + output.append("\n"); + output.append("\tminBitRate: "); + output.append(minBitRate); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioCapabilitiesStruct { + public Integer maxNumberOfChannels; + public ArrayList supportedCodecs; + public ArrayList supportedSampleRates; + public ArrayList supportedBitDepths; + private static final long MAX_NUMBER_OF_CHANNELS_ID = 0L; + private static final long SUPPORTED_CODECS_ID = 1L; + private static final long SUPPORTED_SAMPLE_RATES_ID = 2L; + private static final long SUPPORTED_BIT_DEPTHS_ID = 3L; + + public CameraAvStreamManagementClusterAudioCapabilitiesStruct( + Integer maxNumberOfChannels, + ArrayList supportedCodecs, + ArrayList supportedSampleRates, + ArrayList supportedBitDepths + ) { + this.maxNumberOfChannels = maxNumberOfChannels; + this.supportedCodecs = supportedCodecs; + this.supportedSampleRates = supportedSampleRates; + this.supportedBitDepths = supportedBitDepths; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(MAX_NUMBER_OF_CHANNELS_ID, new UIntType(maxNumberOfChannels))); + values.add(new StructElement(SUPPORTED_CODECS_ID, ArrayType.generateArrayType(supportedCodecs, (elementsupportedCodecs) -> new UIntType(elementsupportedCodecs)))); + values.add(new StructElement(SUPPORTED_SAMPLE_RATES_ID, ArrayType.generateArrayType(supportedSampleRates, (elementsupportedSampleRates) -> new UIntType(elementsupportedSampleRates)))); + values.add(new StructElement(SUPPORTED_BIT_DEPTHS_ID, ArrayType.generateArrayType(supportedBitDepths, (elementsupportedBitDepths) -> new UIntType(elementsupportedBitDepths)))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioCapabilitiesStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer maxNumberOfChannels = null; + ArrayList supportedCodecs = null; + ArrayList supportedSampleRates = null; + ArrayList supportedBitDepths = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == MAX_NUMBER_OF_CHANNELS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxNumberOfChannels = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SUPPORTED_CODECS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedCodecs = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } else if (element.contextTagNum() == SUPPORTED_SAMPLE_RATES_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedSampleRates = castingValue.map((elementcastingValue) -> elementcastingValue.value(Long.class)); + } + } else if (element.contextTagNum() == SUPPORTED_BIT_DEPTHS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + supportedBitDepths = castingValue.map((elementcastingValue) -> elementcastingValue.value(Integer.class)); + } + } + } + return new CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n"); + output.append("\tmaxNumberOfChannels: "); + output.append(maxNumberOfChannels); + output.append("\n"); + output.append("\tsupportedCodecs: "); + output.append(supportedCodecs); + output.append("\n"); + output.append("\tsupportedSampleRates: "); + output.append(supportedSampleRates); + output.append("\n"); + output.append("\tsupportedBitDepths: "); + output.append(supportedBitDepths); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterAudioStreamStruct { + public Integer audioStreamID; + public Integer streamType; + public Integer audioCodec; + public Integer channelCount; + public Long sampleRate; + public Long bitRate; + public Integer bitDepth; + public Integer referenceCount; + private static final long AUDIO_STREAM_ID_ID = 0L; + private static final long STREAM_TYPE_ID = 1L; + private static final long AUDIO_CODEC_ID = 2L; + private static final long CHANNEL_COUNT_ID = 3L; + private static final long SAMPLE_RATE_ID = 4L; + private static final long BIT_RATE_ID = 5L; + private static final long BIT_DEPTH_ID = 6L; + private static final long REFERENCE_COUNT_ID = 7L; + + public CameraAvStreamManagementClusterAudioStreamStruct( + Integer audioStreamID, + Integer streamType, + Integer audioCodec, + Integer channelCount, + Long sampleRate, + Long bitRate, + Integer bitDepth, + Integer referenceCount + ) { + this.audioStreamID = audioStreamID; + this.streamType = streamType; + this.audioCodec = audioCodec; + this.channelCount = channelCount; + this.sampleRate = sampleRate; + this.bitRate = bitRate; + this.bitDepth = bitDepth; + this.referenceCount = referenceCount; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(AUDIO_STREAM_ID_ID, new UIntType(audioStreamID))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(AUDIO_CODEC_ID, new UIntType(audioCodec))); + values.add(new StructElement(CHANNEL_COUNT_ID, new UIntType(channelCount))); + values.add(new StructElement(SAMPLE_RATE_ID, new UIntType(sampleRate))); + values.add(new StructElement(BIT_RATE_ID, new UIntType(bitRate))); + values.add(new StructElement(BIT_DEPTH_ID, new UIntType(bitDepth))); + values.add(new StructElement(REFERENCE_COUNT_ID, new UIntType(referenceCount))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterAudioStreamStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer audioStreamID = null; + Integer streamType = null; + Integer audioCodec = null; + Integer channelCount = null; + Long sampleRate = null; + Long bitRate = null; + Integer bitDepth = null; + Integer referenceCount = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUDIO_CODEC_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioCodec = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == CHANNEL_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + channelCount = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SAMPLE_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sampleRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BIT_RATE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitRate = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == BIT_DEPTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + bitDepth = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == REFERENCE_COUNT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + referenceCount = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterAudioStreamStruct {\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\taudioCodec: "); + output.append(audioCodec); + output.append("\n"); + output.append("\tchannelCount: "); + output.append(channelCount); + output.append("\n"); + output.append("\tsampleRate: "); + output.append(sampleRate); + output.append("\n"); + output.append("\tbitRate: "); + output.append(bitRate); + output.append("\n"); + output.append("\tbitDepth: "); + output.append(bitDepth); + output.append("\n"); + output.append("\treferenceCount: "); + output.append(referenceCount); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterVideoSensorParamsStruct { + public Integer sensorWidth; + public Integer sensorHeight; + public Boolean HDRCapable; + public Integer maxFPS; + public Integer maxHDRFPS; + private static final long SENSOR_WIDTH_ID = 0L; + private static final long SENSOR_HEIGHT_ID = 1L; + private static final long HDR_CAPABLE_ID = 2L; + private static final long MAX_FPS_ID = 3L; + private static final long MAX_HDRFPS_ID = 4L; + + public CameraAvStreamManagementClusterVideoSensorParamsStruct( + Integer sensorWidth, + Integer sensorHeight, + Boolean HDRCapable, + Integer maxFPS, + Integer maxHDRFPS + ) { + this.sensorWidth = sensorWidth; + this.sensorHeight = sensorHeight; + this.HDRCapable = HDRCapable; + this.maxFPS = maxFPS; + this.maxHDRFPS = maxHDRFPS; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(SENSOR_WIDTH_ID, new UIntType(sensorWidth))); + values.add(new StructElement(SENSOR_HEIGHT_ID, new UIntType(sensorHeight))); + values.add(new StructElement(HDR_CAPABLE_ID, new BooleanType(HDRCapable))); + values.add(new StructElement(MAX_FPS_ID, new UIntType(maxFPS))); + values.add(new StructElement(MAX_HDRFPS_ID, new UIntType(maxHDRFPS))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterVideoSensorParamsStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer sensorWidth = null; + Integer sensorHeight = null; + Boolean HDRCapable = null; + Integer maxFPS = null; + Integer maxHDRFPS = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == SENSOR_WIDTH_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensorWidth = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == SENSOR_HEIGHT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + sensorHeight = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == HDR_CAPABLE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + HDRCapable = castingValue.value(Boolean.class); + } + } else if (element.contextTagNum() == MAX_FPS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxFPS = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == MAX_HDRFPS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + maxHDRFPS = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n"); + output.append("\tsensorWidth: "); + output.append(sensorWidth); + output.append("\n"); + output.append("\tsensorHeight: "); + output.append(sensorHeight); + output.append("\n"); + output.append("\tHDRCapable: "); + output.append(HDRCapable); + output.append("\n"); + output.append("\tmaxFPS: "); + output.append(maxFPS); + output.append("\n"); + output.append("\tmaxHDRFPS: "); + output.append(maxHDRFPS); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class CameraAvStreamManagementClusterViewportStruct { + public Integer x1; + public Integer y1; + public Integer x2; + public Integer y2; + private static final long X1_ID = 0L; + private static final long Y1_ID = 1L; + private static final long X2_ID = 2L; + private static final long Y2_ID = 3L; + + public CameraAvStreamManagementClusterViewportStruct( + Integer x1, + Integer y1, + Integer x2, + Integer y2 + ) { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(X1_ID, new UIntType(x1))); + values.add(new StructElement(Y1_ID, new UIntType(y1))); + values.add(new StructElement(X2_ID, new UIntType(x2))); + values.add(new StructElement(Y2_ID, new UIntType(y2))); + + return new StructType(values); + } + + public static CameraAvStreamManagementClusterViewportStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer x1 = null; + Integer y1 = null; + Integer x2 = null; + Integer y2 = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == X1_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x1 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y1_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y1 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == X2_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + x2 = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == Y2_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + y2 = castingValue.value(Integer.class); + } + } + } + return new CameraAvStreamManagementClusterViewportStruct( + x1, + y1, + x2, + y2 + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("CameraAvStreamManagementClusterViewportStruct {\n"); + output.append("\tx1: "); + output.append(x1); + output.append("\n"); + output.append("\ty1: "); + output.append(y1); + output.append("\n"); + output.append("\tx2: "); + output.append(x2); + output.append("\n"); + output.append("\ty2: "); + output.append(y2); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class WebRTCTransportProviderClusterICEServerStruct { public ArrayList urls; public Optional username; @@ -12951,6 +14314,233 @@ public String toString() { return output.toString(); } } +public static class WebRTCTransportRequestorClusterICEServerStruct { + public ArrayList urls; + public Optional username; + public Optional credential; + public Optional caid; + private static final long URLS_ID = 1L; + private static final long USERNAME_ID = 2L; + private static final long CREDENTIAL_ID = 3L; + private static final long CAID_ID = 4L; + + public WebRTCTransportRequestorClusterICEServerStruct( + ArrayList urls, + Optional username, + Optional credential, + Optional caid + ) { + this.urls = urls; + this.username = username; + this.credential = credential; + this.caid = caid; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(URLS_ID, ArrayType.generateArrayType(urls, (elementurls) -> new StringType(elementurls)))); + values.add(new StructElement(USERNAME_ID, username.map((nonOptionalusername) -> new StringType(nonOptionalusername)).orElse(new EmptyType()))); + values.add(new StructElement(CREDENTIAL_ID, credential.map((nonOptionalcredential) -> new StringType(nonOptionalcredential)).orElse(new EmptyType()))); + values.add(new StructElement(CAID_ID, caid.map((nonOptionalcaid) -> new UIntType(nonOptionalcaid)).orElse(new EmptyType()))); + + return new StructType(values); + } + + public static WebRTCTransportRequestorClusterICEServerStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + ArrayList urls = null; + Optional username = Optional.empty(); + Optional credential = Optional.empty(); + Optional caid = Optional.empty(); + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == URLS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + urls = castingValue.map((elementcastingValue) -> elementcastingValue.value(String.class)); + } + } else if (element.contextTagNum() == USERNAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + username = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == CREDENTIAL_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + credential = Optional.of(castingValue.value(String.class)); + } + } else if (element.contextTagNum() == CAID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + caid = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new WebRTCTransportRequestorClusterICEServerStruct( + urls, + username, + credential, + caid + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WebRTCTransportRequestorClusterICEServerStruct {\n"); + output.append("\turls: "); + output.append(urls); + output.append("\n"); + output.append("\tusername: "); + output.append(username); + output.append("\n"); + output.append("\tcredential: "); + output.append(credential); + output.append("\n"); + output.append("\tcaid: "); + output.append(caid); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class WebRTCTransportRequestorClusterWebRTCSessionStruct { + public Integer id; + public Long peerNodeID; + public Integer peerFabricIndex; + public Integer streamType; + public @Nullable Integer videoStreamID; + public @Nullable Integer audioStreamID; + public Integer metadataOptions; + private static final long ID_ID = 1L; + private static final long PEER_NODE_ID_ID = 2L; + private static final long PEER_FABRIC_INDEX_ID = 3L; + private static final long STREAM_TYPE_ID = 4L; + private static final long VIDEO_STREAM_ID_ID = 5L; + private static final long AUDIO_STREAM_ID_ID = 6L; + private static final long METADATA_OPTIONS_ID = 7L; + + public WebRTCTransportRequestorClusterWebRTCSessionStruct( + Integer id, + Long peerNodeID, + Integer peerFabricIndex, + Integer streamType, + @Nullable Integer videoStreamID, + @Nullable Integer audioStreamID, + Integer metadataOptions + ) { + this.id = id; + this.peerNodeID = peerNodeID; + this.peerFabricIndex = peerFabricIndex; + this.streamType = streamType; + this.videoStreamID = videoStreamID; + this.audioStreamID = audioStreamID; + this.metadataOptions = metadataOptions; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ID_ID, new UIntType(id))); + values.add(new StructElement(PEER_NODE_ID_ID, new UIntType(peerNodeID))); + values.add(new StructElement(PEER_FABRIC_INDEX_ID, new UIntType(peerFabricIndex))); + values.add(new StructElement(STREAM_TYPE_ID, new UIntType(streamType))); + values.add(new StructElement(VIDEO_STREAM_ID_ID, videoStreamID != null ? new UIntType(videoStreamID) : new NullType())); + values.add(new StructElement(AUDIO_STREAM_ID_ID, audioStreamID != null ? new UIntType(audioStreamID) : new NullType())); + values.add(new StructElement(METADATA_OPTIONS_ID, new UIntType(metadataOptions))); + + return new StructType(values); + } + + public static WebRTCTransportRequestorClusterWebRTCSessionStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer id = null; + Long peerNodeID = null; + Integer peerFabricIndex = null; + Integer streamType = null; + @Nullable Integer videoStreamID = null; + @Nullable Integer audioStreamID = null; + Integer metadataOptions = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + id = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == PEER_NODE_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + peerNodeID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == PEER_FABRIC_INDEX_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + peerFabricIndex = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == STREAM_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + streamType = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == VIDEO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + videoStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AUDIO_STREAM_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + audioStreamID = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == METADATA_OPTIONS_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + metadataOptions = castingValue.value(Integer.class); + } + } + } + return new WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n"); + output.append("\tid: "); + output.append(id); + output.append("\n"); + output.append("\tpeerNodeID: "); + output.append(peerNodeID); + output.append("\n"); + output.append("\tpeerFabricIndex: "); + output.append(peerFabricIndex); + output.append("\n"); + output.append("\tstreamType: "); + output.append(streamType); + output.append("\n"); + output.append("\tvideoStreamID: "); + output.append(videoStreamID); + output.append("\n"); + output.append("\taudioStreamID: "); + output.append(audioStreamID); + output.append("\n"); + output.append("\tmetadataOptions: "); + output.append(metadataOptions); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ChimeClusterChimeSoundStruct { public Integer chimeID; public String name; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index af30b0eb34..9ab44a7257 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -379,9 +379,18 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ContentAppObserver.ID) { return new ContentAppObserver(); } + if (clusterId == ZoneManagement.ID) { + return new ZoneManagement(); + } + if (clusterId == CameraAvStreamManagement.ID) { + return new CameraAvStreamManagement(); + } if (clusterId == WebRTCTransportProvider.ID) { return new WebRTCTransportProvider(); } + if (clusterId == WebRTCTransportRequestor.ID) { + return new WebRTCTransportRequestor(); + } if (clusterId == Chime.ID) { return new Chime(); } @@ -2872,6 +2881,7 @@ public enum Attribute { TCMinRequiredVersion(6L), TCAcknowledgements(7L), TCAcknowledgementsRequired(8L), + TCUpdateDeadline(9L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -16884,14 +16894,17 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class WebRTCTransportProvider implements BaseCluster { - public static final long ID = 1363L; + public static class ZoneManagement implements BaseCluster { + public static final long ID = 1360L; public long getID() { return ID; } public enum Attribute { - CurrentSessions(0L), + SupportedZoneSources(0L), + Zones(1L), + TimeControl(2L), + Sensitivity(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -16917,7 +16930,9 @@ public static Attribute value(long id) throws NoSuchFieldError { } } - public enum Event {; + public enum Event { + ZoneTriggered(0L), + ZoneStopped(1L),; private final long id; Event(long id) { this.id = id; @@ -16938,11 +16953,10 @@ public static Event value(long id) throws NoSuchFieldError { } public enum Command { - SolicitOffer(1L), - ProvideOffer(3L), - ProvideAnswer(5L), - ProvideICECandidate(6L), - EndSession(7L),; + CreateTwoDCartesianZone(0L), + UpdateTwoDCartesianZone(2L), + GetTwoDCartesianZone(3L), + RemoveZone(5L),; private final long id; Command(long id) { this.id = id; @@ -16960,85 +16974,816 @@ public static Command value(long id) throws NoSuchFieldError { } throw new NoSuchFieldError(); } - }public enum SolicitOfferCommandField {StreamType(0),VideoStreamID(1),AudioStreamID(2),ICEServers(3),ICETransportPolicy(4),MetadataOptions(5),; + }public enum CreateTwoDCartesianZoneCommandField {Zone(0),; private final int id; - SolicitOfferCommandField(int id) { + CreateTwoDCartesianZoneCommandField(int id) { this.id = id; } public int getID() { return id; } - public static SolicitOfferCommandField value(int id) throws NoSuchFieldError { - for (SolicitOfferCommandField field : SolicitOfferCommandField.values()) { + public static CreateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (CreateTwoDCartesianZoneCommandField field : CreateTwoDCartesianZoneCommandField.values()) { if (field.getID() == id) { return field; } } throw new NoSuchFieldError(); } - }public enum ProvideOfferCommandField {WebRTCSessionID(0),Sdp(1),StreamType(2),VideoStreamID(3),AudioStreamID(4),ICEServers(5),ICETransportPolicy(6),MetadataOptions(7),; + }public enum UpdateTwoDCartesianZoneCommandField {ZoneID(0),Zone(1),; private final int id; - ProvideOfferCommandField(int id) { + UpdateTwoDCartesianZoneCommandField(int id) { this.id = id; } public int getID() { return id; } - public static ProvideOfferCommandField value(int id) throws NoSuchFieldError { - for (ProvideOfferCommandField field : ProvideOfferCommandField.values()) { + public static UpdateTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (UpdateTwoDCartesianZoneCommandField field : UpdateTwoDCartesianZoneCommandField.values()) { if (field.getID() == id) { return field; } } throw new NoSuchFieldError(); } - }public enum ProvideAnswerCommandField {WebRTCSessionID(0),Sdp(1),; + }public enum GetTwoDCartesianZoneCommandField {ZoneID(0),; private final int id; - ProvideAnswerCommandField(int id) { + GetTwoDCartesianZoneCommandField(int id) { this.id = id; } public int getID() { return id; } - public static ProvideAnswerCommandField value(int id) throws NoSuchFieldError { - for (ProvideAnswerCommandField field : ProvideAnswerCommandField.values()) { + public static GetTwoDCartesianZoneCommandField value(int id) throws NoSuchFieldError { + for (GetTwoDCartesianZoneCommandField field : GetTwoDCartesianZoneCommandField.values()) { if (field.getID() == id) { return field; } } throw new NoSuchFieldError(); } - }public enum ProvideICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + }public enum RemoveZoneCommandField {ZoneID(0),; private final int id; - ProvideICECandidateCommandField(int id) { + RemoveZoneCommandField(int id) { this.id = id; } public int getID() { return id; } - public static ProvideICECandidateCommandField value(int id) throws NoSuchFieldError { - for (ProvideICECandidateCommandField field : ProvideICECandidateCommandField.values()) { + public static RemoveZoneCommandField value(int id) throws NoSuchFieldError { + for (RemoveZoneCommandField field : RemoveZoneCommandField.values()) { if (field.getID() == id) { return field; } } throw new NoSuchFieldError(); } - }public enum EndSessionCommandField {WebRTCSessionID(0),Reason(1),; + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class CameraAvStreamManagement implements BaseCluster { + public static final long ID = 1361L; + public long getID() { + return ID; + } + + public enum Attribute { + MaxConcurrentVideoEncoders(0L), + MaxEncodedPixelRate(1L), + VideoSensorParams(2L), + NightVisionCapable(3L), + MinViewport(4L), + RateDistortionTradeOffPoints(5L), + MaxPreRollBufferSize(6L), + MicrophoneCapabilities(7L), + SpeakerCapabilities(8L), + TwoWayTalkSupport(9L), + SupportedSnapshotParams(10L), + MaxNetworkBandwidth(11L), + CurrentFrameRate(12L), + HDRModeEnabled(13L), + CurrentVideoCodecs(14L), + CurrentSnapshotConfig(15L), + FabricsUsingCamera(16L), + AllocatedVideoStreams(17L), + AllocatedAudioStreams(18L), + AllocatedSnapshotStreams(19L), + RankedVideoStreamPrioritiesList(20L), + SoftRecordingPrivacyModeEnabled(21L), + SoftLivestreamPrivacyModeEnabled(22L), + HardPrivacyModeOn(23L), + NightVision(24L), + NightVisionIllum(25L), + AWBEnabled(26L), + AutoShutterSpeedEnabled(27L), + AutoISOEnabled(28L), + Viewport(29L), + SpeakerMuted(30L), + SpeakerVolumeLevel(31L), + SpeakerMaxLevel(32L), + SpeakerMinLevel(33L), + MicrophoneMuted(34L), + MicrophoneVolumeLevel(35L), + MicrophoneMaxLevel(36L), + MicrophoneMinLevel(37L), + MicrophoneAGCEnabled(38L), + ImageRotation(39L), + ImageFlipHorizontal(40L), + ImageFlipVertical(41L), + LocalVideoRecordingEnabled(42L), + LocalSnapshotRecordingEnabled(43L), + StatusLightEnabled(44L), + StatusLightBrightness(45L), + DepthSensorStatus(46L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event { + VideoStreamChanged(0L), + AudioStreamChanged(1L), + SnapshotStreamChanged(2L),; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + AudioStreamAllocate(0L), + AudioStreamDeallocate(2L), + VideoStreamAllocate(3L), + VideoStreamModify(5L), + VideoStreamDeallocate(6L), + SnapshotStreamAllocate(7L), + SnapshotStreamDeallocate(9L), + SetStreamPriorities(10L), + CaptureSnapshot(11L), + SetViewport(13L), + SetImageRotation(14L), + SetImageFlipHorizontal(15L), + SetImageFlipVertical(16L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum AudioStreamAllocateCommandField {StreamType(0),AudioCodec(1),ChannelCount(2),SampleRate(3),BitRate(4),BitDepth(5),; private final int id; - EndSessionCommandField(int id) { + AudioStreamAllocateCommandField(int id) { this.id = id; } public int getID() { return id; } - public static EndSessionCommandField value(int id) throws NoSuchFieldError { - for (EndSessionCommandField field : EndSessionCommandField.values()) { + public static AudioStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (AudioStreamAllocateCommandField field : AudioStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AudioStreamDeallocateCommandField {AudioStreamID(0),; + private final int id; + AudioStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AudioStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (AudioStreamDeallocateCommandField field : AudioStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamAllocateCommandField {StreamType(0),VideoCodec(1),MinFrameRate(2),MaxFrameRate(3),MinResolution(4),MaxResolution(5),MinBitRate(6),MaxBitRate(7),MinFragmentLen(8),MaxFragmentLen(9),WatermarkEnabled(10),OSDEnabled(11),; + private final int id; + VideoStreamAllocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamAllocateCommandField field : VideoStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamModifyCommandField {VideoStreamID(0),Resolution(1),WatermarkEnabled(2),OSDEnabled(3),; + private final int id; + VideoStreamModifyCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamModifyCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamModifyCommandField field : VideoStreamModifyCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum VideoStreamDeallocateCommandField {VideoStreamID(0),; + private final int id; + VideoStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static VideoStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (VideoStreamDeallocateCommandField field : VideoStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SnapshotStreamAllocateCommandField {ImageCodec(0),FrameRate(1),BitRate(2),MinResolution(3),MaxResolution(4),Quality(5),; + private final int id; + SnapshotStreamAllocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SnapshotStreamAllocateCommandField value(int id) throws NoSuchFieldError { + for (SnapshotStreamAllocateCommandField field : SnapshotStreamAllocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SnapshotStreamDeallocateCommandField {SnapshotStreamID(0),; + private final int id; + SnapshotStreamDeallocateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SnapshotStreamDeallocateCommandField value(int id) throws NoSuchFieldError { + for (SnapshotStreamDeallocateCommandField field : SnapshotStreamDeallocateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetStreamPrioritiesCommandField {StreamPriorities(0),; + private final int id; + SetStreamPrioritiesCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetStreamPrioritiesCommandField value(int id) throws NoSuchFieldError { + for (SetStreamPrioritiesCommandField field : SetStreamPrioritiesCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum CaptureSnapshotCommandField {SnapshotStreamID(0),RequestedResolution(1),; + private final int id; + CaptureSnapshotCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static CaptureSnapshotCommandField value(int id) throws NoSuchFieldError { + for (CaptureSnapshotCommandField field : CaptureSnapshotCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetViewportCommandField {Viewport(0),; + private final int id; + SetViewportCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetViewportCommandField value(int id) throws NoSuchFieldError { + for (SetViewportCommandField field : SetViewportCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageRotationCommandField {Angle(0),; + private final int id; + SetImageRotationCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageRotationCommandField value(int id) throws NoSuchFieldError { + for (SetImageRotationCommandField field : SetImageRotationCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageFlipHorizontalCommandField {Enabled(0),; + private final int id; + SetImageFlipHorizontalCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageFlipHorizontalCommandField value(int id) throws NoSuchFieldError { + for (SetImageFlipHorizontalCommandField field : SetImageFlipHorizontalCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum SetImageFlipVerticalCommandField {Enabled(0),; + private final int id; + SetImageFlipVerticalCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SetImageFlipVerticalCommandField value(int id) throws NoSuchFieldError { + for (SetImageFlipVerticalCommandField field : SetImageFlipVerticalCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class WebRTCTransportProvider implements BaseCluster { + public static final long ID = 1363L; + public long getID() { + return ID; + } + + public enum Attribute { + CurrentSessions(0L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + SolicitOffer(1L), + ProvideOffer(3L), + ProvideAnswer(5L), + ProvideICECandidate(6L), + EndSession(7L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum SolicitOfferCommandField {StreamType(0),VideoStreamID(1),AudioStreamID(2),ICEServers(3),ICETransportPolicy(4),MetadataOptions(5),; + private final int id; + SolicitOfferCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static SolicitOfferCommandField value(int id) throws NoSuchFieldError { + for (SolicitOfferCommandField field : SolicitOfferCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ProvideOfferCommandField {WebRTCSessionID(0),Sdp(1),StreamType(2),VideoStreamID(3),AudioStreamID(4),ICEServers(5),ICETransportPolicy(6),MetadataOptions(7),; + private final int id; + ProvideOfferCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ProvideOfferCommandField value(int id) throws NoSuchFieldError { + for (ProvideOfferCommandField field : ProvideOfferCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ProvideAnswerCommandField {WebRTCSessionID(0),Sdp(1),; + private final int id; + ProvideAnswerCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ProvideAnswerCommandField value(int id) throws NoSuchFieldError { + for (ProvideAnswerCommandField field : ProvideAnswerCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ProvideICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + private final int id; + ProvideICECandidateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ProvideICECandidateCommandField value(int id) throws NoSuchFieldError { + for (ProvideICECandidateCommandField field : ProvideICECandidateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum EndSessionCommandField {WebRTCSessionID(0),Reason(1),; + private final int id; + EndSessionCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static EndSessionCommandField value(int id) throws NoSuchFieldError { + for (EndSessionCommandField field : EndSessionCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class WebRTCTransportRequestor implements BaseCluster { + public static final long ID = 1364L; + public long getID() { + return ID; + } + + public enum Attribute { + CurrentSessions(0L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Offer(1L), + Answer(2L), + ICECandidate(3L), + End(4L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum OfferCommandField {WebRTCSessionID(0),Sdp(1),ICEServers(2),ICETransportPolicy(3),; + private final int id; + OfferCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static OfferCommandField value(int id) throws NoSuchFieldError { + for (OfferCommandField field : OfferCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum AnswerCommandField {WebRTCSessionID(0),Sdp(1),; + private final int id; + AnswerCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AnswerCommandField value(int id) throws NoSuchFieldError { + for (AnswerCommandField field : AnswerCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum ICECandidateCommandField {WebRTCSessionID(0),ICECandidate(1),; + private final int id; + ICECandidateCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static ICECandidateCommandField value(int id) throws NoSuchFieldError { + for (ICECandidateCommandField field : ICECandidateCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }public enum EndCommandField {WebRTCSessionID(0),Reason(1),; + private final int id; + EndCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static EndCommandField value(int id) throws NoSuchFieldError { + for (EndCommandField field : EndCommandField.values()) { if (field.getID() == id) { return field; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 295ada1c57..6e89ac926f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -19995,7 +19995,7 @@ public void onError(Exception ex) { } - public static class DelegatedWebRTCTransportProviderClusterSolicitOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.SolicitOfferResponseCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20003,17 +20003,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer webRTCSessionID, Boolean deferredOffer, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID) { + public void onSuccess(Integer zoneID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo webRTCSessionIDResponseValue = new CommandResponseInfo("webRTCSessionID", "Integer"); - responseValues.put(webRTCSessionIDResponseValue, webRTCSessionID); - CommandResponseInfo deferredOfferResponseValue = new CommandResponseInfo("deferredOffer", "Boolean"); - responseValues.put(deferredOfferResponseValue, deferredOffer); - CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Optional"); - responseValues.put(videoStreamIDResponseValue, videoStreamID); - CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Optional"); - responseValues.put(audioStreamIDResponseValue, audioStreamID); + CommandResponseInfo zoneIDResponseValue = new CommandResponseInfo("zoneID", "Integer"); + responseValues.put(zoneIDResponseValue, zoneID); callback.onSuccess(responseValues); } @@ -20023,7 +20017,7 @@ public void onError(Exception error) { } } - public static class DelegatedWebRTCTransportProviderClusterProvideOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.ProvideOfferResponseCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback implements ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20031,15 +20025,12 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID) { + public void onSuccess(ArrayList zones) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo webRTCSessionIDResponseValue = new CommandResponseInfo("webRTCSessionID", "Integer"); - responseValues.put(webRTCSessionIDResponseValue, webRTCSessionID); - CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Integer"); - responseValues.put(videoStreamIDResponseValue, videoStreamID); - CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Integer"); - responseValues.put(audioStreamIDResponseValue, audioStreamID); + // zones: TwoDCartesianZoneStruct + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); } @@ -20048,7 +20039,7 @@ public void onError(Exception error) { callback.onFailure(error); } } - public static class DelegatedWebRTCTransportProviderClusterCurrentSessionsAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.CurrentSessionsAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback implements ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20056,9 +20047,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20069,7 +20060,7 @@ public void onError(Exception ex) { } } - public static class DelegatedWebRTCTransportProviderClusterGeneratedCommandListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterZonesAttributeCallback implements ChipClusters.ZoneManagementCluster.ZonesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20077,9 +20068,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20090,7 +20081,7 @@ public void onError(Exception ex) { } } - public static class DelegatedWebRTCTransportProviderClusterAcceptedCommandListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterTimeControlAttributeCallback implements ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20098,9 +20089,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20111,7 +20102,7 @@ public void onError(Exception ex) { } } - public static class DelegatedWebRTCTransportProviderClusterEventListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20132,7 +20123,7 @@ public void onError(Exception ex) { } } - public static class DelegatedWebRTCTransportProviderClusterAttributeListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.ZoneManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20153,7 +20144,7 @@ public void onError(Exception ex) { } } - public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterEventListAttributeCallback implements ChipClusters.ZoneManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20161,9 +20152,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20174,7 +20165,7 @@ public void onError(Exception ex) { } } - public static class DelegatedChimeClusterGeneratedCommandListAttributeCallback implements ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedZoneManagementClusterAttributeListAttributeCallback implements ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20195,7 +20186,8 @@ public void onError(Exception ex) { } } - public static class DelegatedChimeClusterAcceptedCommandListAttributeCallback implements ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedCameraAvStreamManagementClusterAudioStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.AudioStreamAllocateResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20203,20 +20195,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(Integer audioStreamID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + + CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Integer"); + responseValues.put(audioStreamIDResponseValue, audioStreamID); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedChimeClusterEventListAttributeCallback implements ChipClusters.ChimeCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterVideoStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.VideoStreamAllocateResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20224,20 +20217,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(Integer videoStreamID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + + CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Integer"); + responseValues.put(videoStreamIDResponseValue, videoStreamID); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedChimeClusterAttributeListAttributeCallback implements ChipClusters.ChimeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterSnapshotStreamAllocateResponseCallback implements ChipClusters.CameraAvStreamManagementCluster.SnapshotStreamAllocateResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20245,20 +20239,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(Integer snapshotStreamID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + + CommandResponseInfo snapshotStreamIDResponseValue = new CommandResponseInfo("snapshotStreamID", "Integer"); + responseValues.put(snapshotStreamIDResponseValue, snapshotStreamID); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - - public static class DelegatedEcosystemInformationClusterDeviceDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.DeviceDirectoryAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterVideoSensorParamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.VideoSensorParamsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20266,10 +20260,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterVideoSensorParamsStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -20279,7 +20273,7 @@ public void onError(Exception ex) { } } - public static class DelegatedEcosystemInformationClusterLocationDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.LocationDirectoryAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterMinViewportAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.MinViewportAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20287,10 +20281,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -20300,7 +20294,7 @@ public void onError(Exception ex) { } } - public static class DelegatedEcosystemInformationClusterGeneratedCommandListAttributeCallback implements ChipClusters.EcosystemInformationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterRateDistortionTradeOffPointsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.RateDistortionTradeOffPointsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20308,9 +20302,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20321,7 +20315,7 @@ public void onError(Exception ex) { } } - public static class DelegatedEcosystemInformationClusterAcceptedCommandListAttributeCallback implements ChipClusters.EcosystemInformationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterMicrophoneCapabilitiesAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.MicrophoneCapabilitiesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20329,10 +20323,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -20342,7 +20336,7 @@ public void onError(Exception ex) { } } - public static class DelegatedEcosystemInformationClusterEventListAttributeCallback implements ChipClusters.EcosystemInformationCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterSpeakerCapabilitiesAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.SpeakerCapabilitiesAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20350,10 +20344,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -20363,7 +20357,7 @@ public void onError(Exception ex) { } } - public static class DelegatedEcosystemInformationClusterAttributeListAttributeCallback implements ChipClusters.EcosystemInformationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterSupportedSnapshotParamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.SupportedSnapshotParamsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20371,9 +20365,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20384,8 +20378,7 @@ public void onError(Exception ex) { } } - - public static class DelegatedCommissionerControlClusterReverseOpenCommissioningWindowCallback implements ChipClusters.CommissionerControlCluster.ReverseOpenCommissioningWindowCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterCurrentVideoCodecsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.CurrentVideoCodecsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20393,28 +20386,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer commissioningTimeout, byte[] PAKEPasscodeVerifier, Integer discriminator, Long iterations, byte[] salt) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo commissioningTimeoutResponseValue = new CommandResponseInfo("commissioningTimeout", "Integer"); - responseValues.put(commissioningTimeoutResponseValue, commissioningTimeout); - CommandResponseInfo PAKEPasscodeVerifierResponseValue = new CommandResponseInfo("PAKEPasscodeVerifier", "byte[]"); - responseValues.put(PAKEPasscodeVerifierResponseValue, PAKEPasscodeVerifier); - CommandResponseInfo discriminatorResponseValue = new CommandResponseInfo("discriminator", "Integer"); - responseValues.put(discriminatorResponseValue, discriminator); - CommandResponseInfo iterationsResponseValue = new CommandResponseInfo("iterations", "Long"); - responseValues.put(iterationsResponseValue, iterations); - CommandResponseInfo saltResponseValue = new CommandResponseInfo("salt", "byte[]"); - responseValues.put(saltResponseValue, salt); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedCommissionerControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.CommissionerControlCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedCameraAvStreamManagementClusterCurrentSnapshotConfigAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.CurrentSnapshotConfigAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20422,10 +20407,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterSnapshotParamsStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -20435,7 +20420,7 @@ public void onError(Exception ex) { } } - public static class DelegatedCommissionerControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.CommissionerControlCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterFabricsUsingCameraAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.FabricsUsingCameraAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20443,9 +20428,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20456,7 +20441,7 @@ public void onError(Exception ex) { } } - public static class DelegatedCommissionerControlClusterEventListAttributeCallback implements ChipClusters.CommissionerControlCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterAllocatedVideoStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedVideoStreamsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20464,9 +20449,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20477,7 +20462,7 @@ public void onError(Exception ex) { } } - public static class DelegatedCommissionerControlClusterAttributeListAttributeCallback implements ChipClusters.CommissionerControlCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterAllocatedAudioStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedAudioStreamsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20485,9 +20470,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20498,8 +20483,7 @@ public void onError(Exception ex) { } } - - public static class DelegatedUnitTestingClusterTestSpecificResponseCallback implements ChipClusters.UnitTestingCluster.TestSpecificResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterAllocatedSnapshotStreamsAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AllocatedSnapshotStreamsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20507,21 +20491,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer returnValue) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); - responseValues.put(returnValueResponseValue, returnValue); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestAddArgumentsResponseCallback implements ChipClusters.UnitTestingCluster.TestAddArgumentsResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterRankedVideoStreamPrioritiesListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.RankedVideoStreamPrioritiesListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20529,21 +20512,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer returnValue) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); - responseValues.put(returnValueResponseValue, returnValue); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestSimpleArgumentResponseCallback implements ChipClusters.UnitTestingCluster.TestSimpleArgumentResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterViewportAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.ViewportAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20551,21 +20533,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Boolean returnValue) { + public void onSuccess(ChipStructs.CameraAvStreamManagementClusterViewportStruct value) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Boolean"); - responseValues.put(returnValueResponseValue, returnValue); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.CameraAvStreamManagementClusterViewportStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestStructArrayArgumentResponseCallback implements ChipClusters.UnitTestingCluster.TestStructArrayArgumentResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterGeneratedCommandListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20573,35 +20554,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ArrayList arg1, ArrayList arg2, ArrayList arg3, ArrayList arg4, Integer arg5, Boolean arg6) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - // arg1: NestedStructList - // Conversion from this type to Java is not properly implemented yet - - // arg2: SimpleStruct - // Conversion from this type to Java is not properly implemented yet - - // arg3: SimpleEnum - // Conversion from this type to Java is not properly implemented yet - - // arg4: boolean - // Conversion from this type to Java is not properly implemented yet - - CommandResponseInfo arg5ResponseValue = new CommandResponseInfo("arg5", "Integer"); - responseValues.put(arg5ResponseValue, arg5); - CommandResponseInfo arg6ResponseValue = new CommandResponseInfo("arg6", "Boolean"); - responseValues.put(arg6ResponseValue, arg6); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterBooleanResponseCallback implements ChipClusters.UnitTestingCluster.BooleanResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterAcceptedCommandListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20609,21 +20575,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Boolean value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Boolean"); - responseValues.put(valueResponseValue, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestListInt8UReverseResponseCallback implements ChipClusters.UnitTestingCluster.TestListInt8UReverseResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterEventListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20631,22 +20596,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ArrayList arg1) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - // arg1: int8u - // Conversion from this type to Java is not properly implemented yet - + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestEnumsResponseCallback implements ChipClusters.UnitTestingCluster.TestEnumsResponseCallback, DelegatedClusterCallback { + public static class DelegatedCameraAvStreamManagementClusterAttributeListAttributeCallback implements ChipClusters.CameraAvStreamManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20654,23 +20617,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer arg1, Integer arg2) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo arg1ResponseValue = new CommandResponseInfo("arg1", "Integer"); - responseValues.put(arg1ResponseValue, arg1); - CommandResponseInfo arg2ResponseValue = new CommandResponseInfo("arg2", "Integer"); - responseValues.put(arg2ResponseValue, arg2); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestNullableOptionalResponseCallback implements ChipClusters.UnitTestingCluster.TestNullableOptionalResponseCallback, DelegatedClusterCallback { + + public static class DelegatedWebRTCTransportProviderClusterSolicitOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.SolicitOfferResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20678,17 +20639,17 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Boolean wasPresent, Optional wasNull, Optional value, @Nullable Optional originalValue) { + public void onSuccess(Integer webRTCSessionID, Boolean deferredOffer, @Nullable Optional videoStreamID, @Nullable Optional audioStreamID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo wasPresentResponseValue = new CommandResponseInfo("wasPresent", "Boolean"); - responseValues.put(wasPresentResponseValue, wasPresent); - CommandResponseInfo wasNullResponseValue = new CommandResponseInfo("wasNull", "Optional"); - responseValues.put(wasNullResponseValue, wasNull); - CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Optional"); - responseValues.put(valueResponseValue, value); - CommandResponseInfo originalValueResponseValue = new CommandResponseInfo("originalValue", "Optional"); - responseValues.put(originalValueResponseValue, originalValue); + CommandResponseInfo webRTCSessionIDResponseValue = new CommandResponseInfo("webRTCSessionID", "Integer"); + responseValues.put(webRTCSessionIDResponseValue, webRTCSessionID); + CommandResponseInfo deferredOfferResponseValue = new CommandResponseInfo("deferredOffer", "Boolean"); + responseValues.put(deferredOfferResponseValue, deferredOffer); + CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Optional"); + responseValues.put(videoStreamIDResponseValue, videoStreamID); + CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Optional"); + responseValues.put(audioStreamIDResponseValue, audioStreamID); callback.onSuccess(responseValues); } @@ -20698,7 +20659,7 @@ public void onError(Exception error) { } } - public static class DelegatedUnitTestingClusterTestComplexNullableOptionalResponseCallback implements ChipClusters.UnitTestingCluster.TestComplexNullableOptionalResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterProvideOfferResponseCallback implements ChipClusters.WebRTCTransportProviderCluster.ProvideOfferResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20706,68 +20667,15 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Boolean nullableIntWasNull, Optional nullableIntValue, Boolean optionalIntWasPresent, Optional optionalIntValue, Boolean nullableOptionalIntWasPresent, Optional nullableOptionalIntWasNull, Optional nullableOptionalIntValue, Boolean nullableStringWasNull, Optional nullableStringValue, Boolean optionalStringWasPresent, Optional optionalStringValue, Boolean nullableOptionalStringWasPresent, Optional nullableOptionalStringWasNull, Optional nullableOptionalStringValue, Boolean nullableStructWasNull, Optional nullableStructValue, Boolean optionalStructWasPresent, Optional optionalStructValue, Boolean nullableOptionalStructWasPresent, Optional nullableOptionalStructWasNull, Optional nullableOptionalStructValue, Boolean nullableListWasNull, Optional> nullableListValue, Boolean optionalListWasPresent, Optional> optionalListValue, Boolean nullableOptionalListWasPresent, Optional nullableOptionalListWasNull, Optional> nullableOptionalListValue) { + public void onSuccess(Integer webRTCSessionID, Integer videoStreamID, Integer audioStreamID) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo nullableIntWasNullResponseValue = new CommandResponseInfo("nullableIntWasNull", "Boolean"); - responseValues.put(nullableIntWasNullResponseValue, nullableIntWasNull); - CommandResponseInfo nullableIntValueResponseValue = new CommandResponseInfo("nullableIntValue", "Optional"); - responseValues.put(nullableIntValueResponseValue, nullableIntValue); - CommandResponseInfo optionalIntWasPresentResponseValue = new CommandResponseInfo("optionalIntWasPresent", "Boolean"); - responseValues.put(optionalIntWasPresentResponseValue, optionalIntWasPresent); - CommandResponseInfo optionalIntValueResponseValue = new CommandResponseInfo("optionalIntValue", "Optional"); - responseValues.put(optionalIntValueResponseValue, optionalIntValue); - CommandResponseInfo nullableOptionalIntWasPresentResponseValue = new CommandResponseInfo("nullableOptionalIntWasPresent", "Boolean"); - responseValues.put(nullableOptionalIntWasPresentResponseValue, nullableOptionalIntWasPresent); - CommandResponseInfo nullableOptionalIntWasNullResponseValue = new CommandResponseInfo("nullableOptionalIntWasNull", "Optional"); - responseValues.put(nullableOptionalIntWasNullResponseValue, nullableOptionalIntWasNull); - CommandResponseInfo nullableOptionalIntValueResponseValue = new CommandResponseInfo("nullableOptionalIntValue", "Optional"); - responseValues.put(nullableOptionalIntValueResponseValue, nullableOptionalIntValue); - CommandResponseInfo nullableStringWasNullResponseValue = new CommandResponseInfo("nullableStringWasNull", "Boolean"); - responseValues.put(nullableStringWasNullResponseValue, nullableStringWasNull); - CommandResponseInfo nullableStringValueResponseValue = new CommandResponseInfo("nullableStringValue", "Optional"); - responseValues.put(nullableStringValueResponseValue, nullableStringValue); - CommandResponseInfo optionalStringWasPresentResponseValue = new CommandResponseInfo("optionalStringWasPresent", "Boolean"); - responseValues.put(optionalStringWasPresentResponseValue, optionalStringWasPresent); - CommandResponseInfo optionalStringValueResponseValue = new CommandResponseInfo("optionalStringValue", "Optional"); - responseValues.put(optionalStringValueResponseValue, optionalStringValue); - CommandResponseInfo nullableOptionalStringWasPresentResponseValue = new CommandResponseInfo("nullableOptionalStringWasPresent", "Boolean"); - responseValues.put(nullableOptionalStringWasPresentResponseValue, nullableOptionalStringWasPresent); - CommandResponseInfo nullableOptionalStringWasNullResponseValue = new CommandResponseInfo("nullableOptionalStringWasNull", "Optional"); - responseValues.put(nullableOptionalStringWasNullResponseValue, nullableOptionalStringWasNull); - CommandResponseInfo nullableOptionalStringValueResponseValue = new CommandResponseInfo("nullableOptionalStringValue", "Optional"); - responseValues.put(nullableOptionalStringValueResponseValue, nullableOptionalStringValue); - CommandResponseInfo nullableStructWasNullResponseValue = new CommandResponseInfo("nullableStructWasNull", "Boolean"); - responseValues.put(nullableStructWasNullResponseValue, nullableStructWasNull); - // nullableStructValue: Struct SimpleStruct - // Conversion from this type to Java is not properly implemented yet - CommandResponseInfo optionalStructWasPresentResponseValue = new CommandResponseInfo("optionalStructWasPresent", "Boolean"); - responseValues.put(optionalStructWasPresentResponseValue, optionalStructWasPresent); - // optionalStructValue: Struct SimpleStruct - // Conversion from this type to Java is not properly implemented yet - CommandResponseInfo nullableOptionalStructWasPresentResponseValue = new CommandResponseInfo("nullableOptionalStructWasPresent", "Boolean"); - responseValues.put(nullableOptionalStructWasPresentResponseValue, nullableOptionalStructWasPresent); - CommandResponseInfo nullableOptionalStructWasNullResponseValue = new CommandResponseInfo("nullableOptionalStructWasNull", "Optional"); - responseValues.put(nullableOptionalStructWasNullResponseValue, nullableOptionalStructWasNull); - // nullableOptionalStructValue: Struct SimpleStruct - // Conversion from this type to Java is not properly implemented yet - CommandResponseInfo nullableListWasNullResponseValue = new CommandResponseInfo("nullableListWasNull", "Boolean"); - responseValues.put(nullableListWasNullResponseValue, nullableListWasNull); - // nullableListValue: SimpleEnum - // Conversion from this type to Java is not properly implemented yet - - CommandResponseInfo optionalListWasPresentResponseValue = new CommandResponseInfo("optionalListWasPresent", "Boolean"); - responseValues.put(optionalListWasPresentResponseValue, optionalListWasPresent); - // optionalListValue: SimpleEnum - // Conversion from this type to Java is not properly implemented yet - - CommandResponseInfo nullableOptionalListWasPresentResponseValue = new CommandResponseInfo("nullableOptionalListWasPresent", "Boolean"); - responseValues.put(nullableOptionalListWasPresentResponseValue, nullableOptionalListWasPresent); - CommandResponseInfo nullableOptionalListWasNullResponseValue = new CommandResponseInfo("nullableOptionalListWasNull", "Optional"); - responseValues.put(nullableOptionalListWasNullResponseValue, nullableOptionalListWasNull); - // nullableOptionalListValue: SimpleEnum - // Conversion from this type to Java is not properly implemented yet - + CommandResponseInfo webRTCSessionIDResponseValue = new CommandResponseInfo("webRTCSessionID", "Integer"); + responseValues.put(webRTCSessionIDResponseValue, webRTCSessionID); + CommandResponseInfo videoStreamIDResponseValue = new CommandResponseInfo("videoStreamID", "Integer"); + responseValues.put(videoStreamIDResponseValue, videoStreamID); + CommandResponseInfo audioStreamIDResponseValue = new CommandResponseInfo("audioStreamID", "Integer"); + responseValues.put(audioStreamIDResponseValue, audioStreamID); callback.onSuccess(responseValues); } @@ -20776,8 +20684,7 @@ public void onError(Exception error) { callback.onFailure(error); } } - - public static class DelegatedUnitTestingClusterSimpleStructResponseCallback implements ChipClusters.UnitTestingCluster.SimpleStructResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterCurrentSessionsAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.CurrentSessionsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20785,21 +20692,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.UnitTestingClusterSimpleStruct arg1) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - // arg1: Struct SimpleStruct - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestEmitTestEventResponseCallback implements ChipClusters.UnitTestingCluster.TestEmitTestEventResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterGeneratedCommandListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20807,21 +20713,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Long"); - responseValues.put(valueResponseValue, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback implements ChipClusters.UnitTestingCluster.TestEmitTestFabricScopedEventResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterAcceptedCommandListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20829,21 +20734,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Long"); - responseValues.put(valueResponseValue, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestBatchHelperResponseCallback implements ChipClusters.UnitTestingCluster.TestBatchHelperResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterEventListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20851,21 +20755,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] buffer) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo bufferResponseValue = new CommandResponseInfo("buffer", "byte[]"); - responseValues.put(bufferResponseValue, buffer); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterStringEchoResponseCallback implements ChipClusters.UnitTestingCluster.StringEchoResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportProviderClusterAttributeListAttributeCallback implements ChipClusters.WebRTCTransportProviderCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20873,21 +20776,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] payload) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo payloadResponseValue = new CommandResponseInfo("payload", "byte[]"); - responseValues.put(payloadResponseValue, payload); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterGlobalEchoResponseCallback implements ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportRequestorClusterCurrentSessionsAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.CurrentSessionsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20895,23 +20797,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - // field1: Struct TestGlobalStruct - // Conversion from this type to Java is not properly implemented yet - CommandResponseInfo field2ResponseValue = new CommandResponseInfo("field2", "Integer"); - responseValues.put(field2ResponseValue, field2); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterTestDifferentVendorMeiResponseCallback implements ChipClusters.UnitTestingCluster.TestDifferentVendorMeiResponseCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportRequestorClusterGeneratedCommandListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20919,22 +20818,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer arg1, Long eventNumber) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo arg1ResponseValue = new CommandResponseInfo("arg1", "Integer"); - responseValues.put(arg1ResponseValue, arg1); - CommandResponseInfo eventNumberResponseValue = new CommandResponseInfo("eventNumber", "Long"); - responseValues.put(eventNumberResponseValue, eventNumber); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedUnitTestingClusterListInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.ListInt8uAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedWebRTCTransportRequestorClusterAcceptedCommandListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20942,9 +20839,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20955,7 +20852,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterListOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListOctetStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportRequestorClusterEventListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20963,9 +20860,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20976,7 +20873,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterListStructOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListStructOctetStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedWebRTCTransportRequestorClusterAttributeListAttributeCallback implements ChipClusters.WebRTCTransportRequestorCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -20984,9 +20881,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -20997,7 +20894,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterListNullablesAndOptionalsStructAttributeCallback implements ChipClusters.UnitTestingCluster.ListNullablesAndOptionalsStructAttributeCallback, DelegatedClusterCallback { + public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21005,9 +20902,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21018,7 +20915,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterStructAttrAttributeCallback implements ChipClusters.UnitTestingCluster.StructAttrAttributeCallback, DelegatedClusterCallback { + public static class DelegatedChimeClusterGeneratedCommandListAttributeCallback implements ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21026,10 +20923,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.UnitTestingClusterSimpleStruct value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterSimpleStruct"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21039,7 +20936,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterListLongOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListLongOctetStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedChimeClusterAcceptedCommandListAttributeCallback implements ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21047,9 +20944,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21060,7 +20957,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterListFabricScopedAttributeCallback implements ChipClusters.UnitTestingCluster.ListFabricScopedAttributeCallback, DelegatedClusterCallback { + public static class DelegatedChimeClusterEventListAttributeCallback implements ChipClusters.ChimeCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21068,9 +20965,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21081,7 +20978,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.GlobalStructAttributeCallback, DelegatedClusterCallback { + public static class DelegatedChimeClusterAttributeListAttributeCallback implements ChipClusters.ChimeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21089,10 +20986,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21102,7 +20999,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableBooleanAttributeCallback implements ChipClusters.UnitTestingCluster.NullableBooleanAttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterDeviceDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.DeviceDirectoryAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21110,10 +21007,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Boolean value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Boolean"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21123,7 +21020,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableBitmap8AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap8AttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterLocationDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.LocationDirectoryAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21131,10 +21028,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21144,7 +21041,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableBitmap16AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap16AttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterGeneratedCommandListAttributeCallback implements ChipClusters.EcosystemInformationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21152,10 +21049,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21165,7 +21062,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableBitmap32AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap32AttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterAcceptedCommandListAttributeCallback implements ChipClusters.EcosystemInformationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21173,10 +21070,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21186,7 +21083,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableBitmap64AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap64AttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterEventListAttributeCallback implements ChipClusters.EcosystemInformationCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21194,10 +21091,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21207,7 +21104,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt8uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedEcosystemInformationClusterAttributeListAttributeCallback implements ChipClusters.EcosystemInformationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21215,10 +21112,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21228,7 +21125,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt16uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt16uAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedCommissionerControlClusterReverseOpenCommissioningWindowCallback implements ChipClusters.CommissionerControlCluster.ReverseOpenCommissioningWindowCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21236,20 +21134,28 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(Integer commissioningTimeout, byte[] PAKEPasscodeVerifier, Integer discriminator, Long iterations, byte[] salt) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo commissioningTimeoutResponseValue = new CommandResponseInfo("commissioningTimeout", "Integer"); + responseValues.put(commissioningTimeoutResponseValue, commissioningTimeout); + CommandResponseInfo PAKEPasscodeVerifierResponseValue = new CommandResponseInfo("PAKEPasscodeVerifier", "byte[]"); + responseValues.put(PAKEPasscodeVerifierResponseValue, PAKEPasscodeVerifier); + CommandResponseInfo discriminatorResponseValue = new CommandResponseInfo("discriminator", "Integer"); + responseValues.put(discriminatorResponseValue, discriminator); + CommandResponseInfo iterationsResponseValue = new CommandResponseInfo("iterations", "Long"); + responseValues.put(iterationsResponseValue, iterations); + CommandResponseInfo saltResponseValue = new CommandResponseInfo("salt", "byte[]"); + responseValues.put(saltResponseValue, salt); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - - public static class DelegatedUnitTestingClusterNullableInt24uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt24uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCommissionerControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.CommissionerControlCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21257,10 +21163,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21270,7 +21176,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt32uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt32uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCommissionerControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.CommissionerControlCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21278,10 +21184,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21291,7 +21197,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt40uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt40uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCommissionerControlClusterEventListAttributeCallback implements ChipClusters.CommissionerControlCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21299,10 +21205,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21312,7 +21218,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt48uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt48uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedCommissionerControlClusterAttributeListAttributeCallback implements ChipClusters.CommissionerControlCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21320,10 +21226,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21333,7 +21239,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableInt56uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt56uAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedUnitTestingClusterTestSpecificResponseCallback implements ChipClusters.UnitTestingCluster.TestSpecificResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21341,20 +21248,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(Integer returnValue) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); + responseValues.put(returnValueResponseValue, returnValue); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt64uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt64uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestAddArgumentsResponseCallback implements ChipClusters.UnitTestingCluster.TestAddArgumentsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21362,20 +21270,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(Integer returnValue) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); + responseValues.put(returnValueResponseValue, returnValue); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt8sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt8sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestSimpleArgumentResponseCallback implements ChipClusters.UnitTestingCluster.TestSimpleArgumentResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21383,20 +21292,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(Boolean returnValue) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Boolean"); + responseValues.put(returnValueResponseValue, returnValue); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt16sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt16sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestStructArrayArgumentResponseCallback implements ChipClusters.UnitTestingCluster.TestStructArrayArgumentResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21404,62 +21314,35 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(ArrayList arg1, ArrayList arg2, ArrayList arg3, ArrayList arg4, Integer arg5, Boolean arg6) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedUnitTestingClusterNullableInt24sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt24sAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } + // arg1: NestedStructList + // Conversion from this type to Java is not properly implemented yet - @Override - public void onSuccess(@Nullable Long value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } + // arg2: SimpleStruct + // Conversion from this type to Java is not properly implemented yet - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } + // arg3: SimpleEnum + // Conversion from this type to Java is not properly implemented yet - public static class DelegatedUnitTestingClusterNullableInt32sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt32sAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } + // arg4: boolean + // Conversion from this type to Java is not properly implemented yet - @Override - public void onSuccess(@Nullable Long value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo arg5ResponseValue = new CommandResponseInfo("arg5", "Integer"); + responseValues.put(arg5ResponseValue, arg5); + CommandResponseInfo arg6ResponseValue = new CommandResponseInfo("arg6", "Boolean"); + responseValues.put(arg6ResponseValue, arg6); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt40sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt40sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterBooleanResponseCallback implements ChipClusters.UnitTestingCluster.BooleanResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21467,20 +21350,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(Boolean value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Boolean"); + responseValues.put(valueResponseValue, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt48sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt48sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestListInt8UReverseResponseCallback implements ChipClusters.UnitTestingCluster.TestListInt8UReverseResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21488,41 +21372,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(ArrayList arg1) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedUnitTestingClusterNullableInt56sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt56sAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } + // arg1: int8u + // Conversion from this type to Java is not properly implemented yet - @Override - public void onSuccess(@Nullable Long value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableInt64sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt64sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestEnumsResponseCallback implements ChipClusters.UnitTestingCluster.TestEnumsResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21530,20 +21395,23 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Long value) { + public void onSuccess(Integer arg1, Integer arg2) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo arg1ResponseValue = new CommandResponseInfo("arg1", "Integer"); + responseValues.put(arg1ResponseValue, arg1); + CommandResponseInfo arg2ResponseValue = new CommandResponseInfo("arg2", "Integer"); + responseValues.put(arg2ResponseValue, arg2); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableEnum8AttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnum8AttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestNullableOptionalResponseCallback implements ChipClusters.UnitTestingCluster.TestNullableOptionalResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21551,20 +21419,27 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(Boolean wasPresent, Optional wasNull, Optional value, @Nullable Optional originalValue) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo wasPresentResponseValue = new CommandResponseInfo("wasPresent", "Boolean"); + responseValues.put(wasPresentResponseValue, wasPresent); + CommandResponseInfo wasNullResponseValue = new CommandResponseInfo("wasNull", "Optional"); + responseValues.put(wasNullResponseValue, wasNull); + CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Optional"); + responseValues.put(valueResponseValue, value); + CommandResponseInfo originalValueResponseValue = new CommandResponseInfo("originalValue", "Optional"); + responseValues.put(originalValueResponseValue, originalValue); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableEnum16AttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnum16AttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestComplexNullableOptionalResponseCallback implements ChipClusters.UnitTestingCluster.TestComplexNullableOptionalResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21572,41 +21447,78 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(Boolean nullableIntWasNull, Optional nullableIntValue, Boolean optionalIntWasPresent, Optional optionalIntValue, Boolean nullableOptionalIntWasPresent, Optional nullableOptionalIntWasNull, Optional nullableOptionalIntValue, Boolean nullableStringWasNull, Optional nullableStringValue, Boolean optionalStringWasPresent, Optional optionalStringValue, Boolean nullableOptionalStringWasPresent, Optional nullableOptionalStringWasNull, Optional nullableOptionalStringValue, Boolean nullableStructWasNull, Optional nullableStructValue, Boolean optionalStructWasPresent, Optional optionalStructValue, Boolean nullableOptionalStructWasPresent, Optional nullableOptionalStructWasNull, Optional nullableOptionalStructValue, Boolean nullableListWasNull, Optional> nullableListValue, Boolean optionalListWasPresent, Optional> optionalListValue, Boolean nullableOptionalListWasPresent, Optional nullableOptionalListWasNull, Optional> nullableOptionalListValue) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedUnitTestingClusterNullableFloatSingleAttributeCallback implements ChipClusters.UnitTestingCluster.NullableFloatSingleAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Float value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Float"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo nullableIntWasNullResponseValue = new CommandResponseInfo("nullableIntWasNull", "Boolean"); + responseValues.put(nullableIntWasNullResponseValue, nullableIntWasNull); + CommandResponseInfo nullableIntValueResponseValue = new CommandResponseInfo("nullableIntValue", "Optional"); + responseValues.put(nullableIntValueResponseValue, nullableIntValue); + CommandResponseInfo optionalIntWasPresentResponseValue = new CommandResponseInfo("optionalIntWasPresent", "Boolean"); + responseValues.put(optionalIntWasPresentResponseValue, optionalIntWasPresent); + CommandResponseInfo optionalIntValueResponseValue = new CommandResponseInfo("optionalIntValue", "Optional"); + responseValues.put(optionalIntValueResponseValue, optionalIntValue); + CommandResponseInfo nullableOptionalIntWasPresentResponseValue = new CommandResponseInfo("nullableOptionalIntWasPresent", "Boolean"); + responseValues.put(nullableOptionalIntWasPresentResponseValue, nullableOptionalIntWasPresent); + CommandResponseInfo nullableOptionalIntWasNullResponseValue = new CommandResponseInfo("nullableOptionalIntWasNull", "Optional"); + responseValues.put(nullableOptionalIntWasNullResponseValue, nullableOptionalIntWasNull); + CommandResponseInfo nullableOptionalIntValueResponseValue = new CommandResponseInfo("nullableOptionalIntValue", "Optional"); + responseValues.put(nullableOptionalIntValueResponseValue, nullableOptionalIntValue); + CommandResponseInfo nullableStringWasNullResponseValue = new CommandResponseInfo("nullableStringWasNull", "Boolean"); + responseValues.put(nullableStringWasNullResponseValue, nullableStringWasNull); + CommandResponseInfo nullableStringValueResponseValue = new CommandResponseInfo("nullableStringValue", "Optional"); + responseValues.put(nullableStringValueResponseValue, nullableStringValue); + CommandResponseInfo optionalStringWasPresentResponseValue = new CommandResponseInfo("optionalStringWasPresent", "Boolean"); + responseValues.put(optionalStringWasPresentResponseValue, optionalStringWasPresent); + CommandResponseInfo optionalStringValueResponseValue = new CommandResponseInfo("optionalStringValue", "Optional"); + responseValues.put(optionalStringValueResponseValue, optionalStringValue); + CommandResponseInfo nullableOptionalStringWasPresentResponseValue = new CommandResponseInfo("nullableOptionalStringWasPresent", "Boolean"); + responseValues.put(nullableOptionalStringWasPresentResponseValue, nullableOptionalStringWasPresent); + CommandResponseInfo nullableOptionalStringWasNullResponseValue = new CommandResponseInfo("nullableOptionalStringWasNull", "Optional"); + responseValues.put(nullableOptionalStringWasNullResponseValue, nullableOptionalStringWasNull); + CommandResponseInfo nullableOptionalStringValueResponseValue = new CommandResponseInfo("nullableOptionalStringValue", "Optional"); + responseValues.put(nullableOptionalStringValueResponseValue, nullableOptionalStringValue); + CommandResponseInfo nullableStructWasNullResponseValue = new CommandResponseInfo("nullableStructWasNull", "Boolean"); + responseValues.put(nullableStructWasNullResponseValue, nullableStructWasNull); + // nullableStructValue: Struct SimpleStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo optionalStructWasPresentResponseValue = new CommandResponseInfo("optionalStructWasPresent", "Boolean"); + responseValues.put(optionalStructWasPresentResponseValue, optionalStructWasPresent); + // optionalStructValue: Struct SimpleStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo nullableOptionalStructWasPresentResponseValue = new CommandResponseInfo("nullableOptionalStructWasPresent", "Boolean"); + responseValues.put(nullableOptionalStructWasPresentResponseValue, nullableOptionalStructWasPresent); + CommandResponseInfo nullableOptionalStructWasNullResponseValue = new CommandResponseInfo("nullableOptionalStructWasNull", "Optional"); + responseValues.put(nullableOptionalStructWasNullResponseValue, nullableOptionalStructWasNull); + // nullableOptionalStructValue: Struct SimpleStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo nullableListWasNullResponseValue = new CommandResponseInfo("nullableListWasNull", "Boolean"); + responseValues.put(nullableListWasNullResponseValue, nullableListWasNull); + // nullableListValue: SimpleEnum + // Conversion from this type to Java is not properly implemented yet + + CommandResponseInfo optionalListWasPresentResponseValue = new CommandResponseInfo("optionalListWasPresent", "Boolean"); + responseValues.put(optionalListWasPresentResponseValue, optionalListWasPresent); + // optionalListValue: SimpleEnum + // Conversion from this type to Java is not properly implemented yet + + CommandResponseInfo nullableOptionalListWasPresentResponseValue = new CommandResponseInfo("nullableOptionalListWasPresent", "Boolean"); + responseValues.put(nullableOptionalListWasPresentResponseValue, nullableOptionalListWasPresent); + CommandResponseInfo nullableOptionalListWasNullResponseValue = new CommandResponseInfo("nullableOptionalListWasNull", "Optional"); + responseValues.put(nullableOptionalListWasNullResponseValue, nullableOptionalListWasNull); + // nullableOptionalListValue: SimpleEnum + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableFloatDoubleAttributeCallback implements ChipClusters.UnitTestingCluster.NullableFloatDoubleAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterSimpleStructResponseCallback implements ChipClusters.UnitTestingCluster.SimpleStructResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21614,20 +21526,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Double value) { + public void onSuccess(ChipStructs.UnitTestingClusterSimpleStruct arg1) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Double"); - responseValues.put(commandResponseInfo, value); + + // arg1: Struct SimpleStruct + // Conversion from this type to Java is not properly implemented yet callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.NullableOctetStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestEmitTestEventResponseCallback implements ChipClusters.UnitTestingCluster.TestEmitTestEventResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21635,20 +21548,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable byte[] value) { + public void onSuccess(Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "byte[]"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Long"); + responseValues.put(valueResponseValue, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableCharStringAttributeCallback implements ChipClusters.UnitTestingCluster.NullableCharStringAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback implements ChipClusters.UnitTestingCluster.TestEmitTestFabricScopedEventResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21656,20 +21570,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable String value) { + public void onSuccess(Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo valueResponseValue = new CommandResponseInfo("value", "Long"); + responseValues.put(valueResponseValue, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableEnumAttrAttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnumAttrAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestBatchHelperResponseCallback implements ChipClusters.UnitTestingCluster.TestBatchHelperResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21677,20 +21592,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(byte[] buffer) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo bufferResponseValue = new CommandResponseInfo("buffer", "byte[]"); + responseValues.put(bufferResponseValue, buffer); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableStructAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterStringEchoResponseCallback implements ChipClusters.UnitTestingCluster.StringEchoResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21698,20 +21614,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable ChipStructs.UnitTestingClusterSimpleStruct value) { + public void onSuccess(byte[] payload) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterSimpleStruct"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo payloadResponseValue = new CommandResponseInfo("payload", "byte[]"); + responseValues.put(payloadResponseValue, payload); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt8uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterGlobalEchoResponseCallback implements ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21719,20 +21636,23 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + // field1: Struct TestGlobalStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo field2ResponseValue = new CommandResponseInfo("field2", "Integer"); + responseValues.put(field2ResponseValue, field2); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt8sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt8sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterTestDifferentVendorMeiResponseCallback implements ChipClusters.UnitTestingCluster.TestDifferentVendorMeiResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21740,20 +21660,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(Integer arg1, Long eventNumber) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + + CommandResponseInfo arg1ResponseValue = new CommandResponseInfo("arg1", "Integer"); + responseValues.put(arg1ResponseValue, arg1); + CommandResponseInfo eventNumberResponseValue = new CommandResponseInfo("eventNumber", "Long"); + responseValues.put(eventNumberResponseValue, eventNumber); callback.onSuccess(responseValues); } @Override - public void onError(Exception ex) { - callback.onFailure(ex); + public void onError(Exception error) { + callback.onFailure(error); } } - - public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt16uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt16uAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.ListInt8uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21761,10 +21683,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21774,7 +21696,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt16sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt16sAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListOctetStringAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21782,10 +21704,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21795,7 +21717,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListStructOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListStructOctetStringAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21803,10 +21725,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21816,7 +21738,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterNullableGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalStructAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListNullablesAndOptionalsStructAttributeCallback implements ChipClusters.UnitTestingCluster.ListNullablesAndOptionalsStructAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21824,10 +21746,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21837,7 +21759,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterGeneratedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterStructAttrAttributeCallback implements ChipClusters.UnitTestingCluster.StructAttrAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21845,10 +21767,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.UnitTestingClusterSimpleStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterSimpleStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -21858,7 +21780,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterAcceptedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListLongOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.ListLongOctetStringAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21866,9 +21788,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21879,7 +21801,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterEventListAttributeCallback implements ChipClusters.UnitTestingCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterListFabricScopedAttributeCallback implements ChipClusters.UnitTestingCluster.ListFabricScopedAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21887,9 +21809,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -21900,7 +21822,7 @@ public void onError(Exception ex) { } } - public static class DelegatedUnitTestingClusterAttributeListAttributeCallback implements ChipClusters.UnitTestingCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.GlobalStructAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21908,10 +21830,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -21921,7 +21843,7 @@ public void onError(Exception ex) { } } - public static class DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback implements ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableBooleanAttributeCallback implements ChipClusters.UnitTestingCluster.NullableBooleanAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21929,10 +21851,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Boolean value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Boolean"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -21942,7 +21864,7 @@ public void onError(Exception ex) { } } - public static class DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback implements ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableBitmap8AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap8AttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21950,10 +21872,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -21963,7 +21885,7 @@ public void onError(Exception ex) { } } - public static class DelegatedFaultInjectionClusterEventListAttributeCallback implements ChipClusters.FaultInjectionCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableBitmap16AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap16AttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21971,10 +21893,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -21984,7 +21906,7 @@ public void onError(Exception ex) { } } - public static class DelegatedFaultInjectionClusterAttributeListAttributeCallback implements ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableBitmap32AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap32AttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -21992,10 +21914,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -22005,8 +21927,7 @@ public void onError(Exception ex) { } } - - public static class DelegatedSampleMeiClusterAddArgumentsResponseCallback implements ChipClusters.SampleMeiCluster.AddArgumentsResponseCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableBitmap64AttributeCallback implements ChipClusters.UnitTestingCluster.NullableBitmap64AttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -22014,20 +21935,20 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(Integer returnValue) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - - CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); - responseValues.put(returnValueResponseValue, returnValue); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedSampleMeiClusterGeneratedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + + public static class DelegatedUnitTestingClusterNullableInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt8uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -22035,10 +21956,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -22048,7 +21969,7 @@ public void onError(Exception ex) { } } - public static class DelegatedSampleMeiClusterAcceptedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableInt16uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt16uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -22056,10 +21977,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -22069,7 +21990,7 @@ public void onError(Exception ex) { } } - public static class DelegatedSampleMeiClusterEventListAttributeCallback implements ChipClusters.SampleMeiCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableInt24uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt24uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -22077,10 +21998,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -22090,7 +22011,7 @@ public void onError(Exception ex) { } } - public static class DelegatedSampleMeiClusterAttributeListAttributeCallback implements ChipClusters.SampleMeiCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedUnitTestingClusterNullableInt32uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt32uAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override public void setCallbackDelegate(ClusterCommandCallback callback) { @@ -22098,10 +22019,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -22111,106 +22032,926 @@ public void onError(Exception ex) { } } + public static class DelegatedUnitTestingClusterNullableInt40uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt40uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - 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 identifyClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.IdentifyCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("identify", identifyClusterInfo); + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo groupsClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GroupsCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("groups", groupsClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo onOffClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OnOffCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("onOff", onOffClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt48uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt48uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo levelControlClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LevelControlCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("levelControl", levelControlClusterInfo); + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo pulseWidthModulationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.PulseWidthModulationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("pulseWidthModulation", pulseWidthModulationClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo descriptorClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("descriptor", descriptorClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt56uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt56uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo bindingClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BindingCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("binding", bindingClusterInfo); + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo accessControlClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.AccessControlCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("accessControl", accessControlClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo actionsClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ActionsCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("actions", actionsClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt64uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt64uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo basicInformationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BasicInformationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("basicInformation", basicInformationClusterInfo); + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo otaSoftwareUpdateProviderClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateProviderCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("otaSoftwareUpdateProvider", otaSoftwareUpdateProviderClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo otaSoftwareUpdateRequestorClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateRequestorCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("otaSoftwareUpdateRequestor", otaSoftwareUpdateRequestorClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt8sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt8sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo localizationConfigurationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.LocalizationConfigurationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("localizationConfiguration", localizationConfigurationClusterInfo); + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo timeFormatLocalizationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.TimeFormatLocalizationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("timeFormatLocalization", timeFormatLocalizationClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo unitLocalizationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.UnitLocalizationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("unitLocalization", unitLocalizationClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt16sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt16sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo powerSourceConfigurationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.PowerSourceConfigurationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("powerSourceConfiguration", powerSourceConfigurationClusterInfo); + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo powerSourceClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.PowerSourceCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("powerSource", powerSourceClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo generalCommissioningClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GeneralCommissioningCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("generalCommissioning", generalCommissioningClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt24sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt24sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo networkCommissioningClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.NetworkCommissioningCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("networkCommissioning", networkCommissioningClusterInfo); + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } - ClusterInfo diagnosticLogsClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.DiagnosticLogsCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("diagnosticLogs", diagnosticLogsClusterInfo); + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } - ClusterInfo generalDiagnosticsClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.GeneralDiagnosticsCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("generalDiagnostics", generalDiagnosticsClusterInfo); + public static class DelegatedUnitTestingClusterNullableInt32sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt32sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } - ClusterInfo softwareDiagnosticsClusterInfo = new ClusterInfo( + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableInt40sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt40sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableInt48sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt48sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableInt56sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt56sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableInt64sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableInt64sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableEnum8AttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnum8AttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableEnum16AttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnum16AttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableFloatSingleAttributeCallback implements ChipClusters.UnitTestingCluster.NullableFloatSingleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Float value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Float"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableFloatDoubleAttributeCallback implements ChipClusters.UnitTestingCluster.NullableFloatDoubleAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Double value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Double"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableOctetStringAttributeCallback implements ChipClusters.UnitTestingCluster.NullableOctetStringAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable byte[] value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "byte[]"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableCharStringAttributeCallback implements ChipClusters.UnitTestingCluster.NullableCharStringAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable String value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableEnumAttrAttributeCallback implements ChipClusters.UnitTestingCluster.NullableEnumAttrAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableStructAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.UnitTestingClusterSimpleStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterSimpleStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt8uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt8uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt8sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt8sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt16uAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt16uAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableRangeRestrictedInt16sAttributeCallback implements ChipClusters.UnitTestingCluster.NullableRangeRestrictedInt16sAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Integer value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterNullableGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalStructAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedUnitTestingClusterGeneratedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.GeneratedCommandListAttributeCallback, 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 static class DelegatedUnitTestingClusterAcceptedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.AcceptedCommandListAttributeCallback, 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 static class DelegatedUnitTestingClusterEventListAttributeCallback implements ChipClusters.UnitTestingCluster.EventListAttributeCallback, 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 static class DelegatedUnitTestingClusterAttributeListAttributeCallback implements ChipClusters.UnitTestingCluster.AttributeListAttributeCallback, 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 static class DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback implements ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback, 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 static class DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback implements ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback, 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 static class DelegatedFaultInjectionClusterEventListAttributeCallback implements ChipClusters.FaultInjectionCluster.EventListAttributeCallback, 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 static class DelegatedFaultInjectionClusterAttributeListAttributeCallback implements ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback, 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 static class DelegatedSampleMeiClusterAddArgumentsResponseCallback implements ChipClusters.SampleMeiCluster.AddArgumentsResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer returnValue) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); + responseValues.put(returnValueResponseValue, returnValue); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedSampleMeiClusterGeneratedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.GeneratedCommandListAttributeCallback, 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 static class DelegatedSampleMeiClusterAcceptedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.AcceptedCommandListAttributeCallback, 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 static class DelegatedSampleMeiClusterEventListAttributeCallback implements ChipClusters.SampleMeiCluster.EventListAttributeCallback, 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 static class DelegatedSampleMeiClusterAttributeListAttributeCallback implements ChipClusters.SampleMeiCluster.AttributeListAttributeCallback, 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 identifyClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.IdentifyCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("identify", identifyClusterInfo); + + ClusterInfo groupsClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GroupsCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("groups", groupsClusterInfo); + + ClusterInfo onOffClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OnOffCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("onOff", onOffClusterInfo); + + ClusterInfo levelControlClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LevelControlCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("levelControl", levelControlClusterInfo); + + ClusterInfo pulseWidthModulationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PulseWidthModulationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("pulseWidthModulation", pulseWidthModulationClusterInfo); + + ClusterInfo descriptorClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("descriptor", descriptorClusterInfo); + + ClusterInfo bindingClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BindingCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("binding", bindingClusterInfo); + + ClusterInfo accessControlClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.AccessControlCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("accessControl", accessControlClusterInfo); + + ClusterInfo actionsClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ActionsCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("actions", actionsClusterInfo); + + ClusterInfo basicInformationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.BasicInformationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("basicInformation", basicInformationClusterInfo); + + ClusterInfo otaSoftwareUpdateProviderClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateProviderCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("otaSoftwareUpdateProvider", otaSoftwareUpdateProviderClusterInfo); + + ClusterInfo otaSoftwareUpdateRequestorClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.OtaSoftwareUpdateRequestorCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("otaSoftwareUpdateRequestor", otaSoftwareUpdateRequestorClusterInfo); + + ClusterInfo localizationConfigurationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.LocalizationConfigurationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("localizationConfiguration", localizationConfigurationClusterInfo); + + ClusterInfo timeFormatLocalizationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TimeFormatLocalizationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("timeFormatLocalization", timeFormatLocalizationClusterInfo); + + ClusterInfo unitLocalizationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.UnitLocalizationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("unitLocalization", unitLocalizationClusterInfo); + + ClusterInfo powerSourceConfigurationClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PowerSourceConfigurationCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("powerSourceConfiguration", powerSourceConfigurationClusterInfo); + + ClusterInfo powerSourceClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PowerSourceCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("powerSource", powerSourceClusterInfo); + + ClusterInfo generalCommissioningClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GeneralCommissioningCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("generalCommissioning", generalCommissioningClusterInfo); + + ClusterInfo networkCommissioningClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.NetworkCommissioningCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("networkCommissioning", networkCommissioningClusterInfo); + + ClusterInfo diagnosticLogsClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.DiagnosticLogsCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("diagnosticLogs", diagnosticLogsClusterInfo); + + ClusterInfo generalDiagnosticsClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.GeneralDiagnosticsCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("generalDiagnostics", generalDiagnosticsClusterInfo); + + ClusterInfo softwareDiagnosticsClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.SoftwareDiagnosticsCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("softwareDiagnostics", softwareDiagnosticsClusterInfo); @@ -22594,10 +23335,22 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("contentAppObserver", contentAppObserverClusterInfo); + ClusterInfo zoneManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ZoneManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("zoneManagement", zoneManagementClusterInfo); + + ClusterInfo cameraAvStreamManagementClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.CameraAvStreamManagementCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInfo); + ClusterInfo webRTCTransportProviderClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.WebRTCTransportProviderCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInfo); + ClusterInfo webRTCTransportRequestorClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.WebRTCTransportRequestorCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInfo); + ClusterInfo chimeClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ChimeCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("chime", chimeClusterInfo); @@ -22743,7 +23496,10 @@ public void combineCommand(Map destination, Map> getCommandMap() { ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlmoveToColorTemperatureCommandParams + colorControlmoveToColorTemperatureCommandParams + ); + colorControlClusterInteractionInfoMap.put("moveToColorTemperature", colorControlmoveToColorTemperatureInteractionInfo); + + Map colorControlenhancedMoveToHueCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlenhancedMoveToHueenhancedHueCommandParameterInfo = new CommandParameterInfo("enhancedHue", Integer.class, Integer.class); + colorControlenhancedMoveToHueCommandParams.put("enhancedHue",colorControlenhancedMoveToHueenhancedHueCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHuedirectionCommandParameterInfo = new CommandParameterInfo("direction", Integer.class, Integer.class); + colorControlenhancedMoveToHueCommandParams.put("direction",colorControlenhancedMoveToHuedirectionCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHuetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); + colorControlenhancedMoveToHueCommandParams.put("transitionTime",colorControlenhancedMoveToHuetransitionTimeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlenhancedMoveToHueCommandParams.put("optionsMask",colorControlenhancedMoveToHueoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlenhancedMoveToHueCommandParams.put("optionsOverride",colorControlenhancedMoveToHueoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlenhancedMoveToHueInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .enhancedMoveToHue((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("enhancedHue") + , (Integer) + commandArguments.get("direction") + , (Integer) + commandArguments.get("transitionTime") + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlenhancedMoveToHueCommandParams + ); + colorControlClusterInteractionInfoMap.put("enhancedMoveToHue", colorControlenhancedMoveToHueInteractionInfo); + + Map colorControlenhancedMoveHueCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlenhancedMoveHuemoveModeCommandParameterInfo = new CommandParameterInfo("moveMode", Integer.class, Integer.class); + colorControlenhancedMoveHueCommandParams.put("moveMode",colorControlenhancedMoveHuemoveModeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveHuerateCommandParameterInfo = new CommandParameterInfo("rate", Integer.class, Integer.class); + colorControlenhancedMoveHueCommandParams.put("rate",colorControlenhancedMoveHuerateCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlenhancedMoveHueCommandParams.put("optionsMask",colorControlenhancedMoveHueoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlenhancedMoveHueCommandParams.put("optionsOverride",colorControlenhancedMoveHueoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlenhancedMoveHueInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .enhancedMoveHue((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("moveMode") + , (Integer) + commandArguments.get("rate") + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlenhancedMoveHueCommandParams + ); + colorControlClusterInteractionInfoMap.put("enhancedMoveHue", colorControlenhancedMoveHueInteractionInfo); + + Map colorControlenhancedStepHueCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlenhancedStepHuestepModeCommandParameterInfo = new CommandParameterInfo("stepMode", Integer.class, Integer.class); + colorControlenhancedStepHueCommandParams.put("stepMode",colorControlenhancedStepHuestepModeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedStepHuestepSizeCommandParameterInfo = new CommandParameterInfo("stepSize", Integer.class, Integer.class); + colorControlenhancedStepHueCommandParams.put("stepSize",colorControlenhancedStepHuestepSizeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedStepHuetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); + colorControlenhancedStepHueCommandParams.put("transitionTime",colorControlenhancedStepHuetransitionTimeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedStepHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlenhancedStepHueCommandParams.put("optionsMask",colorControlenhancedStepHueoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlenhancedStepHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlenhancedStepHueCommandParams.put("optionsOverride",colorControlenhancedStepHueoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlenhancedStepHueInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .enhancedStepHue((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("stepMode") + , (Integer) + commandArguments.get("stepSize") + , (Integer) + commandArguments.get("transitionTime") + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlenhancedStepHueCommandParams + ); + colorControlClusterInteractionInfoMap.put("enhancedStepHue", colorControlenhancedStepHueInteractionInfo); + + Map colorControlenhancedMoveToHueAndSaturationCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlenhancedMoveToHueAndSaturationenhancedHueCommandParameterInfo = new CommandParameterInfo("enhancedHue", Integer.class, Integer.class); + colorControlenhancedMoveToHueAndSaturationCommandParams.put("enhancedHue",colorControlenhancedMoveToHueAndSaturationenhancedHueCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueAndSaturationsaturationCommandParameterInfo = new CommandParameterInfo("saturation", Integer.class, Integer.class); + colorControlenhancedMoveToHueAndSaturationCommandParams.put("saturation",colorControlenhancedMoveToHueAndSaturationsaturationCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueAndSaturationtransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); + colorControlenhancedMoveToHueAndSaturationCommandParams.put("transitionTime",colorControlenhancedMoveToHueAndSaturationtransitionTimeCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueAndSaturationoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlenhancedMoveToHueAndSaturationCommandParams.put("optionsMask",colorControlenhancedMoveToHueAndSaturationoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlenhancedMoveToHueAndSaturationoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlenhancedMoveToHueAndSaturationCommandParams.put("optionsOverride",colorControlenhancedMoveToHueAndSaturationoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlenhancedMoveToHueAndSaturationInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .enhancedMoveToHueAndSaturation((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("enhancedHue") + , (Integer) + commandArguments.get("saturation") + , (Integer) + commandArguments.get("transitionTime") + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlenhancedMoveToHueAndSaturationCommandParams + ); + colorControlClusterInteractionInfoMap.put("enhancedMoveToHueAndSaturation", colorControlenhancedMoveToHueAndSaturationInteractionInfo); + + Map colorControlcolorLoopSetCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlcolorLoopSetupdateFlagsCommandParameterInfo = new CommandParameterInfo("updateFlags", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("updateFlags",colorControlcolorLoopSetupdateFlagsCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSetactionCommandParameterInfo = new CommandParameterInfo("action", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("action",colorControlcolorLoopSetactionCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSetdirectionCommandParameterInfo = new CommandParameterInfo("direction", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("direction",colorControlcolorLoopSetdirectionCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSettimeCommandParameterInfo = new CommandParameterInfo("time", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("time",colorControlcolorLoopSettimeCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSetstartHueCommandParameterInfo = new CommandParameterInfo("startHue", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("startHue",colorControlcolorLoopSetstartHueCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSetoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("optionsMask",colorControlcolorLoopSetoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlcolorLoopSetoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlcolorLoopSetCommandParams.put("optionsOverride",colorControlcolorLoopSetoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlcolorLoopSetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .colorLoopSet((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("updateFlags") + , (Integer) + commandArguments.get("action") + , (Integer) + commandArguments.get("direction") + , (Integer) + commandArguments.get("time") + , (Integer) + commandArguments.get("startHue") + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlcolorLoopSetCommandParams + ); + colorControlClusterInteractionInfoMap.put("colorLoopSet", colorControlcolorLoopSetInteractionInfo); + + Map colorControlstopMoveStepCommandParams = new LinkedHashMap(); + + CommandParameterInfo colorControlstopMoveStepoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlstopMoveStepCommandParams.put("optionsMask",colorControlstopMoveStepoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlstopMoveStepoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlstopMoveStepCommandParams.put("optionsOverride",colorControlstopMoveStepoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlstopMoveStepInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ColorControlCluster) cluster) + .stopMoveStep((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("optionsMask") + , (Integer) + commandArguments.get("optionsOverride") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + colorControlstopMoveStepCommandParams ); - colorControlClusterInteractionInfoMap.put("moveToColorTemperature", colorControlmoveToColorTemperatureInteractionInfo); + colorControlClusterInteractionInfoMap.put("stopMoveStep", colorControlstopMoveStepInteractionInfo); - Map colorControlenhancedMoveToHueCommandParams = new LinkedHashMap(); + Map colorControlmoveColorTemperatureCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlenhancedMoveToHueenhancedHueCommandParameterInfo = new CommandParameterInfo("enhancedHue", Integer.class, Integer.class); - colorControlenhancedMoveToHueCommandParams.put("enhancedHue",colorControlenhancedMoveToHueenhancedHueCommandParameterInfo); + CommandParameterInfo colorControlmoveColorTemperaturemoveModeCommandParameterInfo = new CommandParameterInfo("moveMode", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("moveMode",colorControlmoveColorTemperaturemoveModeCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveToHuedirectionCommandParameterInfo = new CommandParameterInfo("direction", Integer.class, Integer.class); - colorControlenhancedMoveToHueCommandParams.put("direction",colorControlenhancedMoveToHuedirectionCommandParameterInfo); + CommandParameterInfo colorControlmoveColorTemperaturerateCommandParameterInfo = new CommandParameterInfo("rate", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("rate",colorControlmoveColorTemperaturerateCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveToHuetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); - colorControlenhancedMoveToHueCommandParams.put("transitionTime",colorControlenhancedMoveToHuetransitionTimeCommandParameterInfo); + CommandParameterInfo colorControlmoveColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMinimumMireds", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("colorTemperatureMinimumMireds",colorControlmoveColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveToHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlenhancedMoveToHueCommandParams.put("optionsMask",colorControlenhancedMoveToHueoptionsMaskCommandParameterInfo); + CommandParameterInfo colorControlmoveColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMaximumMireds", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("colorTemperatureMaximumMireds",colorControlmoveColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveToHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlenhancedMoveToHueCommandParams.put("optionsOverride",colorControlenhancedMoveToHueoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlenhancedMoveToHueInteractionInfo = new InteractionInfo( + CommandParameterInfo colorControlmoveColorTemperatureoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("optionsMask",colorControlmoveColorTemperatureoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlmoveColorTemperatureoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlmoveColorTemperatureCommandParams.put("optionsOverride",colorControlmoveColorTemperatureoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlmoveColorTemperatureInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) - .enhancedMoveToHue((DefaultClusterCallback) callback + .moveColorTemperature((DefaultClusterCallback) callback , (Integer) - commandArguments.get("enhancedHue") + commandArguments.get("moveMode") , (Integer) - commandArguments.get("direction") + commandArguments.get("rate") , (Integer) - commandArguments.get("transitionTime") + commandArguments.get("colorTemperatureMinimumMireds") + , (Integer) + commandArguments.get("colorTemperatureMaximumMireds") , (Integer) commandArguments.get("optionsMask") , (Integer) @@ -27475,31 +28448,46 @@ public Map> getCommandMap() { ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlenhancedMoveToHueCommandParams + colorControlmoveColorTemperatureCommandParams ); - colorControlClusterInteractionInfoMap.put("enhancedMoveToHue", colorControlenhancedMoveToHueInteractionInfo); + colorControlClusterInteractionInfoMap.put("moveColorTemperature", colorControlmoveColorTemperatureInteractionInfo); - Map colorControlenhancedMoveHueCommandParams = new LinkedHashMap(); + Map colorControlstepColorTemperatureCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlenhancedMoveHuemoveModeCommandParameterInfo = new CommandParameterInfo("moveMode", Integer.class, Integer.class); - colorControlenhancedMoveHueCommandParams.put("moveMode",colorControlenhancedMoveHuemoveModeCommandParameterInfo); + CommandParameterInfo colorControlstepColorTemperaturestepModeCommandParameterInfo = new CommandParameterInfo("stepMode", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("stepMode",colorControlstepColorTemperaturestepModeCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveHuerateCommandParameterInfo = new CommandParameterInfo("rate", Integer.class, Integer.class); - colorControlenhancedMoveHueCommandParams.put("rate",colorControlenhancedMoveHuerateCommandParameterInfo); + CommandParameterInfo colorControlstepColorTemperaturestepSizeCommandParameterInfo = new CommandParameterInfo("stepSize", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("stepSize",colorControlstepColorTemperaturestepSizeCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlenhancedMoveHueCommandParams.put("optionsMask",colorControlenhancedMoveHueoptionsMaskCommandParameterInfo); + CommandParameterInfo colorControlstepColorTemperaturetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("transitionTime",colorControlstepColorTemperaturetransitionTimeCommandParameterInfo); - CommandParameterInfo colorControlenhancedMoveHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlenhancedMoveHueCommandParams.put("optionsOverride",colorControlenhancedMoveHueoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlenhancedMoveHueInteractionInfo = new InteractionInfo( + CommandParameterInfo colorControlstepColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMinimumMireds", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("colorTemperatureMinimumMireds",colorControlstepColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo); + + CommandParameterInfo colorControlstepColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMaximumMireds", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("colorTemperatureMaximumMireds",colorControlstepColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo); + + CommandParameterInfo colorControlstepColorTemperatureoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("optionsMask",colorControlstepColorTemperatureoptionsMaskCommandParameterInfo); + + CommandParameterInfo colorControlstepColorTemperatureoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); + colorControlstepColorTemperatureCommandParams.put("optionsOverride",colorControlstepColorTemperatureoptionsOverrideCommandParameterInfo); + InteractionInfo colorControlstepColorTemperatureInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ColorControlCluster) cluster) - .enhancedMoveHue((DefaultClusterCallback) callback + .stepColorTemperature((DefaultClusterCallback) callback , (Integer) - commandArguments.get("moveMode") + commandArguments.get("stepMode") , (Integer) - commandArguments.get("rate") + commandArguments.get("stepSize") + , (Integer) + commandArguments.get("transitionTime") + , (Integer) + commandArguments.get("colorTemperatureMinimumMireds") + , (Integer) + commandArguments.get("colorTemperatureMaximumMireds") , (Integer) commandArguments.get("optionsMask") , (Integer) @@ -27507,1401 +28495,1604 @@ public Map> getCommandMap() { ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlenhancedMoveHueCommandParams + colorControlstepColorTemperatureCommandParams ); - colorControlClusterInteractionInfoMap.put("enhancedMoveHue", colorControlenhancedMoveHueInteractionInfo); + colorControlClusterInteractionInfoMap.put("stepColorTemperature", colorControlstepColorTemperatureInteractionInfo); - Map colorControlenhancedStepHueCommandParams = new LinkedHashMap(); + commandMap.put("colorControl", colorControlClusterInteractionInfoMap); - CommandParameterInfo colorControlenhancedStepHuestepModeCommandParameterInfo = new CommandParameterInfo("stepMode", Integer.class, Integer.class); - colorControlenhancedStepHueCommandParams.put("stepMode",colorControlenhancedStepHuestepModeCommandParameterInfo); + Map ballastConfigurationClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo colorControlenhancedStepHuestepSizeCommandParameterInfo = new CommandParameterInfo("stepSize", Integer.class, Integer.class); - colorControlenhancedStepHueCommandParams.put("stepSize",colorControlenhancedStepHuestepSizeCommandParameterInfo); + commandMap.put("ballastConfiguration", ballastConfigurationClusterInteractionInfoMap); - CommandParameterInfo colorControlenhancedStepHuetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); - colorControlenhancedStepHueCommandParams.put("transitionTime",colorControlenhancedStepHuetransitionTimeCommandParameterInfo); + Map illuminanceMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo colorControlenhancedStepHueoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlenhancedStepHueCommandParams.put("optionsMask",colorControlenhancedStepHueoptionsMaskCommandParameterInfo); + commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); - CommandParameterInfo colorControlenhancedStepHueoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlenhancedStepHueCommandParams.put("optionsOverride",colorControlenhancedStepHueoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlenhancedStepHueInteractionInfo = new InteractionInfo( + Map temperatureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("temperatureMeasurement", temperatureMeasurementClusterInteractionInfoMap); + + Map pressureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("pressureMeasurement", pressureMeasurementClusterInteractionInfoMap); + + Map flowMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("flowMeasurement", flowMeasurementClusterInteractionInfoMap); + + Map relativeHumidityMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("relativeHumidityMeasurement", relativeHumidityMeasurementClusterInteractionInfoMap); + + Map occupancySensingClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("occupancySensing", occupancySensingClusterInteractionInfoMap); + + Map carbonMonoxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("carbonMonoxideConcentrationMeasurement", carbonMonoxideConcentrationMeasurementClusterInteractionInfoMap); + + Map carbonDioxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("carbonDioxideConcentrationMeasurement", carbonDioxideConcentrationMeasurementClusterInteractionInfoMap); + + Map nitrogenDioxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("nitrogenDioxideConcentrationMeasurement", nitrogenDioxideConcentrationMeasurementClusterInteractionInfoMap); + + Map ozoneConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("ozoneConcentrationMeasurement", ozoneConcentrationMeasurementClusterInteractionInfoMap); + + Map pm25ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("pm25ConcentrationMeasurement", pm25ConcentrationMeasurementClusterInteractionInfoMap); + + Map formaldehydeConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("formaldehydeConcentrationMeasurement", formaldehydeConcentrationMeasurementClusterInteractionInfoMap); + + Map pm1ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("pm1ConcentrationMeasurement", pm1ConcentrationMeasurementClusterInteractionInfoMap); + + Map pm10ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("pm10ConcentrationMeasurement", pm10ConcentrationMeasurementClusterInteractionInfoMap); + + Map totalVolatileOrganicCompoundsConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("totalVolatileOrganicCompoundsConcentrationMeasurement", totalVolatileOrganicCompoundsConcentrationMeasurementClusterInteractionInfoMap); + + Map radonConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("radonConcentrationMeasurement", radonConcentrationMeasurementClusterInteractionInfoMap); + + Map wiFiNetworkManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map wiFiNetworkManagementnetworkPassphraseRequestCommandParams = new LinkedHashMap(); + InteractionInfo wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .enhancedStepHue((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("stepMode") - , (Integer) - commandArguments.get("stepSize") - , (Integer) - commandArguments.get("transitionTime") - , (Integer) - commandArguments.get("optionsMask") - , (Integer) - commandArguments.get("optionsOverride") + ((ChipClusters.WiFiNetworkManagementCluster) cluster) + .networkPassphraseRequest((ChipClusters.WiFiNetworkManagementCluster.NetworkPassphraseResponseCallback) callback + ); + }, + () -> new DelegatedWiFiNetworkManagementClusterNetworkPassphraseResponseCallback(), + wiFiNetworkManagementnetworkPassphraseRequestCommandParams + ); + wiFiNetworkManagementClusterInteractionInfoMap.put("networkPassphraseRequest", wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo); + + commandMap.put("wiFiNetworkManagement", wiFiNetworkManagementClusterInteractionInfoMap); + + Map threadBorderRouterManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map threadBorderRouterManagementgetActiveDatasetRequestCommandParams = new LinkedHashMap(); + InteractionInfo threadBorderRouterManagementgetActiveDatasetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) + .getActiveDatasetRequest((ChipClusters.ThreadBorderRouterManagementCluster.DatasetResponseCallback) callback + ); + }, + () -> new DelegatedThreadBorderRouterManagementClusterDatasetResponseCallback(), + threadBorderRouterManagementgetActiveDatasetRequestCommandParams + ); + threadBorderRouterManagementClusterInteractionInfoMap.put("getActiveDatasetRequest", threadBorderRouterManagementgetActiveDatasetRequestInteractionInfo); + + Map threadBorderRouterManagementgetPendingDatasetRequestCommandParams = new LinkedHashMap(); + InteractionInfo threadBorderRouterManagementgetPendingDatasetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) + .getPendingDatasetRequest((ChipClusters.ThreadBorderRouterManagementCluster.DatasetResponseCallback) callback + ); + }, + () -> new DelegatedThreadBorderRouterManagementClusterDatasetResponseCallback(), + threadBorderRouterManagementgetPendingDatasetRequestCommandParams + ); + threadBorderRouterManagementClusterInteractionInfoMap.put("getPendingDatasetRequest", threadBorderRouterManagementgetPendingDatasetRequestInteractionInfo); + + Map threadBorderRouterManagementsetActiveDatasetRequestCommandParams = new LinkedHashMap(); + + CommandParameterInfo threadBorderRouterManagementsetActiveDatasetRequestactiveDatasetCommandParameterInfo = new CommandParameterInfo("activeDataset", byte[].class, byte[].class); + threadBorderRouterManagementsetActiveDatasetRequestCommandParams.put("activeDataset",threadBorderRouterManagementsetActiveDatasetRequestactiveDatasetCommandParameterInfo); + + CommandParameterInfo threadBorderRouterManagementsetActiveDatasetRequestbreadcrumbCommandParameterInfo = new CommandParameterInfo("breadcrumb", Optional.class, Long.class); + threadBorderRouterManagementsetActiveDatasetRequestCommandParams.put("breadcrumb",threadBorderRouterManagementsetActiveDatasetRequestbreadcrumbCommandParameterInfo); + InteractionInfo threadBorderRouterManagementsetActiveDatasetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) + .setActiveDatasetRequest((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("activeDataset") + , (Optional) + commandArguments.get("breadcrumb") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + threadBorderRouterManagementsetActiveDatasetRequestCommandParams + ); + threadBorderRouterManagementClusterInteractionInfoMap.put("setActiveDatasetRequest", threadBorderRouterManagementsetActiveDatasetRequestInteractionInfo); + + Map threadBorderRouterManagementsetPendingDatasetRequestCommandParams = new LinkedHashMap(); + + CommandParameterInfo threadBorderRouterManagementsetPendingDatasetRequestpendingDatasetCommandParameterInfo = new CommandParameterInfo("pendingDataset", byte[].class, byte[].class); + threadBorderRouterManagementsetPendingDatasetRequestCommandParams.put("pendingDataset",threadBorderRouterManagementsetPendingDatasetRequestpendingDatasetCommandParameterInfo); + InteractionInfo threadBorderRouterManagementsetPendingDatasetRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) + .setPendingDatasetRequest((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("pendingDataset") ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlenhancedStepHueCommandParams + threadBorderRouterManagementsetPendingDatasetRequestCommandParams ); - colorControlClusterInteractionInfoMap.put("enhancedStepHue", colorControlenhancedStepHueInteractionInfo); + threadBorderRouterManagementClusterInteractionInfoMap.put("setPendingDatasetRequest", threadBorderRouterManagementsetPendingDatasetRequestInteractionInfo); - Map colorControlenhancedMoveToHueAndSaturationCommandParams = new LinkedHashMap(); + commandMap.put("threadBorderRouterManagement", threadBorderRouterManagementClusterInteractionInfoMap); - CommandParameterInfo colorControlenhancedMoveToHueAndSaturationenhancedHueCommandParameterInfo = new CommandParameterInfo("enhancedHue", Integer.class, Integer.class); - colorControlenhancedMoveToHueAndSaturationCommandParams.put("enhancedHue",colorControlenhancedMoveToHueAndSaturationenhancedHueCommandParameterInfo); + Map threadNetworkDirectoryClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo colorControlenhancedMoveToHueAndSaturationsaturationCommandParameterInfo = new CommandParameterInfo("saturation", Integer.class, Integer.class); - colorControlenhancedMoveToHueAndSaturationCommandParams.put("saturation",colorControlenhancedMoveToHueAndSaturationsaturationCommandParameterInfo); + Map threadNetworkDirectoryaddNetworkCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlenhancedMoveToHueAndSaturationtransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); - colorControlenhancedMoveToHueAndSaturationCommandParams.put("transitionTime",colorControlenhancedMoveToHueAndSaturationtransitionTimeCommandParameterInfo); + CommandParameterInfo threadNetworkDirectoryaddNetworkoperationalDatasetCommandParameterInfo = new CommandParameterInfo("operationalDataset", byte[].class, byte[].class); + threadNetworkDirectoryaddNetworkCommandParams.put("operationalDataset",threadNetworkDirectoryaddNetworkoperationalDatasetCommandParameterInfo); + InteractionInfo threadNetworkDirectoryaddNetworkInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) + .addNetwork((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("operationalDataset"), 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + threadNetworkDirectoryaddNetworkCommandParams + ); + threadNetworkDirectoryClusterInteractionInfoMap.put("addNetwork", threadNetworkDirectoryaddNetworkInteractionInfo); - CommandParameterInfo colorControlenhancedMoveToHueAndSaturationoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlenhancedMoveToHueAndSaturationCommandParams.put("optionsMask",colorControlenhancedMoveToHueAndSaturationoptionsMaskCommandParameterInfo); + Map threadNetworkDirectoryremoveNetworkCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlenhancedMoveToHueAndSaturationoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlenhancedMoveToHueAndSaturationCommandParams.put("optionsOverride",colorControlenhancedMoveToHueAndSaturationoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlenhancedMoveToHueAndSaturationInteractionInfo = new InteractionInfo( + CommandParameterInfo threadNetworkDirectoryremoveNetworkextendedPanIDCommandParameterInfo = new CommandParameterInfo("extendedPanID", byte[].class, byte[].class); + threadNetworkDirectoryremoveNetworkCommandParams.put("extendedPanID",threadNetworkDirectoryremoveNetworkextendedPanIDCommandParameterInfo); + InteractionInfo threadNetworkDirectoryremoveNetworkInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .enhancedMoveToHueAndSaturation((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("enhancedHue") - , (Integer) - commandArguments.get("saturation") - , (Integer) - commandArguments.get("transitionTime") - , (Integer) - commandArguments.get("optionsMask") - , (Integer) - commandArguments.get("optionsOverride") + ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) + .removeNetwork((DefaultClusterCallback) callback + , (byte[]) + commandArguments.get("extendedPanID"), 10000 ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlenhancedMoveToHueAndSaturationCommandParams + threadNetworkDirectoryremoveNetworkCommandParams ); - colorControlClusterInteractionInfoMap.put("enhancedMoveToHueAndSaturation", colorControlenhancedMoveToHueAndSaturationInteractionInfo); + threadNetworkDirectoryClusterInteractionInfoMap.put("removeNetwork", threadNetworkDirectoryremoveNetworkInteractionInfo); - Map colorControlcolorLoopSetCommandParams = new LinkedHashMap(); + Map threadNetworkDirectorygetOperationalDatasetCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlcolorLoopSetupdateFlagsCommandParameterInfo = new CommandParameterInfo("updateFlags", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("updateFlags",colorControlcolorLoopSetupdateFlagsCommandParameterInfo); + CommandParameterInfo threadNetworkDirectorygetOperationalDatasetextendedPanIDCommandParameterInfo = new CommandParameterInfo("extendedPanID", byte[].class, byte[].class); + threadNetworkDirectorygetOperationalDatasetCommandParams.put("extendedPanID",threadNetworkDirectorygetOperationalDatasetextendedPanIDCommandParameterInfo); + InteractionInfo threadNetworkDirectorygetOperationalDatasetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) + .getOperationalDataset((ChipClusters.ThreadNetworkDirectoryCluster.OperationalDatasetResponseCallback) callback + , (byte[]) + commandArguments.get("extendedPanID") - CommandParameterInfo colorControlcolorLoopSetactionCommandParameterInfo = new CommandParameterInfo("action", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("action",colorControlcolorLoopSetactionCommandParameterInfo); + ); + }, + () -> new DelegatedThreadNetworkDirectoryClusterOperationalDatasetResponseCallback(), + threadNetworkDirectorygetOperationalDatasetCommandParams + ); + threadNetworkDirectoryClusterInteractionInfoMap.put("getOperationalDataset", threadNetworkDirectorygetOperationalDatasetInteractionInfo); - CommandParameterInfo colorControlcolorLoopSetdirectionCommandParameterInfo = new CommandParameterInfo("direction", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("direction",colorControlcolorLoopSetdirectionCommandParameterInfo); + commandMap.put("threadNetworkDirectory", threadNetworkDirectoryClusterInteractionInfoMap); - CommandParameterInfo colorControlcolorLoopSettimeCommandParameterInfo = new CommandParameterInfo("time", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("time",colorControlcolorLoopSettimeCommandParameterInfo); + Map wakeOnLanClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo colorControlcolorLoopSetstartHueCommandParameterInfo = new CommandParameterInfo("startHue", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("startHue",colorControlcolorLoopSetstartHueCommandParameterInfo); + commandMap.put("wakeOnLan", wakeOnLanClusterInteractionInfoMap); - CommandParameterInfo colorControlcolorLoopSetoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("optionsMask",colorControlcolorLoopSetoptionsMaskCommandParameterInfo); + Map channelClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo colorControlcolorLoopSetoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlcolorLoopSetCommandParams.put("optionsOverride",colorControlcolorLoopSetoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlcolorLoopSetInteractionInfo = new InteractionInfo( + Map channelchangeChannelCommandParams = new LinkedHashMap(); + + CommandParameterInfo channelchangeChannelmatchCommandParameterInfo = new CommandParameterInfo("match", String.class, String.class); + channelchangeChannelCommandParams.put("match",channelchangeChannelmatchCommandParameterInfo); + InteractionInfo channelchangeChannelInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .colorLoopSet((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("updateFlags") - , (Integer) - commandArguments.get("action") - , (Integer) - commandArguments.get("direction") - , (Integer) - commandArguments.get("time") - , (Integer) - commandArguments.get("startHue") - , (Integer) - commandArguments.get("optionsMask") - , (Integer) - commandArguments.get("optionsOverride") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - colorControlcolorLoopSetCommandParams - ); - colorControlClusterInteractionInfoMap.put("colorLoopSet", colorControlcolorLoopSetInteractionInfo); + ((ChipClusters.ChannelCluster) cluster) + .changeChannel((ChipClusters.ChannelCluster.ChangeChannelResponseCallback) callback + , (String) + commandArguments.get("match") - Map colorControlstopMoveStepCommandParams = new LinkedHashMap(); + ); + }, + () -> new DelegatedChannelClusterChangeChannelResponseCallback(), + channelchangeChannelCommandParams + ); + channelClusterInteractionInfoMap.put("changeChannel", channelchangeChannelInteractionInfo); - CommandParameterInfo colorControlstopMoveStepoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlstopMoveStepCommandParams.put("optionsMask",colorControlstopMoveStepoptionsMaskCommandParameterInfo); + Map channelchangeChannelByNumberCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlstopMoveStepoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlstopMoveStepCommandParams.put("optionsOverride",colorControlstopMoveStepoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlstopMoveStepInteractionInfo = new InteractionInfo( + CommandParameterInfo channelchangeChannelByNumbermajorNumberCommandParameterInfo = new CommandParameterInfo("majorNumber", Integer.class, Integer.class); + channelchangeChannelByNumberCommandParams.put("majorNumber",channelchangeChannelByNumbermajorNumberCommandParameterInfo); + + CommandParameterInfo channelchangeChannelByNumberminorNumberCommandParameterInfo = new CommandParameterInfo("minorNumber", Integer.class, Integer.class); + channelchangeChannelByNumberCommandParams.put("minorNumber",channelchangeChannelByNumberminorNumberCommandParameterInfo); + InteractionInfo channelchangeChannelByNumberInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .stopMoveStep((DefaultClusterCallback) callback + ((ChipClusters.ChannelCluster) cluster) + .changeChannelByNumber((DefaultClusterCallback) callback , (Integer) - commandArguments.get("optionsMask") + commandArguments.get("majorNumber") , (Integer) - commandArguments.get("optionsOverride") + commandArguments.get("minorNumber") ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlstopMoveStepCommandParams + channelchangeChannelByNumberCommandParams ); - colorControlClusterInteractionInfoMap.put("stopMoveStep", colorControlstopMoveStepInteractionInfo); - - Map colorControlmoveColorTemperatureCommandParams = new LinkedHashMap(); - - CommandParameterInfo colorControlmoveColorTemperaturemoveModeCommandParameterInfo = new CommandParameterInfo("moveMode", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("moveMode",colorControlmoveColorTemperaturemoveModeCommandParameterInfo); - - CommandParameterInfo colorControlmoveColorTemperaturerateCommandParameterInfo = new CommandParameterInfo("rate", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("rate",colorControlmoveColorTemperaturerateCommandParameterInfo); - - CommandParameterInfo colorControlmoveColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMinimumMireds", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("colorTemperatureMinimumMireds",colorControlmoveColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo); - - CommandParameterInfo colorControlmoveColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMaximumMireds", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("colorTemperatureMaximumMireds",colorControlmoveColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo); + channelClusterInteractionInfoMap.put("changeChannelByNumber", channelchangeChannelByNumberInteractionInfo); - CommandParameterInfo colorControlmoveColorTemperatureoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("optionsMask",colorControlmoveColorTemperatureoptionsMaskCommandParameterInfo); + Map channelskipChannelCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlmoveColorTemperatureoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlmoveColorTemperatureCommandParams.put("optionsOverride",colorControlmoveColorTemperatureoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlmoveColorTemperatureInteractionInfo = new InteractionInfo( + CommandParameterInfo channelskipChannelcountCommandParameterInfo = new CommandParameterInfo("count", Integer.class, Integer.class); + channelskipChannelCommandParams.put("count",channelskipChannelcountCommandParameterInfo); + InteractionInfo channelskipChannelInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .moveColorTemperature((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("moveMode") - , (Integer) - commandArguments.get("rate") - , (Integer) - commandArguments.get("colorTemperatureMinimumMireds") - , (Integer) - commandArguments.get("colorTemperatureMaximumMireds") - , (Integer) - commandArguments.get("optionsMask") + ((ChipClusters.ChannelCluster) cluster) + .skipChannel((DefaultClusterCallback) callback , (Integer) - commandArguments.get("optionsOverride") + commandArguments.get("count") ); }, () -> new DelegatedDefaultClusterCallback(), - colorControlmoveColorTemperatureCommandParams + channelskipChannelCommandParams ); - colorControlClusterInteractionInfoMap.put("moveColorTemperature", colorControlmoveColorTemperatureInteractionInfo); + channelClusterInteractionInfoMap.put("skipChannel", channelskipChannelInteractionInfo); - Map colorControlstepColorTemperatureCommandParams = new LinkedHashMap(); + Map channelgetProgramGuideCommandParams = new LinkedHashMap(); - CommandParameterInfo colorControlstepColorTemperaturestepModeCommandParameterInfo = new CommandParameterInfo("stepMode", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("stepMode",colorControlstepColorTemperaturestepModeCommandParameterInfo); + CommandParameterInfo channelgetProgramGuidestartTimeCommandParameterInfo = new CommandParameterInfo("startTime", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("startTime",channelgetProgramGuidestartTimeCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperaturestepSizeCommandParameterInfo = new CommandParameterInfo("stepSize", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("stepSize",colorControlstepColorTemperaturestepSizeCommandParameterInfo); + CommandParameterInfo channelgetProgramGuideendTimeCommandParameterInfo = new CommandParameterInfo("endTime", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("endTime",channelgetProgramGuideendTimeCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperaturetransitionTimeCommandParameterInfo = new CommandParameterInfo("transitionTime", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("transitionTime",colorControlstepColorTemperaturetransitionTimeCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMinimumMireds", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("colorTemperatureMinimumMireds",colorControlstepColorTemperaturecolorTemperatureMinimumMiredsCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo = new CommandParameterInfo("colorTemperatureMaximumMireds", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("colorTemperatureMaximumMireds",colorControlstepColorTemperaturecolorTemperatureMaximumMiredsCommandParameterInfo); + CommandParameterInfo channelgetProgramGuiderecordingFlagCommandParameterInfo = new CommandParameterInfo("recordingFlag", Optional.class, Long.class); + channelgetProgramGuideCommandParams.put("recordingFlag",channelgetProgramGuiderecordingFlagCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperatureoptionsMaskCommandParameterInfo = new CommandParameterInfo("optionsMask", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("optionsMask",colorControlstepColorTemperatureoptionsMaskCommandParameterInfo); - CommandParameterInfo colorControlstepColorTemperatureoptionsOverrideCommandParameterInfo = new CommandParameterInfo("optionsOverride", Integer.class, Integer.class); - colorControlstepColorTemperatureCommandParams.put("optionsOverride",colorControlstepColorTemperatureoptionsOverrideCommandParameterInfo); - InteractionInfo colorControlstepColorTemperatureInteractionInfo = new InteractionInfo( + CommandParameterInfo channelgetProgramGuidedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, byte[].class); + channelgetProgramGuideCommandParams.put("data",channelgetProgramGuidedataCommandParameterInfo); + InteractionInfo channelgetProgramGuideInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ColorControlCluster) cluster) - .stepColorTemperature((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("stepMode") - , (Integer) - commandArguments.get("stepSize") - , (Integer) - commandArguments.get("transitionTime") - , (Integer) - commandArguments.get("colorTemperatureMinimumMireds") - , (Integer) - commandArguments.get("colorTemperatureMaximumMireds") - , (Integer) - commandArguments.get("optionsMask") - , (Integer) - commandArguments.get("optionsOverride") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - colorControlstepColorTemperatureCommandParams - ); - colorControlClusterInteractionInfoMap.put("stepColorTemperature", colorControlstepColorTemperatureInteractionInfo); + ((ChipClusters.ChannelCluster) cluster) + .getProgramGuide((ChipClusters.ChannelCluster.ProgramGuideResponseCallback) callback + , (Optional) + commandArguments.get("startTime") + + , (Optional) + commandArguments.get("endTime") + + , (Optional>) + commandArguments.get("channelList") + + , (Optional) + commandArguments.get("pageToken") - commandMap.put("colorControl", colorControlClusterInteractionInfoMap); + , (Optional) + commandArguments.get("recordingFlag") - Map ballastConfigurationClusterInteractionInfoMap = new LinkedHashMap<>(); + , (Optional>) + commandArguments.get("externalIDList") - commandMap.put("ballastConfiguration", ballastConfigurationClusterInteractionInfoMap); + , (Optional) + commandArguments.get("data") - Map illuminanceMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + ); + }, + () -> new DelegatedChannelClusterProgramGuideResponseCallback(), + channelgetProgramGuideCommandParams + ); + channelClusterInteractionInfoMap.put("getProgramGuide", channelgetProgramGuideInteractionInfo); - commandMap.put("illuminanceMeasurement", illuminanceMeasurementClusterInteractionInfoMap); + Map channelrecordProgramCommandParams = new LinkedHashMap(); - Map temperatureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo channelrecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); + channelrecordProgramCommandParams.put("programIdentifier",channelrecordProgramprogramIdentifierCommandParameterInfo); - commandMap.put("temperatureMeasurement", temperatureMeasurementClusterInteractionInfoMap); + CommandParameterInfo channelrecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); + channelrecordProgramCommandParams.put("shouldRecordSeries",channelrecordProgramshouldRecordSeriesCommandParameterInfo); - Map pressureMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("pressureMeasurement", pressureMeasurementClusterInteractionInfoMap); + CommandParameterInfo channelrecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); + channelrecordProgramCommandParams.put("data",channelrecordProgramdataCommandParameterInfo); + InteractionInfo channelrecordProgramInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .recordProgram((DefaultClusterCallback) callback + , (String) + commandArguments.get("programIdentifier") + , (Boolean) + commandArguments.get("shouldRecordSeries") + , (ArrayList) + commandArguments.get("externalIDList") + , (byte[]) + commandArguments.get("data") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + channelrecordProgramCommandParams + ); + channelClusterInteractionInfoMap.put("recordProgram", channelrecordProgramInteractionInfo); - Map flowMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map channelcancelRecordProgramCommandParams = new LinkedHashMap(); - commandMap.put("flowMeasurement", flowMeasurementClusterInteractionInfoMap); + CommandParameterInfo channelcancelRecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); + channelcancelRecordProgramCommandParams.put("programIdentifier",channelcancelRecordProgramprogramIdentifierCommandParameterInfo); - Map relativeHumidityMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); + channelcancelRecordProgramCommandParams.put("shouldRecordSeries",channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo); - commandMap.put("relativeHumidityMeasurement", relativeHumidityMeasurementClusterInteractionInfoMap); - Map occupancySensingClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo channelcancelRecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); + channelcancelRecordProgramCommandParams.put("data",channelcancelRecordProgramdataCommandParameterInfo); + InteractionInfo channelcancelRecordProgramInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChannelCluster) cluster) + .cancelRecordProgram((DefaultClusterCallback) callback + , (String) + commandArguments.get("programIdentifier") + , (Boolean) + commandArguments.get("shouldRecordSeries") + , (ArrayList) + commandArguments.get("externalIDList") + , (byte[]) + commandArguments.get("data") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + channelcancelRecordProgramCommandParams + ); + channelClusterInteractionInfoMap.put("cancelRecordProgram", channelcancelRecordProgramInteractionInfo); - commandMap.put("occupancySensing", occupancySensingClusterInteractionInfoMap); + commandMap.put("channel", channelClusterInteractionInfoMap); - Map carbonMonoxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map targetNavigatorClusterInteractionInfoMap = new LinkedHashMap<>(); - commandMap.put("carbonMonoxideConcentrationMeasurement", carbonMonoxideConcentrationMeasurementClusterInteractionInfoMap); + Map targetNavigatornavigateTargetCommandParams = new LinkedHashMap(); - Map carbonDioxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo targetNavigatornavigateTargettargetCommandParameterInfo = new CommandParameterInfo("target", Integer.class, Integer.class); + targetNavigatornavigateTargetCommandParams.put("target",targetNavigatornavigateTargettargetCommandParameterInfo); - commandMap.put("carbonDioxideConcentrationMeasurement", carbonDioxideConcentrationMeasurementClusterInteractionInfoMap); + CommandParameterInfo targetNavigatornavigateTargetdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); + targetNavigatornavigateTargetCommandParams.put("data",targetNavigatornavigateTargetdataCommandParameterInfo); + InteractionInfo targetNavigatornavigateTargetInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TargetNavigatorCluster) cluster) + .navigateTarget((ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback) callback + , (Integer) + commandArguments.get("target") - Map nitrogenDioxideConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + , (Optional) + commandArguments.get("data") - commandMap.put("nitrogenDioxideConcentrationMeasurement", nitrogenDioxideConcentrationMeasurementClusterInteractionInfoMap); + ); + }, + () -> new DelegatedTargetNavigatorClusterNavigateTargetResponseCallback(), + targetNavigatornavigateTargetCommandParams + ); + targetNavigatorClusterInteractionInfoMap.put("navigateTarget", targetNavigatornavigateTargetInteractionInfo); - Map ozoneConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("targetNavigator", targetNavigatorClusterInteractionInfoMap); - commandMap.put("ozoneConcentrationMeasurement", ozoneConcentrationMeasurementClusterInteractionInfoMap); + Map mediaPlaybackClusterInteractionInfoMap = new LinkedHashMap<>(); - Map pm25ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackplayCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackplayInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .play((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackplayCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("play", mediaPlaybackplayInteractionInfo); - commandMap.put("pm25ConcentrationMeasurement", pm25ConcentrationMeasurementClusterInteractionInfoMap); + Map mediaPlaybackpauseCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackpauseInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .pause((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackpauseCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("pause", mediaPlaybackpauseInteractionInfo); - Map formaldehydeConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackstopCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackstopInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .stop((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackstopCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("stop", mediaPlaybackstopInteractionInfo); - commandMap.put("formaldehydeConcentrationMeasurement", formaldehydeConcentrationMeasurementClusterInteractionInfoMap); + Map mediaPlaybackstartOverCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackstartOverInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .startOver((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackstartOverCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("startOver", mediaPlaybackstartOverInteractionInfo); - Map pm1ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackpreviousCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackpreviousInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .previous((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackpreviousCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("previous", mediaPlaybackpreviousInteractionInfo); - commandMap.put("pm1ConcentrationMeasurement", pm1ConcentrationMeasurementClusterInteractionInfoMap); + Map mediaPlaybacknextCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybacknextInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .next((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybacknextCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("next", mediaPlaybacknextInteractionInfo); - Map pm10ConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackrewindCommandParams = new LinkedHashMap(); - commandMap.put("pm10ConcentrationMeasurement", pm10ConcentrationMeasurementClusterInteractionInfoMap); + CommandParameterInfo mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); + mediaPlaybackrewindCommandParams.put("audioAdvanceUnmuted",mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo); + InteractionInfo mediaPlaybackrewindInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .rewind((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Optional) + commandArguments.get("audioAdvanceUnmuted") - Map totalVolatileOrganicCompoundsConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackrewindCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("rewind", mediaPlaybackrewindInteractionInfo); - commandMap.put("totalVolatileOrganicCompoundsConcentrationMeasurement", totalVolatileOrganicCompoundsConcentrationMeasurementClusterInteractionInfoMap); + Map mediaPlaybackfastForwardCommandParams = new LinkedHashMap(); - Map radonConcentrationMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); + mediaPlaybackfastForwardCommandParams.put("audioAdvanceUnmuted",mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo); + InteractionInfo mediaPlaybackfastForwardInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.MediaPlaybackCluster) cluster) + .fastForward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Optional) + commandArguments.get("audioAdvanceUnmuted") - commandMap.put("radonConcentrationMeasurement", radonConcentrationMeasurementClusterInteractionInfoMap); + ); + }, + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackfastForwardCommandParams + ); + mediaPlaybackClusterInteractionInfoMap.put("fastForward", mediaPlaybackfastForwardInteractionInfo); - Map wiFiNetworkManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackskipForwardCommandParams = new LinkedHashMap(); - Map wiFiNetworkManagementnetworkPassphraseRequestCommandParams = new LinkedHashMap(); - InteractionInfo wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo mediaPlaybackskipForwarddeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", Long.class, Long.class); + mediaPlaybackskipForwardCommandParams.put("deltaPositionMilliseconds",mediaPlaybackskipForwarddeltaPositionMillisecondsCommandParameterInfo); + InteractionInfo mediaPlaybackskipForwardInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.WiFiNetworkManagementCluster) cluster) - .networkPassphraseRequest((ChipClusters.WiFiNetworkManagementCluster.NetworkPassphraseResponseCallback) callback + ((ChipClusters.MediaPlaybackCluster) cluster) + .skipForward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Long) + commandArguments.get("deltaPositionMilliseconds") + ); }, - () -> new DelegatedWiFiNetworkManagementClusterNetworkPassphraseResponseCallback(), - wiFiNetworkManagementnetworkPassphraseRequestCommandParams + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackskipForwardCommandParams ); - wiFiNetworkManagementClusterInteractionInfoMap.put("networkPassphraseRequest", wiFiNetworkManagementnetworkPassphraseRequestInteractionInfo); - - commandMap.put("wiFiNetworkManagement", wiFiNetworkManagementClusterInteractionInfoMap); + mediaPlaybackClusterInteractionInfoMap.put("skipForward", mediaPlaybackskipForwardInteractionInfo); - Map threadBorderRouterManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + Map mediaPlaybackskipBackwardCommandParams = new LinkedHashMap(); - Map threadBorderRouterManagementgetActiveDatasetRequestCommandParams = new LinkedHashMap(); - InteractionInfo threadBorderRouterManagementgetActiveDatasetRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo mediaPlaybackskipBackwarddeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", Long.class, Long.class); + mediaPlaybackskipBackwardCommandParams.put("deltaPositionMilliseconds",mediaPlaybackskipBackwarddeltaPositionMillisecondsCommandParameterInfo); + InteractionInfo mediaPlaybackskipBackwardInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) - .getActiveDatasetRequest((ChipClusters.ThreadBorderRouterManagementCluster.DatasetResponseCallback) callback + ((ChipClusters.MediaPlaybackCluster) cluster) + .skipBackward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Long) + commandArguments.get("deltaPositionMilliseconds") + ); }, - () -> new DelegatedThreadBorderRouterManagementClusterDatasetResponseCallback(), - threadBorderRouterManagementgetActiveDatasetRequestCommandParams + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackskipBackwardCommandParams ); - threadBorderRouterManagementClusterInteractionInfoMap.put("getActiveDatasetRequest", threadBorderRouterManagementgetActiveDatasetRequestInteractionInfo); + mediaPlaybackClusterInteractionInfoMap.put("skipBackward", mediaPlaybackskipBackwardInteractionInfo); - Map threadBorderRouterManagementgetPendingDatasetRequestCommandParams = new LinkedHashMap(); - InteractionInfo threadBorderRouterManagementgetPendingDatasetRequestInteractionInfo = new InteractionInfo( + Map mediaPlaybackseekCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaPlaybackseekpositionCommandParameterInfo = new CommandParameterInfo("position", Long.class, Long.class); + mediaPlaybackseekCommandParams.put("position",mediaPlaybackseekpositionCommandParameterInfo); + InteractionInfo mediaPlaybackseekInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) - .getPendingDatasetRequest((ChipClusters.ThreadBorderRouterManagementCluster.DatasetResponseCallback) callback + ((ChipClusters.MediaPlaybackCluster) cluster) + .seek((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + , (Long) + commandArguments.get("position") + ); }, - () -> new DelegatedThreadBorderRouterManagementClusterDatasetResponseCallback(), - threadBorderRouterManagementgetPendingDatasetRequestCommandParams + () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), + mediaPlaybackseekCommandParams ); - threadBorderRouterManagementClusterInteractionInfoMap.put("getPendingDatasetRequest", threadBorderRouterManagementgetPendingDatasetRequestInteractionInfo); + mediaPlaybackClusterInteractionInfoMap.put("seek", mediaPlaybackseekInteractionInfo); - Map threadBorderRouterManagementsetActiveDatasetRequestCommandParams = new LinkedHashMap(); + Map mediaPlaybackactivateAudioTrackCommandParams = new LinkedHashMap(); - CommandParameterInfo threadBorderRouterManagementsetActiveDatasetRequestactiveDatasetCommandParameterInfo = new CommandParameterInfo("activeDataset", byte[].class, byte[].class); - threadBorderRouterManagementsetActiveDatasetRequestCommandParams.put("activeDataset",threadBorderRouterManagementsetActiveDatasetRequestactiveDatasetCommandParameterInfo); + CommandParameterInfo mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); + mediaPlaybackactivateAudioTrackCommandParams.put("trackID",mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo); - CommandParameterInfo threadBorderRouterManagementsetActiveDatasetRequestbreadcrumbCommandParameterInfo = new CommandParameterInfo("breadcrumb", Optional.class, Long.class); - threadBorderRouterManagementsetActiveDatasetRequestCommandParams.put("breadcrumb",threadBorderRouterManagementsetActiveDatasetRequestbreadcrumbCommandParameterInfo); - InteractionInfo threadBorderRouterManagementsetActiveDatasetRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo = new CommandParameterInfo("audioOutputIndex", Integer.class, Integer.class); + mediaPlaybackactivateAudioTrackCommandParams.put("audioOutputIndex",mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo); + InteractionInfo mediaPlaybackactivateAudioTrackInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) - .setActiveDatasetRequest((DefaultClusterCallback) callback - , (byte[]) - commandArguments.get("activeDataset") - , (Optional) - commandArguments.get("breadcrumb") + ((ChipClusters.MediaPlaybackCluster) cluster) + .activateAudioTrack((DefaultClusterCallback) callback + , (String) + commandArguments.get("trackID") + , (Integer) + commandArguments.get("audioOutputIndex") ); }, () -> new DelegatedDefaultClusterCallback(), - threadBorderRouterManagementsetActiveDatasetRequestCommandParams + mediaPlaybackactivateAudioTrackCommandParams ); - threadBorderRouterManagementClusterInteractionInfoMap.put("setActiveDatasetRequest", threadBorderRouterManagementsetActiveDatasetRequestInteractionInfo); + mediaPlaybackClusterInteractionInfoMap.put("activateAudioTrack", mediaPlaybackactivateAudioTrackInteractionInfo); - Map threadBorderRouterManagementsetPendingDatasetRequestCommandParams = new LinkedHashMap(); + Map mediaPlaybackactivateTextTrackCommandParams = new LinkedHashMap(); - CommandParameterInfo threadBorderRouterManagementsetPendingDatasetRequestpendingDatasetCommandParameterInfo = new CommandParameterInfo("pendingDataset", byte[].class, byte[].class); - threadBorderRouterManagementsetPendingDatasetRequestCommandParams.put("pendingDataset",threadBorderRouterManagementsetPendingDatasetRequestpendingDatasetCommandParameterInfo); - InteractionInfo threadBorderRouterManagementsetPendingDatasetRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo mediaPlaybackactivateTextTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); + mediaPlaybackactivateTextTrackCommandParams.put("trackID",mediaPlaybackactivateTextTracktrackIDCommandParameterInfo); + InteractionInfo mediaPlaybackactivateTextTrackInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadBorderRouterManagementCluster) cluster) - .setPendingDatasetRequest((DefaultClusterCallback) callback - , (byte[]) - commandArguments.get("pendingDataset") + ((ChipClusters.MediaPlaybackCluster) cluster) + .activateTextTrack((DefaultClusterCallback) callback + , (String) + commandArguments.get("trackID") ); }, () -> new DelegatedDefaultClusterCallback(), - threadBorderRouterManagementsetPendingDatasetRequestCommandParams + mediaPlaybackactivateTextTrackCommandParams ); - threadBorderRouterManagementClusterInteractionInfoMap.put("setPendingDatasetRequest", threadBorderRouterManagementsetPendingDatasetRequestInteractionInfo); - - commandMap.put("threadBorderRouterManagement", threadBorderRouterManagementClusterInteractionInfoMap); - - Map threadNetworkDirectoryClusterInteractionInfoMap = new LinkedHashMap<>(); - - Map threadNetworkDirectoryaddNetworkCommandParams = new LinkedHashMap(); + mediaPlaybackClusterInteractionInfoMap.put("activateTextTrack", mediaPlaybackactivateTextTrackInteractionInfo); - CommandParameterInfo threadNetworkDirectoryaddNetworkoperationalDatasetCommandParameterInfo = new CommandParameterInfo("operationalDataset", byte[].class, byte[].class); - threadNetworkDirectoryaddNetworkCommandParams.put("operationalDataset",threadNetworkDirectoryaddNetworkoperationalDatasetCommandParameterInfo); - InteractionInfo threadNetworkDirectoryaddNetworkInteractionInfo = new InteractionInfo( + Map mediaPlaybackdeactivateTextTrackCommandParams = new LinkedHashMap(); + InteractionInfo mediaPlaybackdeactivateTextTrackInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) - .addNetwork((DefaultClusterCallback) callback - , (byte[]) - commandArguments.get("operationalDataset"), 10000 + ((ChipClusters.MediaPlaybackCluster) cluster) + .deactivateTextTrack((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - threadNetworkDirectoryaddNetworkCommandParams + mediaPlaybackdeactivateTextTrackCommandParams ); - threadNetworkDirectoryClusterInteractionInfoMap.put("addNetwork", threadNetworkDirectoryaddNetworkInteractionInfo); + mediaPlaybackClusterInteractionInfoMap.put("deactivateTextTrack", mediaPlaybackdeactivateTextTrackInteractionInfo); - Map threadNetworkDirectoryremoveNetworkCommandParams = new LinkedHashMap(); + commandMap.put("mediaPlayback", mediaPlaybackClusterInteractionInfoMap); - CommandParameterInfo threadNetworkDirectoryremoveNetworkextendedPanIDCommandParameterInfo = new CommandParameterInfo("extendedPanID", byte[].class, byte[].class); - threadNetworkDirectoryremoveNetworkCommandParams.put("extendedPanID",threadNetworkDirectoryremoveNetworkextendedPanIDCommandParameterInfo); - InteractionInfo threadNetworkDirectoryremoveNetworkInteractionInfo = new InteractionInfo( + Map mediaInputClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map mediaInputselectInputCommandParams = new LinkedHashMap(); + + CommandParameterInfo mediaInputselectInputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); + mediaInputselectInputCommandParams.put("index",mediaInputselectInputindexCommandParameterInfo); + InteractionInfo mediaInputselectInputInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) - .removeNetwork((DefaultClusterCallback) callback - , (byte[]) - commandArguments.get("extendedPanID"), 10000 + ((ChipClusters.MediaInputCluster) cluster) + .selectInput((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("index") ); }, () -> new DelegatedDefaultClusterCallback(), - threadNetworkDirectoryremoveNetworkCommandParams + mediaInputselectInputCommandParams ); - threadNetworkDirectoryClusterInteractionInfoMap.put("removeNetwork", threadNetworkDirectoryremoveNetworkInteractionInfo); - - Map threadNetworkDirectorygetOperationalDatasetCommandParams = new LinkedHashMap(); - - CommandParameterInfo threadNetworkDirectorygetOperationalDatasetextendedPanIDCommandParameterInfo = new CommandParameterInfo("extendedPanID", byte[].class, byte[].class); - threadNetworkDirectorygetOperationalDatasetCommandParams.put("extendedPanID",threadNetworkDirectorygetOperationalDatasetextendedPanIDCommandParameterInfo); - InteractionInfo threadNetworkDirectorygetOperationalDatasetInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThreadNetworkDirectoryCluster) cluster) - .getOperationalDataset((ChipClusters.ThreadNetworkDirectoryCluster.OperationalDatasetResponseCallback) callback - , (byte[]) - commandArguments.get("extendedPanID") - - ); - }, - () -> new DelegatedThreadNetworkDirectoryClusterOperationalDatasetResponseCallback(), - threadNetworkDirectorygetOperationalDatasetCommandParams - ); - threadNetworkDirectoryClusterInteractionInfoMap.put("getOperationalDataset", threadNetworkDirectorygetOperationalDatasetInteractionInfo); - - commandMap.put("threadNetworkDirectory", threadNetworkDirectoryClusterInteractionInfoMap); - - Map wakeOnLanClusterInteractionInfoMap = new LinkedHashMap<>(); - - commandMap.put("wakeOnLan", wakeOnLanClusterInteractionInfoMap); - - Map channelClusterInteractionInfoMap = new LinkedHashMap<>(); - - Map channelchangeChannelCommandParams = new LinkedHashMap(); - - CommandParameterInfo channelchangeChannelmatchCommandParameterInfo = new CommandParameterInfo("match", String.class, String.class); - channelchangeChannelCommandParams.put("match",channelchangeChannelmatchCommandParameterInfo); - InteractionInfo channelchangeChannelInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .changeChannel((ChipClusters.ChannelCluster.ChangeChannelResponseCallback) callback - , (String) - commandArguments.get("match") - - ); - }, - () -> new DelegatedChannelClusterChangeChannelResponseCallback(), - channelchangeChannelCommandParams - ); - channelClusterInteractionInfoMap.put("changeChannel", channelchangeChannelInteractionInfo); - - Map channelchangeChannelByNumberCommandParams = new LinkedHashMap(); - - CommandParameterInfo channelchangeChannelByNumbermajorNumberCommandParameterInfo = new CommandParameterInfo("majorNumber", Integer.class, Integer.class); - channelchangeChannelByNumberCommandParams.put("majorNumber",channelchangeChannelByNumbermajorNumberCommandParameterInfo); + mediaInputClusterInteractionInfoMap.put("selectInput", mediaInputselectInputInteractionInfo); - CommandParameterInfo channelchangeChannelByNumberminorNumberCommandParameterInfo = new CommandParameterInfo("minorNumber", Integer.class, Integer.class); - channelchangeChannelByNumberCommandParams.put("minorNumber",channelchangeChannelByNumberminorNumberCommandParameterInfo); - InteractionInfo channelchangeChannelByNumberInteractionInfo = new InteractionInfo( + Map mediaInputshowInputStatusCommandParams = new LinkedHashMap(); + InteractionInfo mediaInputshowInputStatusInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .changeChannelByNumber((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("majorNumber") - , (Integer) - commandArguments.get("minorNumber") + ((ChipClusters.MediaInputCluster) cluster) + .showInputStatus((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - channelchangeChannelByNumberCommandParams + mediaInputshowInputStatusCommandParams ); - channelClusterInteractionInfoMap.put("changeChannelByNumber", channelchangeChannelByNumberInteractionInfo); - - Map channelskipChannelCommandParams = new LinkedHashMap(); + mediaInputClusterInteractionInfoMap.put("showInputStatus", mediaInputshowInputStatusInteractionInfo); - CommandParameterInfo channelskipChannelcountCommandParameterInfo = new CommandParameterInfo("count", Integer.class, Integer.class); - channelskipChannelCommandParams.put("count",channelskipChannelcountCommandParameterInfo); - InteractionInfo channelskipChannelInteractionInfo = new InteractionInfo( + Map mediaInputhideInputStatusCommandParams = new LinkedHashMap(); + InteractionInfo mediaInputhideInputStatusInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .skipChannel((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("count") + ((ChipClusters.MediaInputCluster) cluster) + .hideInputStatus((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - channelskipChannelCommandParams + mediaInputhideInputStatusCommandParams ); - channelClusterInteractionInfoMap.put("skipChannel", channelskipChannelInteractionInfo); - - Map channelgetProgramGuideCommandParams = new LinkedHashMap(); - - CommandParameterInfo channelgetProgramGuidestartTimeCommandParameterInfo = new CommandParameterInfo("startTime", Optional.class, Long.class); - channelgetProgramGuideCommandParams.put("startTime",channelgetProgramGuidestartTimeCommandParameterInfo); - - CommandParameterInfo channelgetProgramGuideendTimeCommandParameterInfo = new CommandParameterInfo("endTime", Optional.class, Long.class); - channelgetProgramGuideCommandParams.put("endTime",channelgetProgramGuideendTimeCommandParameterInfo); - - - - CommandParameterInfo channelgetProgramGuiderecordingFlagCommandParameterInfo = new CommandParameterInfo("recordingFlag", Optional.class, Long.class); - channelgetProgramGuideCommandParams.put("recordingFlag",channelgetProgramGuiderecordingFlagCommandParameterInfo); - - - CommandParameterInfo channelgetProgramGuidedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, byte[].class); - channelgetProgramGuideCommandParams.put("data",channelgetProgramGuidedataCommandParameterInfo); - InteractionInfo channelgetProgramGuideInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .getProgramGuide((ChipClusters.ChannelCluster.ProgramGuideResponseCallback) callback - , (Optional) - commandArguments.get("startTime") - - , (Optional) - commandArguments.get("endTime") - - , (Optional>) - commandArguments.get("channelList") - - , (Optional) - commandArguments.get("pageToken") - - , (Optional) - commandArguments.get("recordingFlag") - - , (Optional>) - commandArguments.get("externalIDList") - - , (Optional) - commandArguments.get("data") - - ); - }, - () -> new DelegatedChannelClusterProgramGuideResponseCallback(), - channelgetProgramGuideCommandParams - ); - channelClusterInteractionInfoMap.put("getProgramGuide", channelgetProgramGuideInteractionInfo); - - Map channelrecordProgramCommandParams = new LinkedHashMap(); - - CommandParameterInfo channelrecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); - channelrecordProgramCommandParams.put("programIdentifier",channelrecordProgramprogramIdentifierCommandParameterInfo); + mediaInputClusterInteractionInfoMap.put("hideInputStatus", mediaInputhideInputStatusInteractionInfo); - CommandParameterInfo channelrecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); - channelrecordProgramCommandParams.put("shouldRecordSeries",channelrecordProgramshouldRecordSeriesCommandParameterInfo); + Map mediaInputrenameInputCommandParams = new LinkedHashMap(); + CommandParameterInfo mediaInputrenameInputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); + mediaInputrenameInputCommandParams.put("index",mediaInputrenameInputindexCommandParameterInfo); - CommandParameterInfo channelrecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); - channelrecordProgramCommandParams.put("data",channelrecordProgramdataCommandParameterInfo); - InteractionInfo channelrecordProgramInteractionInfo = new InteractionInfo( + CommandParameterInfo mediaInputrenameInputnameCommandParameterInfo = new CommandParameterInfo("name", String.class, String.class); + mediaInputrenameInputCommandParams.put("name",mediaInputrenameInputnameCommandParameterInfo); + InteractionInfo mediaInputrenameInputInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .recordProgram((DefaultClusterCallback) callback + ((ChipClusters.MediaInputCluster) cluster) + .renameInput((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("index") , (String) - commandArguments.get("programIdentifier") - , (Boolean) - commandArguments.get("shouldRecordSeries") - , (ArrayList) - commandArguments.get("externalIDList") - , (byte[]) - commandArguments.get("data") + commandArguments.get("name") ); }, () -> new DelegatedDefaultClusterCallback(), - channelrecordProgramCommandParams + mediaInputrenameInputCommandParams ); - channelClusterInteractionInfoMap.put("recordProgram", channelrecordProgramInteractionInfo); - - Map channelcancelRecordProgramCommandParams = new LinkedHashMap(); - - CommandParameterInfo channelcancelRecordProgramprogramIdentifierCommandParameterInfo = new CommandParameterInfo("programIdentifier", String.class, String.class); - channelcancelRecordProgramCommandParams.put("programIdentifier",channelcancelRecordProgramprogramIdentifierCommandParameterInfo); + mediaInputClusterInteractionInfoMap.put("renameInput", mediaInputrenameInputInteractionInfo); - CommandParameterInfo channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo = new CommandParameterInfo("shouldRecordSeries", Boolean.class, Boolean.class); - channelcancelRecordProgramCommandParams.put("shouldRecordSeries",channelcancelRecordProgramshouldRecordSeriesCommandParameterInfo); + commandMap.put("mediaInput", mediaInputClusterInteractionInfoMap); + Map lowPowerClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo channelcancelRecordProgramdataCommandParameterInfo = new CommandParameterInfo("data", byte[].class, byte[].class); - channelcancelRecordProgramCommandParams.put("data",channelcancelRecordProgramdataCommandParameterInfo); - InteractionInfo channelcancelRecordProgramInteractionInfo = new InteractionInfo( + Map lowPowersleepCommandParams = new LinkedHashMap(); + InteractionInfo lowPowersleepInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChannelCluster) cluster) - .cancelRecordProgram((DefaultClusterCallback) callback - , (String) - commandArguments.get("programIdentifier") - , (Boolean) - commandArguments.get("shouldRecordSeries") - , (ArrayList) - commandArguments.get("externalIDList") - , (byte[]) - commandArguments.get("data") + ((ChipClusters.LowPowerCluster) cluster) + .sleep((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - channelcancelRecordProgramCommandParams + lowPowersleepCommandParams ); - channelClusterInteractionInfoMap.put("cancelRecordProgram", channelcancelRecordProgramInteractionInfo); - - commandMap.put("channel", channelClusterInteractionInfoMap); + lowPowerClusterInteractionInfoMap.put("sleep", lowPowersleepInteractionInfo); - Map targetNavigatorClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("lowPower", lowPowerClusterInteractionInfoMap); - Map targetNavigatornavigateTargetCommandParams = new LinkedHashMap(); + Map keypadInputClusterInteractionInfoMap = new LinkedHashMap<>(); - CommandParameterInfo targetNavigatornavigateTargettargetCommandParameterInfo = new CommandParameterInfo("target", Integer.class, Integer.class); - targetNavigatornavigateTargetCommandParams.put("target",targetNavigatornavigateTargettargetCommandParameterInfo); + Map keypadInputsendKeyCommandParams = new LinkedHashMap(); - CommandParameterInfo targetNavigatornavigateTargetdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); - targetNavigatornavigateTargetCommandParams.put("data",targetNavigatornavigateTargetdataCommandParameterInfo); - InteractionInfo targetNavigatornavigateTargetInteractionInfo = new InteractionInfo( + CommandParameterInfo keypadInputsendKeykeyCodeCommandParameterInfo = new CommandParameterInfo("keyCode", Integer.class, Integer.class); + keypadInputsendKeyCommandParams.put("keyCode",keypadInputsendKeykeyCodeCommandParameterInfo); + InteractionInfo keypadInputsendKeyInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.TargetNavigatorCluster) cluster) - .navigateTarget((ChipClusters.TargetNavigatorCluster.NavigateTargetResponseCallback) callback + ((ChipClusters.KeypadInputCluster) cluster) + .sendKey((ChipClusters.KeypadInputCluster.SendKeyResponseCallback) callback , (Integer) - commandArguments.get("target") - - , (Optional) - commandArguments.get("data") + commandArguments.get("keyCode") ); }, - () -> new DelegatedTargetNavigatorClusterNavigateTargetResponseCallback(), - targetNavigatornavigateTargetCommandParams + () -> new DelegatedKeypadInputClusterSendKeyResponseCallback(), + keypadInputsendKeyCommandParams ); - targetNavigatorClusterInteractionInfoMap.put("navigateTarget", targetNavigatornavigateTargetInteractionInfo); + keypadInputClusterInteractionInfoMap.put("sendKey", keypadInputsendKeyInteractionInfo); - commandMap.put("targetNavigator", targetNavigatorClusterInteractionInfoMap); + commandMap.put("keypadInput", keypadInputClusterInteractionInfoMap); - Map mediaPlaybackClusterInteractionInfoMap = new LinkedHashMap<>(); + Map contentLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); - Map mediaPlaybackplayCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackplayInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .play((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - ); - }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackplayCommandParams - ); - mediaPlaybackClusterInteractionInfoMap.put("play", mediaPlaybackplayInteractionInfo); + Map contentLauncherlaunchContentCommandParams = new LinkedHashMap(); - Map mediaPlaybackpauseCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackpauseInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .pause((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - ); - }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackpauseCommandParams - ); - mediaPlaybackClusterInteractionInfoMap.put("pause", mediaPlaybackpauseInteractionInfo); - Map mediaPlaybackstopCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackstopInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .stop((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - ); - }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackstopCommandParams - ); - mediaPlaybackClusterInteractionInfoMap.put("stop", mediaPlaybackstopInteractionInfo); + CommandParameterInfo contentLauncherlaunchContentautoPlayCommandParameterInfo = new CommandParameterInfo("autoPlay", Boolean.class, Boolean.class); + contentLauncherlaunchContentCommandParams.put("autoPlay",contentLauncherlaunchContentautoPlayCommandParameterInfo); - Map mediaPlaybackstartOverCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackstartOverInteractionInfo = new InteractionInfo( + CommandParameterInfo contentLauncherlaunchContentdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); + contentLauncherlaunchContentCommandParams.put("data",contentLauncherlaunchContentdataCommandParameterInfo); + + + CommandParameterInfo contentLauncherlaunchContentuseCurrentContextCommandParameterInfo = new CommandParameterInfo("useCurrentContext", Optional.class, Boolean.class); + contentLauncherlaunchContentCommandParams.put("useCurrentContext",contentLauncherlaunchContentuseCurrentContextCommandParameterInfo); + InteractionInfo contentLauncherlaunchContentInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .startOver((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ((ChipClusters.ContentLauncherCluster) cluster) + .launchContent((ChipClusters.ContentLauncherCluster.LauncherResponseCallback) callback + , (ChipStructs.ContentLauncherClusterContentSearchStruct) + commandArguments.get("search") + + , (Boolean) + commandArguments.get("autoPlay") + + , (Optional) + commandArguments.get("data") + + , (Optional) + commandArguments.get("playbackPreferences") + + , (Optional) + commandArguments.get("useCurrentContext") + ); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackstartOverCommandParams + () -> new DelegatedContentLauncherClusterLauncherResponseCallback(), + contentLauncherlaunchContentCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("startOver", mediaPlaybackstartOverInteractionInfo); + contentLauncherClusterInteractionInfoMap.put("launchContent", contentLauncherlaunchContentInteractionInfo); - Map mediaPlaybackpreviousCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackpreviousInteractionInfo = new InteractionInfo( + Map contentLauncherlaunchURLCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentLauncherlaunchURLcontentURLCommandParameterInfo = new CommandParameterInfo("contentURL", String.class, String.class); + contentLauncherlaunchURLCommandParams.put("contentURL",contentLauncherlaunchURLcontentURLCommandParameterInfo); + + CommandParameterInfo contentLauncherlaunchURLdisplayStringCommandParameterInfo = new CommandParameterInfo("displayString", Optional.class, String.class); + contentLauncherlaunchURLCommandParams.put("displayString",contentLauncherlaunchURLdisplayStringCommandParameterInfo); + + InteractionInfo contentLauncherlaunchURLInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .previous((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback + ((ChipClusters.ContentLauncherCluster) cluster) + .launchURL((ChipClusters.ContentLauncherCluster.LauncherResponseCallback) callback + , (String) + commandArguments.get("contentURL") + + , (Optional) + commandArguments.get("displayString") + + , (Optional) + commandArguments.get("brandingInformation") + ); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackpreviousCommandParams + () -> new DelegatedContentLauncherClusterLauncherResponseCallback(), + contentLauncherlaunchURLCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("previous", mediaPlaybackpreviousInteractionInfo); + contentLauncherClusterInteractionInfoMap.put("launchURL", contentLauncherlaunchURLInteractionInfo); - Map mediaPlaybacknextCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybacknextInteractionInfo = new InteractionInfo( + commandMap.put("contentLauncher", contentLauncherClusterInteractionInfoMap); + + Map audioOutputClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map audioOutputselectOutputCommandParams = new LinkedHashMap(); + + CommandParameterInfo audioOutputselectOutputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); + audioOutputselectOutputCommandParams.put("index",audioOutputselectOutputindexCommandParameterInfo); + InteractionInfo audioOutputselectOutputInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .next((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - ); - }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybacknextCommandParams - ); - mediaPlaybackClusterInteractionInfoMap.put("next", mediaPlaybacknextInteractionInfo); + ((ChipClusters.AudioOutputCluster) cluster) + .selectOutput((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("index") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + audioOutputselectOutputCommandParams + ); + audioOutputClusterInteractionInfoMap.put("selectOutput", audioOutputselectOutputInteractionInfo); - Map mediaPlaybackrewindCommandParams = new LinkedHashMap(); + Map audioOutputrenameOutputCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); - mediaPlaybackrewindCommandParams.put("audioAdvanceUnmuted",mediaPlaybackrewindaudioAdvanceUnmutedCommandParameterInfo); - InteractionInfo mediaPlaybackrewindInteractionInfo = new InteractionInfo( + CommandParameterInfo audioOutputrenameOutputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); + audioOutputrenameOutputCommandParams.put("index",audioOutputrenameOutputindexCommandParameterInfo); + + CommandParameterInfo audioOutputrenameOutputnameCommandParameterInfo = new CommandParameterInfo("name", String.class, String.class); + audioOutputrenameOutputCommandParams.put("name",audioOutputrenameOutputnameCommandParameterInfo); + InteractionInfo audioOutputrenameOutputInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .rewind((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - , (Optional) - commandArguments.get("audioAdvanceUnmuted") + ((ChipClusters.AudioOutputCluster) cluster) + .renameOutput((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("index") + , (String) + commandArguments.get("name") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + audioOutputrenameOutputCommandParams + ); + audioOutputClusterInteractionInfoMap.put("renameOutput", audioOutputrenameOutputInteractionInfo); - ); - }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackrewindCommandParams - ); - mediaPlaybackClusterInteractionInfoMap.put("rewind", mediaPlaybackrewindInteractionInfo); + commandMap.put("audioOutput", audioOutputClusterInteractionInfoMap); + + Map applicationLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map applicationLauncherlaunchAppCommandParams = new LinkedHashMap(); - Map mediaPlaybackfastForwardCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo = new CommandParameterInfo("audioAdvanceUnmuted", Optional.class, Boolean.class); - mediaPlaybackfastForwardCommandParams.put("audioAdvanceUnmuted",mediaPlaybackfastForwardaudioAdvanceUnmutedCommandParameterInfo); - InteractionInfo mediaPlaybackfastForwardInteractionInfo = new InteractionInfo( + CommandParameterInfo applicationLauncherlaunchAppdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, byte[].class); + applicationLauncherlaunchAppCommandParams.put("data",applicationLauncherlaunchAppdataCommandParameterInfo); + InteractionInfo applicationLauncherlaunchAppInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .fastForward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - , (Optional) - commandArguments.get("audioAdvanceUnmuted") + ((ChipClusters.ApplicationLauncherCluster) cluster) + .launchApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback + , (Optional) + commandArguments.get("application") + + , (Optional) + commandArguments.get("data") ); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackfastForwardCommandParams + () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), + applicationLauncherlaunchAppCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("fastForward", mediaPlaybackfastForwardInteractionInfo); + applicationLauncherClusterInteractionInfoMap.put("launchApp", applicationLauncherlaunchAppInteractionInfo); - Map mediaPlaybackskipForwardCommandParams = new LinkedHashMap(); + Map applicationLauncherstopAppCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackskipForwarddeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", Long.class, Long.class); - mediaPlaybackskipForwardCommandParams.put("deltaPositionMilliseconds",mediaPlaybackskipForwarddeltaPositionMillisecondsCommandParameterInfo); - InteractionInfo mediaPlaybackskipForwardInteractionInfo = new InteractionInfo( + InteractionInfo applicationLauncherstopAppInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .skipForward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - , (Long) - commandArguments.get("deltaPositionMilliseconds") + ((ChipClusters.ApplicationLauncherCluster) cluster) + .stopApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback + , (Optional) + commandArguments.get("application") ); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackskipForwardCommandParams + () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), + applicationLauncherstopAppCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("skipForward", mediaPlaybackskipForwardInteractionInfo); + applicationLauncherClusterInteractionInfoMap.put("stopApp", applicationLauncherstopAppInteractionInfo); - Map mediaPlaybackskipBackwardCommandParams = new LinkedHashMap(); + Map applicationLauncherhideAppCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackskipBackwarddeltaPositionMillisecondsCommandParameterInfo = new CommandParameterInfo("deltaPositionMilliseconds", Long.class, Long.class); - mediaPlaybackskipBackwardCommandParams.put("deltaPositionMilliseconds",mediaPlaybackskipBackwarddeltaPositionMillisecondsCommandParameterInfo); - InteractionInfo mediaPlaybackskipBackwardInteractionInfo = new InteractionInfo( + InteractionInfo applicationLauncherhideAppInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .skipBackward((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - , (Long) - commandArguments.get("deltaPositionMilliseconds") + ((ChipClusters.ApplicationLauncherCluster) cluster) + .hideApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback + , (Optional) + commandArguments.get("application") ); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackskipBackwardCommandParams + () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), + applicationLauncherhideAppCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("skipBackward", mediaPlaybackskipBackwardInteractionInfo); + applicationLauncherClusterInteractionInfoMap.put("hideApp", applicationLauncherhideAppInteractionInfo); - Map mediaPlaybackseekCommandParams = new LinkedHashMap(); + commandMap.put("applicationLauncher", applicationLauncherClusterInteractionInfoMap); - CommandParameterInfo mediaPlaybackseekpositionCommandParameterInfo = new CommandParameterInfo("position", Long.class, Long.class); - mediaPlaybackseekCommandParams.put("position",mediaPlaybackseekpositionCommandParameterInfo); - InteractionInfo mediaPlaybackseekInteractionInfo = new InteractionInfo( + Map applicationBasicClusterInteractionInfoMap = new LinkedHashMap<>(); + + commandMap.put("applicationBasic", applicationBasicClusterInteractionInfoMap); + + Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map accountLogingetSetupPINCommandParams = new LinkedHashMap(); + + CommandParameterInfo accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class, String.class); + accountLogingetSetupPINCommandParams.put("tempAccountIdentifier",accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo); + InteractionInfo accountLogingetSetupPINInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .seek((ChipClusters.MediaPlaybackCluster.PlaybackResponseCallback) callback - , (Long) - commandArguments.get("position") + ((ChipClusters.AccountLoginCluster) cluster) + .getSetupPIN((ChipClusters.AccountLoginCluster.GetSetupPINResponseCallback) callback + , (String) + commandArguments.get("tempAccountIdentifier") - ); + , 10000); }, - () -> new DelegatedMediaPlaybackClusterPlaybackResponseCallback(), - mediaPlaybackseekCommandParams + () -> new DelegatedAccountLoginClusterGetSetupPINResponseCallback(), + accountLogingetSetupPINCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("seek", mediaPlaybackseekInteractionInfo); + accountLoginClusterInteractionInfoMap.put("getSetupPIN", accountLogingetSetupPINInteractionInfo); - Map mediaPlaybackactivateAudioTrackCommandParams = new LinkedHashMap(); + Map accountLoginloginCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); - mediaPlaybackactivateAudioTrackCommandParams.put("trackID",mediaPlaybackactivateAudioTracktrackIDCommandParameterInfo); + CommandParameterInfo accountLoginlogintempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class, String.class); + accountLoginloginCommandParams.put("tempAccountIdentifier",accountLoginlogintempAccountIdentifierCommandParameterInfo); - CommandParameterInfo mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo = new CommandParameterInfo("audioOutputIndex", Integer.class, Integer.class); - mediaPlaybackactivateAudioTrackCommandParams.put("audioOutputIndex",mediaPlaybackactivateAudioTrackaudioOutputIndexCommandParameterInfo); - InteractionInfo mediaPlaybackactivateAudioTrackInteractionInfo = new InteractionInfo( + CommandParameterInfo accountLoginloginsetupPINCommandParameterInfo = new CommandParameterInfo("setupPIN", String.class, String.class); + accountLoginloginCommandParams.put("setupPIN",accountLoginloginsetupPINCommandParameterInfo); + + CommandParameterInfo accountLoginloginnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); + accountLoginloginCommandParams.put("node",accountLoginloginnodeCommandParameterInfo); + InteractionInfo accountLoginloginInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .activateAudioTrack((DefaultClusterCallback) callback + ((ChipClusters.AccountLoginCluster) cluster) + .login((DefaultClusterCallback) callback , (String) - commandArguments.get("trackID") - , (Integer) - commandArguments.get("audioOutputIndex") + commandArguments.get("tempAccountIdentifier") + , (String) + commandArguments.get("setupPIN") + , (Optional) + commandArguments.get("node"), 10000 ); }, () -> new DelegatedDefaultClusterCallback(), - mediaPlaybackactivateAudioTrackCommandParams + accountLoginloginCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("activateAudioTrack", mediaPlaybackactivateAudioTrackInteractionInfo); + accountLoginClusterInteractionInfoMap.put("login", accountLoginloginInteractionInfo); - Map mediaPlaybackactivateTextTrackCommandParams = new LinkedHashMap(); + Map accountLoginlogoutCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaPlaybackactivateTextTracktrackIDCommandParameterInfo = new CommandParameterInfo("trackID", String.class, String.class); - mediaPlaybackactivateTextTrackCommandParams.put("trackID",mediaPlaybackactivateTextTracktrackIDCommandParameterInfo); - InteractionInfo mediaPlaybackactivateTextTrackInteractionInfo = new InteractionInfo( + CommandParameterInfo accountLoginlogoutnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); + accountLoginlogoutCommandParams.put("node",accountLoginlogoutnodeCommandParameterInfo); + InteractionInfo accountLoginlogoutInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .activateTextTrack((DefaultClusterCallback) callback + ((ChipClusters.AccountLoginCluster) cluster) + .logout((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("node"), 10000 + ); + }, + () -> new DelegatedDefaultClusterCallback(), + accountLoginlogoutCommandParams + ); + accountLoginClusterInteractionInfoMap.put("logout", accountLoginlogoutInteractionInfo); + + commandMap.put("accountLogin", accountLoginClusterInteractionInfoMap); + + Map contentControlClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map contentControlupdatePINCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlupdatePINoldPINCommandParameterInfo = new CommandParameterInfo("oldPIN", Optional.class, String.class); + contentControlupdatePINCommandParams.put("oldPIN",contentControlupdatePINoldPINCommandParameterInfo); + + CommandParameterInfo contentControlupdatePINnewPINCommandParameterInfo = new CommandParameterInfo("newPIN", String.class, String.class); + contentControlupdatePINCommandParams.put("newPIN",contentControlupdatePINnewPINCommandParameterInfo); + InteractionInfo contentControlupdatePINInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .updatePIN((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("oldPIN") , (String) - commandArguments.get("trackID") + commandArguments.get("newPIN") ); }, () -> new DelegatedDefaultClusterCallback(), - mediaPlaybackactivateTextTrackCommandParams + contentControlupdatePINCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("activateTextTrack", mediaPlaybackactivateTextTrackInteractionInfo); + contentControlClusterInteractionInfoMap.put("updatePIN", contentControlupdatePINInteractionInfo); - Map mediaPlaybackdeactivateTextTrackCommandParams = new LinkedHashMap(); - InteractionInfo mediaPlaybackdeactivateTextTrackInteractionInfo = new InteractionInfo( + Map contentControlresetPINCommandParams = new LinkedHashMap(); + InteractionInfo contentControlresetPINInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaPlaybackCluster) cluster) - .deactivateTextTrack((DefaultClusterCallback) callback + ((ChipClusters.ContentControlCluster) cluster) + .resetPIN((ChipClusters.ContentControlCluster.ResetPINResponseCallback) callback + ); + }, + () -> new DelegatedContentControlClusterResetPINResponseCallback(), + contentControlresetPINCommandParams + ); + contentControlClusterInteractionInfoMap.put("resetPIN", contentControlresetPINInteractionInfo); + + Map contentControlenableCommandParams = new LinkedHashMap(); + InteractionInfo contentControlenableInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .enable((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - mediaPlaybackdeactivateTextTrackCommandParams + contentControlenableCommandParams ); - mediaPlaybackClusterInteractionInfoMap.put("deactivateTextTrack", mediaPlaybackdeactivateTextTrackInteractionInfo); + contentControlClusterInteractionInfoMap.put("enable", contentControlenableInteractionInfo); - commandMap.put("mediaPlayback", mediaPlaybackClusterInteractionInfoMap); + Map contentControldisableCommandParams = new LinkedHashMap(); + InteractionInfo contentControldisableInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .disable((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControldisableCommandParams + ); + contentControlClusterInteractionInfoMap.put("disable", contentControldisableInteractionInfo); - Map mediaInputClusterInteractionInfoMap = new LinkedHashMap<>(); + Map contentControladdBonusTimeCommandParams = new LinkedHashMap(); - Map mediaInputselectInputCommandParams = new LinkedHashMap(); + CommandParameterInfo contentControladdBonusTimePINCodeCommandParameterInfo = new CommandParameterInfo("PINCode", Optional.class, String.class); + contentControladdBonusTimeCommandParams.put("PINCode",contentControladdBonusTimePINCodeCommandParameterInfo); - CommandParameterInfo mediaInputselectInputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); - mediaInputselectInputCommandParams.put("index",mediaInputselectInputindexCommandParameterInfo); - InteractionInfo mediaInputselectInputInteractionInfo = new InteractionInfo( + CommandParameterInfo contentControladdBonusTimebonusTimeCommandParameterInfo = new CommandParameterInfo("bonusTime", Optional.class, Long.class); + contentControladdBonusTimeCommandParams.put("bonusTime",contentControladdBonusTimebonusTimeCommandParameterInfo); + InteractionInfo contentControladdBonusTimeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .selectInput((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("index") + ((ChipClusters.ContentControlCluster) cluster) + .addBonusTime((DefaultClusterCallback) callback + , (Optional) + commandArguments.get("PINCode") + , (Optional) + commandArguments.get("bonusTime") ); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputselectInputCommandParams + contentControladdBonusTimeCommandParams ); - mediaInputClusterInteractionInfoMap.put("selectInput", mediaInputselectInputInteractionInfo); + contentControlClusterInteractionInfoMap.put("addBonusTime", contentControladdBonusTimeInteractionInfo); - Map mediaInputshowInputStatusCommandParams = new LinkedHashMap(); - InteractionInfo mediaInputshowInputStatusInteractionInfo = new InteractionInfo( + Map contentControlsetScreenDailyTimeCommandParams = new LinkedHashMap(); + + CommandParameterInfo contentControlsetScreenDailyTimescreenTimeCommandParameterInfo = new CommandParameterInfo("screenTime", Long.class, Long.class); + contentControlsetScreenDailyTimeCommandParams.put("screenTime",contentControlsetScreenDailyTimescreenTimeCommandParameterInfo); + InteractionInfo contentControlsetScreenDailyTimeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .showInputStatus((DefaultClusterCallback) callback + ((ChipClusters.ContentControlCluster) cluster) + .setScreenDailyTime((DefaultClusterCallback) callback + , (Long) + commandArguments.get("screenTime") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + contentControlsetScreenDailyTimeCommandParams + ); + contentControlClusterInteractionInfoMap.put("setScreenDailyTime", contentControlsetScreenDailyTimeInteractionInfo); + + Map contentControlblockUnratedContentCommandParams = new LinkedHashMap(); + InteractionInfo contentControlblockUnratedContentInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ContentControlCluster) cluster) + .blockUnratedContent((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputshowInputStatusCommandParams + contentControlblockUnratedContentCommandParams ); - mediaInputClusterInteractionInfoMap.put("showInputStatus", mediaInputshowInputStatusInteractionInfo); + contentControlClusterInteractionInfoMap.put("blockUnratedContent", contentControlblockUnratedContentInteractionInfo); - Map mediaInputhideInputStatusCommandParams = new LinkedHashMap(); - InteractionInfo mediaInputhideInputStatusInteractionInfo = new InteractionInfo( + Map contentControlunblockUnratedContentCommandParams = new LinkedHashMap(); + InteractionInfo contentControlunblockUnratedContentInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .hideInputStatus((DefaultClusterCallback) callback + ((ChipClusters.ContentControlCluster) cluster) + .unblockUnratedContent((DefaultClusterCallback) callback ); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputhideInputStatusCommandParams + contentControlunblockUnratedContentCommandParams ); - mediaInputClusterInteractionInfoMap.put("hideInputStatus", mediaInputhideInputStatusInteractionInfo); - - Map mediaInputrenameInputCommandParams = new LinkedHashMap(); + contentControlClusterInteractionInfoMap.put("unblockUnratedContent", contentControlunblockUnratedContentInteractionInfo); - CommandParameterInfo mediaInputrenameInputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); - mediaInputrenameInputCommandParams.put("index",mediaInputrenameInputindexCommandParameterInfo); + Map contentControlsetOnDemandRatingThresholdCommandParams = new LinkedHashMap(); - CommandParameterInfo mediaInputrenameInputnameCommandParameterInfo = new CommandParameterInfo("name", String.class, String.class); - mediaInputrenameInputCommandParams.put("name",mediaInputrenameInputnameCommandParameterInfo); - InteractionInfo mediaInputrenameInputInteractionInfo = new InteractionInfo( + CommandParameterInfo contentControlsetOnDemandRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); + contentControlsetOnDemandRatingThresholdCommandParams.put("rating",contentControlsetOnDemandRatingThresholdratingCommandParameterInfo); + InteractionInfo contentControlsetOnDemandRatingThresholdInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.MediaInputCluster) cluster) - .renameInput((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("index") + ((ChipClusters.ContentControlCluster) cluster) + .setOnDemandRatingThreshold((DefaultClusterCallback) callback , (String) - commandArguments.get("name") + commandArguments.get("rating") ); }, () -> new DelegatedDefaultClusterCallback(), - mediaInputrenameInputCommandParams + contentControlsetOnDemandRatingThresholdCommandParams ); - mediaInputClusterInteractionInfoMap.put("renameInput", mediaInputrenameInputInteractionInfo); - - commandMap.put("mediaInput", mediaInputClusterInteractionInfoMap); + contentControlClusterInteractionInfoMap.put("setOnDemandRatingThreshold", contentControlsetOnDemandRatingThresholdInteractionInfo); - Map lowPowerClusterInteractionInfoMap = new LinkedHashMap<>(); + Map contentControlsetScheduledContentRatingThresholdCommandParams = new LinkedHashMap(); - Map lowPowersleepCommandParams = new LinkedHashMap(); - InteractionInfo lowPowersleepInteractionInfo = new InteractionInfo( + CommandParameterInfo contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); + contentControlsetScheduledContentRatingThresholdCommandParams.put("rating",contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo); + InteractionInfo contentControlsetScheduledContentRatingThresholdInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.LowPowerCluster) cluster) - .sleep((DefaultClusterCallback) callback + ((ChipClusters.ContentControlCluster) cluster) + .setScheduledContentRatingThreshold((DefaultClusterCallback) callback + , (String) + commandArguments.get("rating") ); }, () -> new DelegatedDefaultClusterCallback(), - lowPowersleepCommandParams + contentControlsetScheduledContentRatingThresholdCommandParams ); - lowPowerClusterInteractionInfoMap.put("sleep", lowPowersleepInteractionInfo); + contentControlClusterInteractionInfoMap.put("setScheduledContentRatingThreshold", contentControlsetScheduledContentRatingThresholdInteractionInfo); - commandMap.put("lowPower", lowPowerClusterInteractionInfoMap); + commandMap.put("contentControl", contentControlClusterInteractionInfoMap); - Map keypadInputClusterInteractionInfoMap = new LinkedHashMap<>(); + Map contentAppObserverClusterInteractionInfoMap = new LinkedHashMap<>(); - Map keypadInputsendKeyCommandParams = new LinkedHashMap(); + Map contentAppObservercontentAppMessageCommandParams = new LinkedHashMap(); - CommandParameterInfo keypadInputsendKeykeyCodeCommandParameterInfo = new CommandParameterInfo("keyCode", Integer.class, Integer.class); - keypadInputsendKeyCommandParams.put("keyCode",keypadInputsendKeykeyCodeCommandParameterInfo); - InteractionInfo keypadInputsendKeyInteractionInfo = new InteractionInfo( + CommandParameterInfo contentAppObservercontentAppMessagedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); + contentAppObservercontentAppMessageCommandParams.put("data",contentAppObservercontentAppMessagedataCommandParameterInfo); + + CommandParameterInfo contentAppObservercontentAppMessageencodingHintCommandParameterInfo = new CommandParameterInfo("encodingHint", String.class, String.class); + contentAppObservercontentAppMessageCommandParams.put("encodingHint",contentAppObservercontentAppMessageencodingHintCommandParameterInfo); + InteractionInfo contentAppObservercontentAppMessageInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.KeypadInputCluster) cluster) - .sendKey((ChipClusters.KeypadInputCluster.SendKeyResponseCallback) callback - , (Integer) - commandArguments.get("keyCode") + ((ChipClusters.ContentAppObserverCluster) cluster) + .contentAppMessage((ChipClusters.ContentAppObserverCluster.ContentAppMessageResponseCallback) callback + , (Optional) + commandArguments.get("data") + + , (String) + commandArguments.get("encodingHint") ); }, - () -> new DelegatedKeypadInputClusterSendKeyResponseCallback(), - keypadInputsendKeyCommandParams + () -> new DelegatedContentAppObserverClusterContentAppMessageResponseCallback(), + contentAppObservercontentAppMessageCommandParams ); - keypadInputClusterInteractionInfoMap.put("sendKey", keypadInputsendKeyInteractionInfo); + contentAppObserverClusterInteractionInfoMap.put("contentAppMessage", contentAppObservercontentAppMessageInteractionInfo); - commandMap.put("keypadInput", keypadInputClusterInteractionInfoMap); + commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); - Map contentLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); + Map zoneManagementClusterInteractionInfoMap = new LinkedHashMap<>(); - Map contentLauncherlaunchContentCommandParams = new LinkedHashMap(); + Map zoneManagementcreateTwoDCartesianZoneCommandParams = new LinkedHashMap(); + InteractionInfo zoneManagementcreateTwoDCartesianZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .createTwoDCartesianZone((ChipClusters.ZoneManagementCluster.CreateTwoDCartesianZoneResponseCallback) callback + , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct) + commandArguments.get("zone") - CommandParameterInfo contentLauncherlaunchContentautoPlayCommandParameterInfo = new CommandParameterInfo("autoPlay", Boolean.class, Boolean.class); - contentLauncherlaunchContentCommandParams.put("autoPlay",contentLauncherlaunchContentautoPlayCommandParameterInfo); + ); + }, + () -> new DelegatedZoneManagementClusterCreateTwoDCartesianZoneResponseCallback(), + zoneManagementcreateTwoDCartesianZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("createTwoDCartesianZone", zoneManagementcreateTwoDCartesianZoneInteractionInfo); - CommandParameterInfo contentLauncherlaunchContentdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); - contentLauncherlaunchContentCommandParams.put("data",contentLauncherlaunchContentdataCommandParameterInfo); + Map zoneManagementupdateTwoDCartesianZoneCommandParams = new LinkedHashMap(); + CommandParameterInfo zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class); + zoneManagementupdateTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementupdateTwoDCartesianZonezoneIDCommandParameterInfo); - CommandParameterInfo contentLauncherlaunchContentuseCurrentContextCommandParameterInfo = new CommandParameterInfo("useCurrentContext", Optional.class, Boolean.class); - contentLauncherlaunchContentCommandParams.put("useCurrentContext",contentLauncherlaunchContentuseCurrentContextCommandParameterInfo); - InteractionInfo contentLauncherlaunchContentInteractionInfo = new InteractionInfo( + InteractionInfo zoneManagementupdateTwoDCartesianZoneInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentLauncherCluster) cluster) - .launchContent((ChipClusters.ContentLauncherCluster.LauncherResponseCallback) callback - , (ChipStructs.ContentLauncherClusterContentSearchStruct) - commandArguments.get("search") - - , (Boolean) - commandArguments.get("autoPlay") - - , (Optional) - commandArguments.get("data") + ((ChipClusters.ZoneManagementCluster) cluster) + .updateTwoDCartesianZone((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("zoneID") + , (ChipStructs.ZoneManagementClusterTwoDCartesianZoneStruct) + commandArguments.get("zone") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + zoneManagementupdateTwoDCartesianZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("updateTwoDCartesianZone", zoneManagementupdateTwoDCartesianZoneInteractionInfo); - , (Optional) - commandArguments.get("playbackPreferences") + Map zoneManagementgetTwoDCartesianZoneCommandParams = new LinkedHashMap(); - , (Optional) - commandArguments.get("useCurrentContext") + CommandParameterInfo zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Optional.class, Integer.class); + zoneManagementgetTwoDCartesianZoneCommandParams.put("zoneID",zoneManagementgetTwoDCartesianZonezoneIDCommandParameterInfo); + InteractionInfo zoneManagementgetTwoDCartesianZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .getTwoDCartesianZone((ChipClusters.ZoneManagementCluster.GetTwoDCartesianZoneResponseCallback) callback + , (Optional) + commandArguments.get("zoneID") ); }, - () -> new DelegatedContentLauncherClusterLauncherResponseCallback(), - contentLauncherlaunchContentCommandParams + () -> new DelegatedZoneManagementClusterGetTwoDCartesianZoneResponseCallback(), + zoneManagementgetTwoDCartesianZoneCommandParams ); - contentLauncherClusterInteractionInfoMap.put("launchContent", contentLauncherlaunchContentInteractionInfo); + zoneManagementClusterInteractionInfoMap.put("getTwoDCartesianZone", zoneManagementgetTwoDCartesianZoneInteractionInfo); - Map contentLauncherlaunchURLCommandParams = new LinkedHashMap(); + Map zoneManagementremoveZoneCommandParams = new LinkedHashMap(); - CommandParameterInfo contentLauncherlaunchURLcontentURLCommandParameterInfo = new CommandParameterInfo("contentURL", String.class, String.class); - contentLauncherlaunchURLCommandParams.put("contentURL",contentLauncherlaunchURLcontentURLCommandParameterInfo); + CommandParameterInfo zoneManagementremoveZonezoneIDCommandParameterInfo = new CommandParameterInfo("zoneID", Integer.class, Integer.class); + zoneManagementremoveZoneCommandParams.put("zoneID",zoneManagementremoveZonezoneIDCommandParameterInfo); + InteractionInfo zoneManagementremoveZoneInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster) + .removeZone((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("zoneID") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + zoneManagementremoveZoneCommandParams + ); + zoneManagementClusterInteractionInfoMap.put("removeZone", zoneManagementremoveZoneInteractionInfo); - CommandParameterInfo contentLauncherlaunchURLdisplayStringCommandParameterInfo = new CommandParameterInfo("displayString", Optional.class, String.class); - contentLauncherlaunchURLCommandParams.put("displayString",contentLauncherlaunchURLdisplayStringCommandParameterInfo); + commandMap.put("zoneManagement", zoneManagementClusterInteractionInfoMap); - InteractionInfo contentLauncherlaunchURLInteractionInfo = new InteractionInfo( + Map cameraAvStreamManagementClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map cameraAvStreamManagementaudioStreamAllocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatestreamTypeCommandParameterInfo = new CommandParameterInfo("streamType", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("streamType",cameraAvStreamManagementaudioStreamAllocatestreamTypeCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocateaudioCodecCommandParameterInfo = new CommandParameterInfo("audioCodec", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("audioCodec",cameraAvStreamManagementaudioStreamAllocateaudioCodecCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatechannelCountCommandParameterInfo = new CommandParameterInfo("channelCount", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("channelCount",cameraAvStreamManagementaudioStreamAllocatechannelCountCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatesampleRateCommandParameterInfo = new CommandParameterInfo("sampleRate", Long.class, Long.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("sampleRate",cameraAvStreamManagementaudioStreamAllocatesampleRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatebitRateCommandParameterInfo = new CommandParameterInfo("bitRate", Long.class, Long.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("bitRate",cameraAvStreamManagementaudioStreamAllocatebitRateCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementaudioStreamAllocatebitDepthCommandParameterInfo = new CommandParameterInfo("bitDepth", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamAllocateCommandParams.put("bitDepth",cameraAvStreamManagementaudioStreamAllocatebitDepthCommandParameterInfo); + InteractionInfo cameraAvStreamManagementaudioStreamAllocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentLauncherCluster) cluster) - .launchURL((ChipClusters.ContentLauncherCluster.LauncherResponseCallback) callback - , (String) - commandArguments.get("contentURL") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .audioStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.AudioStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("streamType") - , (Optional) - commandArguments.get("displayString") + , (Integer) + commandArguments.get("audioCodec") - , (Optional) - commandArguments.get("brandingInformation") + , (Integer) + commandArguments.get("channelCount") + + , (Long) + commandArguments.get("sampleRate") + + , (Long) + commandArguments.get("bitRate") + + , (Integer) + commandArguments.get("bitDepth") ); }, - () -> new DelegatedContentLauncherClusterLauncherResponseCallback(), - contentLauncherlaunchURLCommandParams + () -> new DelegatedCameraAvStreamManagementClusterAudioStreamAllocateResponseCallback(), + cameraAvStreamManagementaudioStreamAllocateCommandParams ); - contentLauncherClusterInteractionInfoMap.put("launchURL", contentLauncherlaunchURLInteractionInfo); - - commandMap.put("contentLauncher", contentLauncherClusterInteractionInfoMap); - - Map audioOutputClusterInteractionInfoMap = new LinkedHashMap<>(); + cameraAvStreamManagementClusterInteractionInfoMap.put("audioStreamAllocate", cameraAvStreamManagementaudioStreamAllocateInteractionInfo); - Map audioOutputselectOutputCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementaudioStreamDeallocateCommandParams = new LinkedHashMap(); - CommandParameterInfo audioOutputselectOutputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); - audioOutputselectOutputCommandParams.put("index",audioOutputselectOutputindexCommandParameterInfo); - InteractionInfo audioOutputselectOutputInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementaudioStreamDeallocateaudioStreamIDCommandParameterInfo = new CommandParameterInfo("audioStreamID", Integer.class, Integer.class); + cameraAvStreamManagementaudioStreamDeallocateCommandParams.put("audioStreamID",cameraAvStreamManagementaudioStreamDeallocateaudioStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementaudioStreamDeallocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.AudioOutputCluster) cluster) - .selectOutput((DefaultClusterCallback) callback + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .audioStreamDeallocate((DefaultClusterCallback) callback , (Integer) - commandArguments.get("index") + commandArguments.get("audioStreamID") ); }, () -> new DelegatedDefaultClusterCallback(), - audioOutputselectOutputCommandParams + cameraAvStreamManagementaudioStreamDeallocateCommandParams ); - audioOutputClusterInteractionInfoMap.put("selectOutput", audioOutputselectOutputInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("audioStreamDeallocate", cameraAvStreamManagementaudioStreamDeallocateInteractionInfo); - Map audioOutputrenameOutputCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementvideoStreamAllocateCommandParams = new LinkedHashMap(); - CommandParameterInfo audioOutputrenameOutputindexCommandParameterInfo = new CommandParameterInfo("index", Integer.class, Integer.class); - audioOutputrenameOutputCommandParams.put("index",audioOutputrenameOutputindexCommandParameterInfo); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatestreamTypeCommandParameterInfo = new CommandParameterInfo("streamType", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("streamType",cameraAvStreamManagementvideoStreamAllocatestreamTypeCommandParameterInfo); - CommandParameterInfo audioOutputrenameOutputnameCommandParameterInfo = new CommandParameterInfo("name", String.class, String.class); - audioOutputrenameOutputCommandParams.put("name",audioOutputrenameOutputnameCommandParameterInfo); - InteractionInfo audioOutputrenameOutputInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AudioOutputCluster) cluster) - .renameOutput((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("index") - , (String) - commandArguments.get("name") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - audioOutputrenameOutputCommandParams - ); - audioOutputClusterInteractionInfoMap.put("renameOutput", audioOutputrenameOutputInteractionInfo); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatevideoCodecCommandParameterInfo = new CommandParameterInfo("videoCodec", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("videoCodec",cameraAvStreamManagementvideoStreamAllocatevideoCodecCommandParameterInfo); - commandMap.put("audioOutput", audioOutputClusterInteractionInfoMap); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminFrameRateCommandParameterInfo = new CommandParameterInfo("minFrameRate", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minFrameRate",cameraAvStreamManagementvideoStreamAllocateminFrameRateCommandParameterInfo); - Map applicationLauncherClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxFrameRateCommandParameterInfo = new CommandParameterInfo("maxFrameRate", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxFrameRate",cameraAvStreamManagementvideoStreamAllocatemaxFrameRateCommandParameterInfo); - Map applicationLauncherlaunchAppCommandParams = new LinkedHashMap(); - CommandParameterInfo applicationLauncherlaunchAppdataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, byte[].class); - applicationLauncherlaunchAppCommandParams.put("data",applicationLauncherlaunchAppdataCommandParameterInfo); - InteractionInfo applicationLauncherlaunchAppInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .launchApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback - , (Optional) - commandArguments.get("application") + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminBitRateCommandParameterInfo = new CommandParameterInfo("minBitRate", Long.class, Long.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minBitRate",cameraAvStreamManagementvideoStreamAllocateminBitRateCommandParameterInfo); - , (Optional) - commandArguments.get("data") + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxBitRateCommandParameterInfo = new CommandParameterInfo("maxBitRate", Long.class, Long.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxBitRate",cameraAvStreamManagementvideoStreamAllocatemaxBitRateCommandParameterInfo); - ); - }, - () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), - applicationLauncherlaunchAppCommandParams - ); - applicationLauncherClusterInteractionInfoMap.put("launchApp", applicationLauncherlaunchAppInteractionInfo); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateminFragmentLenCommandParameterInfo = new CommandParameterInfo("minFragmentLen", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("minFragmentLen",cameraAvStreamManagementvideoStreamAllocateminFragmentLenCommandParameterInfo); - Map applicationLauncherstopAppCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatemaxFragmentLenCommandParameterInfo = new CommandParameterInfo("maxFragmentLen", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("maxFragmentLen",cameraAvStreamManagementvideoStreamAllocatemaxFragmentLenCommandParameterInfo); - InteractionInfo applicationLauncherstopAppInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocatewatermarkEnabledCommandParameterInfo = new CommandParameterInfo("watermarkEnabled", Optional.class, Boolean.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("watermarkEnabled",cameraAvStreamManagementvideoStreamAllocatewatermarkEnabledCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamAllocateOSDEnabledCommandParameterInfo = new CommandParameterInfo("OSDEnabled", Optional.class, Boolean.class); + cameraAvStreamManagementvideoStreamAllocateCommandParams.put("OSDEnabled",cameraAvStreamManagementvideoStreamAllocateOSDEnabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementvideoStreamAllocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .stopApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback - , (Optional) - commandArguments.get("application") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.VideoStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("streamType") - ); - }, - () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), - applicationLauncherstopAppCommandParams - ); - applicationLauncherClusterInteractionInfoMap.put("stopApp", applicationLauncherstopAppInteractionInfo); + , (Integer) + commandArguments.get("videoCodec") - Map applicationLauncherhideAppCommandParams = new LinkedHashMap(); + , (Integer) + commandArguments.get("minFrameRate") - InteractionInfo applicationLauncherhideAppInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ApplicationLauncherCluster) cluster) - .hideApp((ChipClusters.ApplicationLauncherCluster.LauncherResponseCallback) callback - , (Optional) - commandArguments.get("application") + , (Integer) + commandArguments.get("maxFrameRate") - ); - }, - () -> new DelegatedApplicationLauncherClusterLauncherResponseCallback(), - applicationLauncherhideAppCommandParams - ); - applicationLauncherClusterInteractionInfoMap.put("hideApp", applicationLauncherhideAppInteractionInfo); + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("minResolution") - commandMap.put("applicationLauncher", applicationLauncherClusterInteractionInfoMap); + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("maxResolution") + + , (Long) + commandArguments.get("minBitRate") - Map applicationBasicClusterInteractionInfoMap = new LinkedHashMap<>(); + , (Long) + commandArguments.get("maxBitRate") - commandMap.put("applicationBasic", applicationBasicClusterInteractionInfoMap); + , (Integer) + commandArguments.get("minFragmentLen") - Map accountLoginClusterInteractionInfoMap = new LinkedHashMap<>(); + , (Integer) + commandArguments.get("maxFragmentLen") - Map accountLogingetSetupPINCommandParams = new LinkedHashMap(); + , (Optional) + commandArguments.get("watermarkEnabled") - CommandParameterInfo accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class, String.class); - accountLogingetSetupPINCommandParams.put("tempAccountIdentifier",accountLogingetSetupPINtempAccountIdentifierCommandParameterInfo); - InteractionInfo accountLogingetSetupPINInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.AccountLoginCluster) cluster) - .getSetupPIN((ChipClusters.AccountLoginCluster.GetSetupPINResponseCallback) callback - , (String) - commandArguments.get("tempAccountIdentifier") + , (Optional) + commandArguments.get("OSDEnabled") - , 10000); + ); }, - () -> new DelegatedAccountLoginClusterGetSetupPINResponseCallback(), - accountLogingetSetupPINCommandParams + () -> new DelegatedCameraAvStreamManagementClusterVideoStreamAllocateResponseCallback(), + cameraAvStreamManagementvideoStreamAllocateCommandParams ); - accountLoginClusterInteractionInfoMap.put("getSetupPIN", accountLogingetSetupPINInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamAllocate", cameraAvStreamManagementvideoStreamAllocateInteractionInfo); - Map accountLoginloginCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementvideoStreamModifyCommandParams = new LinkedHashMap(); - CommandParameterInfo accountLoginlogintempAccountIdentifierCommandParameterInfo = new CommandParameterInfo("tempAccountIdentifier", String.class, String.class); - accountLoginloginCommandParams.put("tempAccountIdentifier",accountLoginlogintempAccountIdentifierCommandParameterInfo); + CommandParameterInfo cameraAvStreamManagementvideoStreamModifyvideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamModifyCommandParams.put("videoStreamID",cameraAvStreamManagementvideoStreamModifyvideoStreamIDCommandParameterInfo); - CommandParameterInfo accountLoginloginsetupPINCommandParameterInfo = new CommandParameterInfo("setupPIN", String.class, String.class); - accountLoginloginCommandParams.put("setupPIN",accountLoginloginsetupPINCommandParameterInfo); - CommandParameterInfo accountLoginloginnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); - accountLoginloginCommandParams.put("node",accountLoginloginnodeCommandParameterInfo); - InteractionInfo accountLoginloginInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementvideoStreamModifywatermarkEnabledCommandParameterInfo = new CommandParameterInfo("watermarkEnabled", Optional.class, Boolean.class); + cameraAvStreamManagementvideoStreamModifyCommandParams.put("watermarkEnabled",cameraAvStreamManagementvideoStreamModifywatermarkEnabledCommandParameterInfo); + + CommandParameterInfo cameraAvStreamManagementvideoStreamModifyOSDEnabledCommandParameterInfo = new CommandParameterInfo("OSDEnabled", Optional.class, Boolean.class); + cameraAvStreamManagementvideoStreamModifyCommandParams.put("OSDEnabled",cameraAvStreamManagementvideoStreamModifyOSDEnabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementvideoStreamModifyInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.AccountLoginCluster) cluster) - .login((DefaultClusterCallback) callback - , (String) - commandArguments.get("tempAccountIdentifier") - , (String) - commandArguments.get("setupPIN") - , (Optional) - commandArguments.get("node"), 10000 + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamModify((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") + , (Optional) + commandArguments.get("resolution") + , (Optional) + commandArguments.get("watermarkEnabled") + , (Optional) + commandArguments.get("OSDEnabled") ); }, () -> new DelegatedDefaultClusterCallback(), - accountLoginloginCommandParams + cameraAvStreamManagementvideoStreamModifyCommandParams ); - accountLoginClusterInteractionInfoMap.put("login", accountLoginloginInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamModify", cameraAvStreamManagementvideoStreamModifyInteractionInfo); - Map accountLoginlogoutCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementvideoStreamDeallocateCommandParams = new LinkedHashMap(); - CommandParameterInfo accountLoginlogoutnodeCommandParameterInfo = new CommandParameterInfo("node", Optional.class, Long.class); - accountLoginlogoutCommandParams.put("node",accountLoginlogoutnodeCommandParameterInfo); - InteractionInfo accountLoginlogoutInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementvideoStreamDeallocatevideoStreamIDCommandParameterInfo = new CommandParameterInfo("videoStreamID", Integer.class, Integer.class); + cameraAvStreamManagementvideoStreamDeallocateCommandParams.put("videoStreamID",cameraAvStreamManagementvideoStreamDeallocatevideoStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementvideoStreamDeallocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.AccountLoginCluster) cluster) - .logout((DefaultClusterCallback) callback - , (Optional) - commandArguments.get("node"), 10000 + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .videoStreamDeallocate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("videoStreamID") ); }, () -> new DelegatedDefaultClusterCallback(), - accountLoginlogoutCommandParams + cameraAvStreamManagementvideoStreamDeallocateCommandParams ); - accountLoginClusterInteractionInfoMap.put("logout", accountLoginlogoutInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("videoStreamDeallocate", cameraAvStreamManagementvideoStreamDeallocateInteractionInfo); - commandMap.put("accountLogin", accountLoginClusterInteractionInfoMap); + Map cameraAvStreamManagementsnapshotStreamAllocateCommandParams = new LinkedHashMap(); - Map contentControlClusterInteractionInfoMap = new LinkedHashMap<>(); + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocateimageCodecCommandParameterInfo = new CommandParameterInfo("imageCodec", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("imageCodec",cameraAvStreamManagementsnapshotStreamAllocateimageCodecCommandParameterInfo); - Map contentControlupdatePINCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocateframeRateCommandParameterInfo = new CommandParameterInfo("frameRate", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("frameRate",cameraAvStreamManagementsnapshotStreamAllocateframeRateCommandParameterInfo); - CommandParameterInfo contentControlupdatePINoldPINCommandParameterInfo = new CommandParameterInfo("oldPIN", Optional.class, String.class); - contentControlupdatePINCommandParams.put("oldPIN",contentControlupdatePINoldPINCommandParameterInfo); + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocatebitRateCommandParameterInfo = new CommandParameterInfo("bitRate", Long.class, Long.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("bitRate",cameraAvStreamManagementsnapshotStreamAllocatebitRateCommandParameterInfo); - CommandParameterInfo contentControlupdatePINnewPINCommandParameterInfo = new CommandParameterInfo("newPIN", String.class, String.class); - contentControlupdatePINCommandParams.put("newPIN",contentControlupdatePINnewPINCommandParameterInfo); - InteractionInfo contentControlupdatePINInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .updatePIN((DefaultClusterCallback) callback - , (Optional) - commandArguments.get("oldPIN") - , (String) - commandArguments.get("newPIN") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - contentControlupdatePINCommandParams - ); - contentControlClusterInteractionInfoMap.put("updatePIN", contentControlupdatePINInteractionInfo); - Map contentControlresetPINCommandParams = new LinkedHashMap(); - InteractionInfo contentControlresetPINInteractionInfo = new InteractionInfo( + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamAllocatequalityCommandParameterInfo = new CommandParameterInfo("quality", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamAllocateCommandParams.put("quality",cameraAvStreamManagementsnapshotStreamAllocatequalityCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsnapshotStreamAllocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .resetPIN((ChipClusters.ContentControlCluster.ResetPINResponseCallback) callback + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .snapshotStreamAllocate((ChipClusters.CameraAvStreamManagementCluster.SnapshotStreamAllocateResponseCallback) callback + , (Integer) + commandArguments.get("imageCodec") + + , (Integer) + commandArguments.get("frameRate") + + , (Long) + commandArguments.get("bitRate") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("minResolution") + + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("maxResolution") + + , (Integer) + commandArguments.get("quality") + ); }, - () -> new DelegatedContentControlClusterResetPINResponseCallback(), - contentControlresetPINCommandParams + () -> new DelegatedCameraAvStreamManagementClusterSnapshotStreamAllocateResponseCallback(), + cameraAvStreamManagementsnapshotStreamAllocateCommandParams ); - contentControlClusterInteractionInfoMap.put("resetPIN", contentControlresetPINInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("snapshotStreamAllocate", cameraAvStreamManagementsnapshotStreamAllocateInteractionInfo); - Map contentControlenableCommandParams = new LinkedHashMap(); - InteractionInfo contentControlenableInteractionInfo = new InteractionInfo( + Map cameraAvStreamManagementsnapshotStreamDeallocateCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsnapshotStreamDeallocatesnapshotStreamIDCommandParameterInfo = new CommandParameterInfo("snapshotStreamID", Integer.class, Integer.class); + cameraAvStreamManagementsnapshotStreamDeallocateCommandParams.put("snapshotStreamID",cameraAvStreamManagementsnapshotStreamDeallocatesnapshotStreamIDCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsnapshotStreamDeallocateInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .enable((DefaultClusterCallback) callback + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .snapshotStreamDeallocate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("snapshotStreamID") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControlenableCommandParams + cameraAvStreamManagementsnapshotStreamDeallocateCommandParams ); - contentControlClusterInteractionInfoMap.put("enable", contentControlenableInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("snapshotStreamDeallocate", cameraAvStreamManagementsnapshotStreamDeallocateInteractionInfo); - Map contentControldisableCommandParams = new LinkedHashMap(); - InteractionInfo contentControldisableInteractionInfo = new InteractionInfo( + Map cameraAvStreamManagementsetStreamPrioritiesCommandParams = new LinkedHashMap(); + + CommandParameterInfo cameraAvStreamManagementsetStreamPrioritiesstreamPrioritiesCommandParameterInfo = new CommandParameterInfo("streamPriorities", ArrayList.class, ArrayList.class); + cameraAvStreamManagementsetStreamPrioritiesCommandParams.put("streamPriorities",cameraAvStreamManagementsetStreamPrioritiesstreamPrioritiesCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetStreamPrioritiesInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .disable((DefaultClusterCallback) callback + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setStreamPriorities((DefaultClusterCallback) callback + , (ArrayList) + commandArguments.get("streamPriorities") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControldisableCommandParams + cameraAvStreamManagementsetStreamPrioritiesCommandParams ); - contentControlClusterInteractionInfoMap.put("disable", contentControldisableInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("setStreamPriorities", cameraAvStreamManagementsetStreamPrioritiesInteractionInfo); - Map contentControladdBonusTimeCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementcaptureSnapshotCommandParams = new LinkedHashMap(); - CommandParameterInfo contentControladdBonusTimePINCodeCommandParameterInfo = new CommandParameterInfo("PINCode", Optional.class, String.class); - contentControladdBonusTimeCommandParams.put("PINCode",contentControladdBonusTimePINCodeCommandParameterInfo); + CommandParameterInfo cameraAvStreamManagementcaptureSnapshotsnapshotStreamIDCommandParameterInfo = new CommandParameterInfo("snapshotStreamID", Integer.class, Integer.class); + cameraAvStreamManagementcaptureSnapshotCommandParams.put("snapshotStreamID",cameraAvStreamManagementcaptureSnapshotsnapshotStreamIDCommandParameterInfo); - CommandParameterInfo contentControladdBonusTimebonusTimeCommandParameterInfo = new CommandParameterInfo("bonusTime", Optional.class, Long.class); - contentControladdBonusTimeCommandParams.put("bonusTime",contentControladdBonusTimebonusTimeCommandParameterInfo); - InteractionInfo contentControladdBonusTimeInteractionInfo = new InteractionInfo( + InteractionInfo cameraAvStreamManagementcaptureSnapshotInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .addBonusTime((DefaultClusterCallback) callback - , (Optional) - commandArguments.get("PINCode") - , (Optional) - commandArguments.get("bonusTime") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .captureSnapshot((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("snapshotStreamID") + , (ChipStructs.CameraAvStreamManagementClusterVideoResolutionStruct) + commandArguments.get("requestedResolution") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControladdBonusTimeCommandParams + cameraAvStreamManagementcaptureSnapshotCommandParams ); - contentControlClusterInteractionInfoMap.put("addBonusTime", contentControladdBonusTimeInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("captureSnapshot", cameraAvStreamManagementcaptureSnapshotInteractionInfo); - Map contentControlsetScreenDailyTimeCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementsetViewportCommandParams = new LinkedHashMap(); - CommandParameterInfo contentControlsetScreenDailyTimescreenTimeCommandParameterInfo = new CommandParameterInfo("screenTime", Long.class, Long.class); - contentControlsetScreenDailyTimeCommandParams.put("screenTime",contentControlsetScreenDailyTimescreenTimeCommandParameterInfo); - InteractionInfo contentControlsetScreenDailyTimeInteractionInfo = new InteractionInfo( + InteractionInfo cameraAvStreamManagementsetViewportInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .setScreenDailyTime((DefaultClusterCallback) callback - , (Long) - commandArguments.get("screenTime") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setViewport((DefaultClusterCallback) callback + , (ChipStructs.CameraAvStreamManagementClusterViewportStruct) + commandArguments.get("viewport") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControlsetScreenDailyTimeCommandParams + cameraAvStreamManagementsetViewportCommandParams ); - contentControlClusterInteractionInfoMap.put("setScreenDailyTime", contentControlsetScreenDailyTimeInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("setViewport", cameraAvStreamManagementsetViewportInteractionInfo); - Map contentControlblockUnratedContentCommandParams = new LinkedHashMap(); - InteractionInfo contentControlblockUnratedContentInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .blockUnratedContent((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - contentControlblockUnratedContentCommandParams - ); - contentControlClusterInteractionInfoMap.put("blockUnratedContent", contentControlblockUnratedContentInteractionInfo); + Map cameraAvStreamManagementsetImageRotationCommandParams = new LinkedHashMap(); - Map contentControlunblockUnratedContentCommandParams = new LinkedHashMap(); - InteractionInfo contentControlunblockUnratedContentInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementsetImageRotationangleCommandParameterInfo = new CommandParameterInfo("angle", Integer.class, Integer.class); + cameraAvStreamManagementsetImageRotationCommandParams.put("angle",cameraAvStreamManagementsetImageRotationangleCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageRotationInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .unblockUnratedContent((DefaultClusterCallback) callback + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageRotation((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("angle") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControlunblockUnratedContentCommandParams + cameraAvStreamManagementsetImageRotationCommandParams ); - contentControlClusterInteractionInfoMap.put("unblockUnratedContent", contentControlunblockUnratedContentInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageRotation", cameraAvStreamManagementsetImageRotationInteractionInfo); - Map contentControlsetOnDemandRatingThresholdCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementsetImageFlipHorizontalCommandParams = new LinkedHashMap(); - CommandParameterInfo contentControlsetOnDemandRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); - contentControlsetOnDemandRatingThresholdCommandParams.put("rating",contentControlsetOnDemandRatingThresholdratingCommandParameterInfo); - InteractionInfo contentControlsetOnDemandRatingThresholdInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementsetImageFlipHorizontalenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetImageFlipHorizontalCommandParams.put("enabled",cameraAvStreamManagementsetImageFlipHorizontalenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageFlipHorizontalInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .setOnDemandRatingThreshold((DefaultClusterCallback) callback - , (String) - commandArguments.get("rating") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageFlipHorizontal((DefaultClusterCallback) callback + , (Boolean) + commandArguments.get("enabled") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControlsetOnDemandRatingThresholdCommandParams + cameraAvStreamManagementsetImageFlipHorizontalCommandParams ); - contentControlClusterInteractionInfoMap.put("setOnDemandRatingThreshold", contentControlsetOnDemandRatingThresholdInteractionInfo); + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageFlipHorizontal", cameraAvStreamManagementsetImageFlipHorizontalInteractionInfo); - Map contentControlsetScheduledContentRatingThresholdCommandParams = new LinkedHashMap(); + Map cameraAvStreamManagementsetImageFlipVerticalCommandParams = new LinkedHashMap(); - CommandParameterInfo contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo = new CommandParameterInfo("rating", String.class, String.class); - contentControlsetScheduledContentRatingThresholdCommandParams.put("rating",contentControlsetScheduledContentRatingThresholdratingCommandParameterInfo); - InteractionInfo contentControlsetScheduledContentRatingThresholdInteractionInfo = new InteractionInfo( + CommandParameterInfo cameraAvStreamManagementsetImageFlipVerticalenabledCommandParameterInfo = new CommandParameterInfo("enabled", Boolean.class, Boolean.class); + cameraAvStreamManagementsetImageFlipVerticalCommandParams.put("enabled",cameraAvStreamManagementsetImageFlipVerticalenabledCommandParameterInfo); + InteractionInfo cameraAvStreamManagementsetImageFlipVerticalInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentControlCluster) cluster) - .setScheduledContentRatingThreshold((DefaultClusterCallback) callback - , (String) - commandArguments.get("rating") + ((ChipClusters.CameraAvStreamManagementCluster) cluster) + .setImageFlipVertical((DefaultClusterCallback) callback + , (Boolean) + commandArguments.get("enabled") ); }, () -> new DelegatedDefaultClusterCallback(), - contentControlsetScheduledContentRatingThresholdCommandParams + cameraAvStreamManagementsetImageFlipVerticalCommandParams ); - contentControlClusterInteractionInfoMap.put("setScheduledContentRatingThreshold", contentControlsetScheduledContentRatingThresholdInteractionInfo); - - commandMap.put("contentControl", contentControlClusterInteractionInfoMap); - - Map contentAppObserverClusterInteractionInfoMap = new LinkedHashMap<>(); - - Map contentAppObservercontentAppMessageCommandParams = new LinkedHashMap(); - - CommandParameterInfo contentAppObservercontentAppMessagedataCommandParameterInfo = new CommandParameterInfo("data", Optional.class, String.class); - contentAppObservercontentAppMessageCommandParams.put("data",contentAppObservercontentAppMessagedataCommandParameterInfo); - - CommandParameterInfo contentAppObservercontentAppMessageencodingHintCommandParameterInfo = new CommandParameterInfo("encodingHint", String.class, String.class); - contentAppObservercontentAppMessageCommandParams.put("encodingHint",contentAppObservercontentAppMessageencodingHintCommandParameterInfo); - InteractionInfo contentAppObservercontentAppMessageInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ContentAppObserverCluster) cluster) - .contentAppMessage((ChipClusters.ContentAppObserverCluster.ContentAppMessageResponseCallback) callback - , (Optional) - commandArguments.get("data") + cameraAvStreamManagementClusterInteractionInfoMap.put("setImageFlipVertical", cameraAvStreamManagementsetImageFlipVerticalInteractionInfo); - , (String) - commandArguments.get("encodingHint") - - ); - }, - () -> new DelegatedContentAppObserverClusterContentAppMessageResponseCallback(), - contentAppObservercontentAppMessageCommandParams - ); - contentAppObserverClusterInteractionInfoMap.put("contentAppMessage", contentAppObservercontentAppMessageInteractionInfo); - - commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); + commandMap.put("cameraAvStreamManagement", cameraAvStreamManagementClusterInteractionInfoMap); Map webRTCTransportProviderClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -29077,6 +30268,106 @@ public Map> getCommandMap() { commandMap.put("webRTCTransportProvider", webRTCTransportProviderClusterInteractionInfoMap); + Map webRTCTransportRequestorClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map webRTCTransportRequestorofferCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorofferwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorofferCommandParams.put("webRTCSessionID",webRTCTransportRequestorofferwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestoroffersdpCommandParameterInfo = new CommandParameterInfo("sdp", String.class, String.class); + webRTCTransportRequestorofferCommandParams.put("sdp",webRTCTransportRequestoroffersdpCommandParameterInfo); + + + CommandParameterInfo webRTCTransportRequestorofferICETransportPolicyCommandParameterInfo = new CommandParameterInfo("ICETransportPolicy", Optional.class, String.class); + webRTCTransportRequestorofferCommandParams.put("ICETransportPolicy",webRTCTransportRequestorofferICETransportPolicyCommandParameterInfo); + InteractionInfo webRTCTransportRequestorofferInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .offer((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("sdp") + , (Optional>) + commandArguments.get("ICEServers") + , (Optional) + commandArguments.get("ICETransportPolicy") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorofferCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("offer", webRTCTransportRequestorofferInteractionInfo); + + Map webRTCTransportRequestoranswerCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestoranswerwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestoranswerCommandParams.put("webRTCSessionID",webRTCTransportRequestoranswerwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestoranswersdpCommandParameterInfo = new CommandParameterInfo("sdp", String.class, String.class); + webRTCTransportRequestoranswerCommandParams.put("sdp",webRTCTransportRequestoranswersdpCommandParameterInfo); + InteractionInfo webRTCTransportRequestoranswerInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .answer((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("sdp") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestoranswerCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("answer", webRTCTransportRequestoranswerInteractionInfo); + + Map webRTCTransportRequestorICECandidateCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorICECandidateCommandParams.put("webRTCSessionID",webRTCTransportRequestorICECandidatewebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo = new CommandParameterInfo("ICECandidate", String.class, String.class); + webRTCTransportRequestorICECandidateCommandParams.put("ICECandidate",webRTCTransportRequestorICECandidateICECandidateCommandParameterInfo); + InteractionInfo webRTCTransportRequestorICECandidateInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .ICECandidate((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (String) + commandArguments.get("ICECandidate") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorICECandidateCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("ICECandidate", webRTCTransportRequestorICECandidateInteractionInfo); + + Map webRTCTransportRequestorendCommandParams = new LinkedHashMap(); + + CommandParameterInfo webRTCTransportRequestorendwebRTCSessionIDCommandParameterInfo = new CommandParameterInfo("webRTCSessionID", Integer.class, Integer.class); + webRTCTransportRequestorendCommandParams.put("webRTCSessionID",webRTCTransportRequestorendwebRTCSessionIDCommandParameterInfo); + + CommandParameterInfo webRTCTransportRequestorendreasonCommandParameterInfo = new CommandParameterInfo("reason", Integer.class, Integer.class); + webRTCTransportRequestorendCommandParams.put("reason",webRTCTransportRequestorendreasonCommandParameterInfo); + InteractionInfo webRTCTransportRequestorendInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster) + .end((DefaultClusterCallback) callback + , (Integer) + commandArguments.get("webRTCSessionID") + , (Integer) + commandArguments.get("reason") + ); + }, + () -> new DelegatedDefaultClusterCallback(), + webRTCTransportRequestorendCommandParams + ); + webRTCTransportRequestorClusterInteractionInfoMap.put("end", webRTCTransportRequestorendInteractionInfo); + + commandMap.put("webRTCTransportRequestor", webRTCTransportRequestorClusterInteractionInfoMap); + Map chimeClusterInteractionInfoMap = new LinkedHashMap<>(); Map chimeplayChimeSoundCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 05036e0391..616f9f299b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -2426,6 +2426,17 @@ private static Map readGeneralCommissioningInteractionI readGeneralCommissioningTCAcknowledgementsRequiredCommandParams ); result.put("readTCAcknowledgementsRequiredAttribute", readGeneralCommissioningTCAcknowledgementsRequiredAttributeInteractionInfo); + Map readGeneralCommissioningTCUpdateDeadlineCommandParams = new LinkedHashMap(); + InteractionInfo readGeneralCommissioningTCUpdateDeadlineAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.GeneralCommissioningCluster) cluster).readTCUpdateDeadlineAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readGeneralCommissioningTCUpdateDeadlineCommandParams + ); + result.put("readTCUpdateDeadlineAttribute", readGeneralCommissioningTCUpdateDeadlineAttributeInteractionInfo); Map readGeneralCommissioningGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readGeneralCommissioningGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -18236,6 +18247,641 @@ private static Map readContentAppObserverInteractionInf return result; } + private static Map readZoneManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readZoneManagementSupportedZoneSourcesCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementSupportedZoneSourcesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readSupportedZoneSourcesAttribute( + (ChipClusters.ZoneManagementCluster.SupportedZoneSourcesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterSupportedZoneSourcesAttributeCallback(), + readZoneManagementSupportedZoneSourcesCommandParams + ); + result.put("readSupportedZoneSourcesAttribute", readZoneManagementSupportedZoneSourcesAttributeInteractionInfo); + Map readZoneManagementZonesCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementZonesAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readZonesAttribute( + (ChipClusters.ZoneManagementCluster.ZonesAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterZonesAttributeCallback(), + readZoneManagementZonesCommandParams + ); + result.put("readZonesAttribute", readZoneManagementZonesAttributeInteractionInfo); + Map readZoneManagementTimeControlCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementTimeControlAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readTimeControlAttribute( + (ChipClusters.ZoneManagementCluster.TimeControlAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterTimeControlAttributeCallback(), + readZoneManagementTimeControlCommandParams + ); + result.put("readTimeControlAttribute", readZoneManagementTimeControlAttributeInteractionInfo); + Map readZoneManagementSensitivityCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readSensitivityAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readZoneManagementSensitivityCommandParams + ); + result.put("readSensitivityAttribute", readZoneManagementSensitivityAttributeInteractionInfo); + Map readZoneManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.ZoneManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterGeneratedCommandListAttributeCallback(), + readZoneManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readZoneManagementGeneratedCommandListAttributeInteractionInfo); + Map readZoneManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.ZoneManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAcceptedCommandListAttributeCallback(), + readZoneManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readZoneManagementAcceptedCommandListAttributeInteractionInfo); + Map readZoneManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readEventListAttribute( + (ChipClusters.ZoneManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterEventListAttributeCallback(), + readZoneManagementEventListCommandParams + ); + result.put("readEventListAttribute", readZoneManagementEventListAttributeInteractionInfo); + Map readZoneManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.ZoneManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedZoneManagementClusterAttributeListAttributeCallback(), + readZoneManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readZoneManagementAttributeListAttributeInteractionInfo); + Map readZoneManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readZoneManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readZoneManagementFeatureMapAttributeInteractionInfo); + Map readZoneManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readZoneManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readZoneManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readZoneManagementClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readCameraAvStreamManagementInteractionInfo() { + Map result = new LinkedHashMap<>();Map readCameraAvStreamManagementMaxConcurrentVideoEncodersCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxConcurrentVideoEncodersAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxConcurrentVideoEncodersAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMaxConcurrentVideoEncodersCommandParams + ); + result.put("readMaxConcurrentVideoEncodersAttribute", readCameraAvStreamManagementMaxConcurrentVideoEncodersAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxEncodedPixelRateCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxEncodedPixelRateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxEncodedPixelRateAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxEncodedPixelRateCommandParams + ); + result.put("readMaxEncodedPixelRateAttribute", readCameraAvStreamManagementMaxEncodedPixelRateAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionCapableCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionCapableAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionCapableAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementNightVisionCapableCommandParams + ); + result.put("readNightVisionCapableAttribute", readCameraAvStreamManagementNightVisionCapableAttributeInteractionInfo); + Map readCameraAvStreamManagementRateDistortionTradeOffPointsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementRateDistortionTradeOffPointsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readRateDistortionTradeOffPointsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.RateDistortionTradeOffPointsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterRateDistortionTradeOffPointsAttributeCallback(), + readCameraAvStreamManagementRateDistortionTradeOffPointsCommandParams + ); + result.put("readRateDistortionTradeOffPointsAttribute", readCameraAvStreamManagementRateDistortionTradeOffPointsAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxPreRollBufferSizeAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxPreRollBufferSizeCommandParams + ); + result.put("readMaxPreRollBufferSizeAttribute", readCameraAvStreamManagementMaxPreRollBufferSizeAttributeInteractionInfo); + Map readCameraAvStreamManagementTwoWayTalkSupportCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementTwoWayTalkSupportAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readTwoWayTalkSupportAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementTwoWayTalkSupportCommandParams + ); + result.put("readTwoWayTalkSupportAttribute", readCameraAvStreamManagementTwoWayTalkSupportAttributeInteractionInfo); + Map readCameraAvStreamManagementSupportedSnapshotParamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSupportedSnapshotParamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSupportedSnapshotParamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.SupportedSnapshotParamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterSupportedSnapshotParamsAttributeCallback(), + readCameraAvStreamManagementSupportedSnapshotParamsCommandParams + ); + result.put("readSupportedSnapshotParamsAttribute", readCameraAvStreamManagementSupportedSnapshotParamsAttributeInteractionInfo); + Map readCameraAvStreamManagementMaxNetworkBandwidthCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMaxNetworkBandwidthAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMaxNetworkBandwidthAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementMaxNetworkBandwidthCommandParams + ); + result.put("readMaxNetworkBandwidthAttribute", readCameraAvStreamManagementMaxNetworkBandwidthAttributeInteractionInfo); + Map readCameraAvStreamManagementCurrentFrameRateCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementCurrentFrameRateAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readCurrentFrameRateAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementCurrentFrameRateCommandParams + ); + result.put("readCurrentFrameRateAttribute", readCameraAvStreamManagementCurrentFrameRateAttributeInteractionInfo); + Map readCameraAvStreamManagementHDRModeEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementHDRModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readHDRModeEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementHDRModeEnabledCommandParams + ); + result.put("readHDRModeEnabledAttribute", readCameraAvStreamManagementHDRModeEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementCurrentVideoCodecsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementCurrentVideoCodecsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readCurrentVideoCodecsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.CurrentVideoCodecsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterCurrentVideoCodecsAttributeCallback(), + readCameraAvStreamManagementCurrentVideoCodecsCommandParams + ); + result.put("readCurrentVideoCodecsAttribute", readCameraAvStreamManagementCurrentVideoCodecsAttributeInteractionInfo); + Map readCameraAvStreamManagementFabricsUsingCameraCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementFabricsUsingCameraAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readFabricsUsingCameraAttribute( + (ChipClusters.CameraAvStreamManagementCluster.FabricsUsingCameraAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterFabricsUsingCameraAttributeCallback(), + readCameraAvStreamManagementFabricsUsingCameraCommandParams + ); + result.put("readFabricsUsingCameraAttribute", readCameraAvStreamManagementFabricsUsingCameraAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedVideoStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedVideoStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedVideoStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedVideoStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedVideoStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedVideoStreamsCommandParams + ); + result.put("readAllocatedVideoStreamsAttribute", readCameraAvStreamManagementAllocatedVideoStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedAudioStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedAudioStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedAudioStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedAudioStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedAudioStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedAudioStreamsCommandParams + ); + result.put("readAllocatedAudioStreamsAttribute", readCameraAvStreamManagementAllocatedAudioStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementAllocatedSnapshotStreamsCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAllocatedSnapshotStreamsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAllocatedSnapshotStreamsAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AllocatedSnapshotStreamsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAllocatedSnapshotStreamsAttributeCallback(), + readCameraAvStreamManagementAllocatedSnapshotStreamsCommandParams + ); + result.put("readAllocatedSnapshotStreamsAttribute", readCameraAvStreamManagementAllocatedSnapshotStreamsAttributeInteractionInfo); + Map readCameraAvStreamManagementRankedVideoStreamPrioritiesListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementRankedVideoStreamPrioritiesListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readRankedVideoStreamPrioritiesListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.RankedVideoStreamPrioritiesListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterRankedVideoStreamPrioritiesListAttributeCallback(), + readCameraAvStreamManagementRankedVideoStreamPrioritiesListCommandParams + ); + result.put("readRankedVideoStreamPrioritiesListAttribute", readCameraAvStreamManagementRankedVideoStreamPrioritiesListAttributeInteractionInfo); + Map readCameraAvStreamManagementSoftRecordingPrivacyModeEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSoftRecordingPrivacyModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSoftRecordingPrivacyModeEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSoftRecordingPrivacyModeEnabledCommandParams + ); + result.put("readSoftRecordingPrivacyModeEnabledAttribute", readCameraAvStreamManagementSoftRecordingPrivacyModeEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSoftLivestreamPrivacyModeEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledCommandParams + ); + result.put("readSoftLivestreamPrivacyModeEnabledAttribute", readCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementHardPrivacyModeOnCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementHardPrivacyModeOnAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readHardPrivacyModeOnAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementHardPrivacyModeOnCommandParams + ); + result.put("readHardPrivacyModeOnAttribute", readCameraAvStreamManagementHardPrivacyModeOnAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementNightVisionCommandParams + ); + result.put("readNightVisionAttribute", readCameraAvStreamManagementNightVisionAttributeInteractionInfo); + Map readCameraAvStreamManagementNightVisionIllumCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readNightVisionIllumAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementNightVisionIllumCommandParams + ); + result.put("readNightVisionIllumAttribute", readCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo); + Map readCameraAvStreamManagementAWBEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAWBEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAWBEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementAWBEnabledCommandParams + ); + result.put("readAWBEnabledAttribute", readCameraAvStreamManagementAWBEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementAutoShutterSpeedEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAutoShutterSpeedEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAutoShutterSpeedEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementAutoShutterSpeedEnabledCommandParams + ); + result.put("readAutoShutterSpeedEnabledAttribute", readCameraAvStreamManagementAutoShutterSpeedEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementAutoISOEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAutoISOEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAutoISOEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementAutoISOEnabledCommandParams + ); + result.put("readAutoISOEnabledAttribute", readCameraAvStreamManagementAutoISOEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerMutedCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerMutedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerMutedAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementSpeakerMutedCommandParams + ); + result.put("readSpeakerMutedAttribute", readCameraAvStreamManagementSpeakerMutedAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerVolumeLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerVolumeLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerVolumeLevelCommandParams + ); + result.put("readSpeakerVolumeLevelAttribute", readCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerMaxLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerMaxLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerMaxLevelCommandParams + ); + result.put("readSpeakerMaxLevelAttribute", readCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementSpeakerMinLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readSpeakerMinLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementSpeakerMinLevelCommandParams + ); + result.put("readSpeakerMinLevelAttribute", readCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicrophoneMutedCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicrophoneMutedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicrophoneMutedAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementMicrophoneMutedCommandParams + ); + result.put("readMicrophoneMutedAttribute", readCameraAvStreamManagementMicrophoneMutedAttributeInteractionInfo); + Map readCameraAvStreamManagementMicrophoneVolumeLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicrophoneVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicrophoneVolumeLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicrophoneVolumeLevelCommandParams + ); + result.put("readMicrophoneVolumeLevelAttribute", readCameraAvStreamManagementMicrophoneVolumeLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicrophoneMaxLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicrophoneMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicrophoneMaxLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicrophoneMaxLevelCommandParams + ); + result.put("readMicrophoneMaxLevelAttribute", readCameraAvStreamManagementMicrophoneMaxLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicrophoneMinLevelCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicrophoneMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicrophoneMinLevelAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementMicrophoneMinLevelCommandParams + ); + result.put("readMicrophoneMinLevelAttribute", readCameraAvStreamManagementMicrophoneMinLevelAttributeInteractionInfo); + Map readCameraAvStreamManagementMicrophoneAGCEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementMicrophoneAGCEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readMicrophoneAGCEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementMicrophoneAGCEnabledCommandParams + ); + result.put("readMicrophoneAGCEnabledAttribute", readCameraAvStreamManagementMicrophoneAGCEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementImageRotationCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageRotationAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageRotationAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementImageRotationCommandParams + ); + result.put("readImageRotationAttribute", readCameraAvStreamManagementImageRotationAttributeInteractionInfo); + Map readCameraAvStreamManagementImageFlipHorizontalCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageFlipHorizontalAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageFlipHorizontalAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementImageFlipHorizontalCommandParams + ); + result.put("readImageFlipHorizontalAttribute", readCameraAvStreamManagementImageFlipHorizontalAttributeInteractionInfo); + Map readCameraAvStreamManagementImageFlipVerticalCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementImageFlipVerticalAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readImageFlipVerticalAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementImageFlipVerticalCommandParams + ); + result.put("readImageFlipVerticalAttribute", readCameraAvStreamManagementImageFlipVerticalAttributeInteractionInfo); + Map readCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readLocalVideoRecordingEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams + ); + result.put("readLocalVideoRecordingEnabledAttribute", readCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readLocalSnapshotRecordingEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams + ); + result.put("readLocalSnapshotRecordingEnabledAttribute", readCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementStatusLightEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementStatusLightEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readStatusLightEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readCameraAvStreamManagementStatusLightEnabledCommandParams + ); + result.put("readStatusLightEnabledAttribute", readCameraAvStreamManagementStatusLightEnabledAttributeInteractionInfo); + Map readCameraAvStreamManagementStatusLightBrightnessCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readStatusLightBrightnessAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementStatusLightBrightnessCommandParams + ); + result.put("readStatusLightBrightnessAttribute", readCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo); + Map readCameraAvStreamManagementDepthSensorStatusCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readDepthSensorStatusAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementDepthSensorStatusCommandParams + ); + result.put("readDepthSensorStatusAttribute", readCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo); + Map readCameraAvStreamManagementGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterGeneratedCommandListAttributeCallback(), + readCameraAvStreamManagementGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readCameraAvStreamManagementGeneratedCommandListAttributeInteractionInfo); + Map readCameraAvStreamManagementAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAcceptedCommandListAttributeCallback(), + readCameraAvStreamManagementAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readCameraAvStreamManagementAcceptedCommandListAttributeInteractionInfo); + Map readCameraAvStreamManagementEventListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readEventListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterEventListAttributeCallback(), + readCameraAvStreamManagementEventListCommandParams + ); + result.put("readEventListAttribute", readCameraAvStreamManagementEventListAttributeInteractionInfo); + Map readCameraAvStreamManagementAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readAttributeListAttribute( + (ChipClusters.CameraAvStreamManagementCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedCameraAvStreamManagementClusterAttributeListAttributeCallback(), + readCameraAvStreamManagementAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readCameraAvStreamManagementAttributeListAttributeInteractionInfo); + Map readCameraAvStreamManagementFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readCameraAvStreamManagementFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readCameraAvStreamManagementFeatureMapAttributeInteractionInfo); + Map readCameraAvStreamManagementClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readCameraAvStreamManagementClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readCameraAvStreamManagementClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readCameraAvStreamManagementClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readWebRTCTransportProviderInteractionInfo() { Map result = new LinkedHashMap<>();Map readWebRTCTransportProviderCurrentSessionsCommandParams = new LinkedHashMap(); InteractionInfo readWebRTCTransportProviderCurrentSessionsAttributeInteractionInfo = new InteractionInfo( @@ -18317,6 +18963,87 @@ private static Map readWebRTCTransportProviderInteracti return result; } + private static Map readWebRTCTransportRequestorInteractionInfo() { + Map result = new LinkedHashMap<>();Map readWebRTCTransportRequestorCurrentSessionsCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorCurrentSessionsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readCurrentSessionsAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.CurrentSessionsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterCurrentSessionsAttributeCallback(), + readWebRTCTransportRequestorCurrentSessionsCommandParams + ); + result.put("readCurrentSessionsAttribute", readWebRTCTransportRequestorCurrentSessionsAttributeInteractionInfo); + Map readWebRTCTransportRequestorGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterGeneratedCommandListAttributeCallback(), + readWebRTCTransportRequestorGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readWebRTCTransportRequestorGeneratedCommandListAttributeInteractionInfo); + Map readWebRTCTransportRequestorAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterAcceptedCommandListAttributeCallback(), + readWebRTCTransportRequestorAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readWebRTCTransportRequestorAcceptedCommandListAttributeInteractionInfo); + Map readWebRTCTransportRequestorEventListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readEventListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterEventListAttributeCallback(), + readWebRTCTransportRequestorEventListCommandParams + ); + result.put("readEventListAttribute", readWebRTCTransportRequestorEventListAttributeInteractionInfo); + Map readWebRTCTransportRequestorAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readAttributeListAttribute( + (ChipClusters.WebRTCTransportRequestorCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedWebRTCTransportRequestorClusterAttributeListAttributeCallback(), + readWebRTCTransportRequestorAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readWebRTCTransportRequestorAttributeListAttributeInteractionInfo); + Map readWebRTCTransportRequestorFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readWebRTCTransportRequestorFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readWebRTCTransportRequestorFeatureMapAttributeInteractionInfo); + Map readWebRTCTransportRequestorClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readWebRTCTransportRequestorClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.WebRTCTransportRequestorCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readWebRTCTransportRequestorClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readWebRTCTransportRequestorClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readChimeInteractionInfo() { Map result = new LinkedHashMap<>();Map readChimeInstalledChimeSoundsCommandParams = new LinkedHashMap(); InteractionInfo readChimeInstalledChimeSoundsAttributeInteractionInfo = new InteractionInfo( @@ -19870,7 +20597,10 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); + put("zoneManagement", readZoneManagementInteractionInfo()); + put("cameraAvStreamManagement", readCameraAvStreamManagementInteractionInfo()); put("webRTCTransportProvider", readWebRTCTransportProviderInteractionInfo()); + put("webRTCTransportRequestor", readWebRTCTransportRequestorInteractionInfo()); put("chime", readChimeInteractionInfo()); put("ecosystemInformation", readEcosystemInformationInteractionInfo()); put("commissionerControl", readCommissionerControlInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 0d561c36e7..cfc302460f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3472,8 +3472,520 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("contentControl", writeContentControlInteractionInfo); Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); + Map writeZoneManagementInteractionInfo = new LinkedHashMap<>(); + Map writeZoneManagementSensitivityCommandParams = new LinkedHashMap(); + CommandParameterInfo zoneManagementsensitivityCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeZoneManagementSensitivityCommandParams.put( + "value", + zoneManagementsensitivityCommandParameterInfo + ); + InteractionInfo writeZoneManagementSensitivityAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ZoneManagementCluster) cluster).writeSensitivityAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeZoneManagementSensitivityCommandParams + ); + writeZoneManagementInteractionInfo.put("writeSensitivityAttribute", writeZoneManagementSensitivityAttributeInteractionInfo); + writeAttributeMap.put("zoneManagement", writeZoneManagementInteractionInfo); + Map writeCameraAvStreamManagementInteractionInfo = new LinkedHashMap<>(); + Map writeCameraAvStreamManagementHDRModeEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementHDRModeEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementHDRModeEnabledCommandParams.put( + "value", + cameraAvStreamManagementHDRModeEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementHDRModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeHDRModeEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementHDRModeEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeHDRModeEnabledAttribute", writeCameraAvStreamManagementHDRModeEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementSoftRecordingPrivacyModeEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementsoftRecordingPrivacyModeEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSoftRecordingPrivacyModeEnabledCommandParams.put( + "value", + cameraAvStreamManagementsoftRecordingPrivacyModeEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSoftRecordingPrivacyModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSoftRecordingPrivacyModeEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSoftRecordingPrivacyModeEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSoftRecordingPrivacyModeEnabledAttribute", writeCameraAvStreamManagementSoftRecordingPrivacyModeEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementsoftLivestreamPrivacyModeEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledCommandParams.put( + "value", + cameraAvStreamManagementsoftLivestreamPrivacyModeEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSoftLivestreamPrivacyModeEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSoftLivestreamPrivacyModeEnabledAttribute", writeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementNightVisionCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementnightVisionCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementNightVisionCommandParams.put( + "value", + cameraAvStreamManagementnightVisionCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementNightVisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeNightVisionAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementNightVisionCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeNightVisionAttribute", writeCameraAvStreamManagementNightVisionAttributeInteractionInfo); + Map writeCameraAvStreamManagementNightVisionIllumCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementnightVisionIllumCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementNightVisionIllumCommandParams.put( + "value", + cameraAvStreamManagementnightVisionIllumCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeNightVisionIllumAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementNightVisionIllumCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeNightVisionIllumAttribute", writeCameraAvStreamManagementNightVisionIllumAttributeInteractionInfo); + Map writeCameraAvStreamManagementAWBEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementAWBEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementAWBEnabledCommandParams.put( + "value", + cameraAvStreamManagementAWBEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementAWBEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeAWBEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementAWBEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeAWBEnabledAttribute", writeCameraAvStreamManagementAWBEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementAutoShutterSpeedEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementautoShutterSpeedEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementAutoShutterSpeedEnabledCommandParams.put( + "value", + cameraAvStreamManagementautoShutterSpeedEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementAutoShutterSpeedEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeAutoShutterSpeedEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementAutoShutterSpeedEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeAutoShutterSpeedEnabledAttribute", writeCameraAvStreamManagementAutoShutterSpeedEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementAutoISOEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementautoISOEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementAutoISOEnabledCommandParams.put( + "value", + cameraAvStreamManagementautoISOEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementAutoISOEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeAutoISOEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementAutoISOEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeAutoISOEnabledAttribute", writeCameraAvStreamManagementAutoISOEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerMutedCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerMutedCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementSpeakerMutedCommandParams.put( + "value", + cameraAvStreamManagementspeakerMutedCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerMutedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerMutedAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerMutedCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerMutedAttribute", writeCameraAvStreamManagementSpeakerMutedAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerVolumeLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerVolumeLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerVolumeLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerVolumeLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerVolumeLevelAttribute", writeCameraAvStreamManagementSpeakerVolumeLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerMaxLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerMaxLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerMaxLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerMaxLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerMaxLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerMaxLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerMaxLevelAttribute", writeCameraAvStreamManagementSpeakerMaxLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementSpeakerMinLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementspeakerMinLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementSpeakerMinLevelCommandParams.put( + "value", + cameraAvStreamManagementspeakerMinLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeSpeakerMinLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementSpeakerMinLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeSpeakerMinLevelAttribute", writeCameraAvStreamManagementSpeakerMinLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicrophoneMutedCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicrophoneMutedCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementMicrophoneMutedCommandParams.put( + "value", + cameraAvStreamManagementmicrophoneMutedCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicrophoneMutedAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicrophoneMutedAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicrophoneMutedCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicrophoneMutedAttribute", writeCameraAvStreamManagementMicrophoneMutedAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicrophoneVolumeLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicrophoneVolumeLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicrophoneVolumeLevelCommandParams.put( + "value", + cameraAvStreamManagementmicrophoneVolumeLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicrophoneVolumeLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicrophoneVolumeLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicrophoneVolumeLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicrophoneVolumeLevelAttribute", writeCameraAvStreamManagementMicrophoneVolumeLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicrophoneMaxLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicrophoneMaxLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicrophoneMaxLevelCommandParams.put( + "value", + cameraAvStreamManagementmicrophoneMaxLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicrophoneMaxLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicrophoneMaxLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicrophoneMaxLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicrophoneMaxLevelAttribute", writeCameraAvStreamManagementMicrophoneMaxLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicrophoneMinLevelCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicrophoneMinLevelCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementMicrophoneMinLevelCommandParams.put( + "value", + cameraAvStreamManagementmicrophoneMinLevelCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicrophoneMinLevelAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicrophoneMinLevelAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicrophoneMinLevelCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicrophoneMinLevelAttribute", writeCameraAvStreamManagementMicrophoneMinLevelAttributeInteractionInfo); + Map writeCameraAvStreamManagementMicrophoneAGCEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementmicrophoneAGCEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementMicrophoneAGCEnabledCommandParams.put( + "value", + cameraAvStreamManagementmicrophoneAGCEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementMicrophoneAGCEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeMicrophoneAGCEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementMicrophoneAGCEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeMicrophoneAGCEnabledAttribute", writeCameraAvStreamManagementMicrophoneAGCEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementlocalVideoRecordingEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams.put( + "value", + cameraAvStreamManagementlocalVideoRecordingEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeLocalVideoRecordingEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementLocalVideoRecordingEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeLocalVideoRecordingEnabledAttribute", writeCameraAvStreamManagementLocalVideoRecordingEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementlocalSnapshotRecordingEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams.put( + "value", + cameraAvStreamManagementlocalSnapshotRecordingEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeLocalSnapshotRecordingEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementLocalSnapshotRecordingEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeLocalSnapshotRecordingEnabledAttribute", writeCameraAvStreamManagementLocalSnapshotRecordingEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementStatusLightEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementstatusLightEnabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeCameraAvStreamManagementStatusLightEnabledCommandParams.put( + "value", + cameraAvStreamManagementstatusLightEnabledCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementStatusLightEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeStatusLightEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementStatusLightEnabledCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeStatusLightEnabledAttribute", writeCameraAvStreamManagementStatusLightEnabledAttributeInteractionInfo); + Map writeCameraAvStreamManagementStatusLightBrightnessCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementstatusLightBrightnessCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementStatusLightBrightnessCommandParams.put( + "value", + cameraAvStreamManagementstatusLightBrightnessCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeStatusLightBrightnessAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementStatusLightBrightnessCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeStatusLightBrightnessAttribute", writeCameraAvStreamManagementStatusLightBrightnessAttributeInteractionInfo); + Map writeCameraAvStreamManagementDepthSensorStatusCommandParams = new LinkedHashMap(); + CommandParameterInfo cameraAvStreamManagementdepthSensorStatusCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeCameraAvStreamManagementDepthSensorStatusCommandParams.put( + "value", + cameraAvStreamManagementdepthSensorStatusCommandParameterInfo + ); + InteractionInfo writeCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.CameraAvStreamManagementCluster) cluster).writeDepthSensorStatusAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeCameraAvStreamManagementDepthSensorStatusCommandParams + ); + writeCameraAvStreamManagementInteractionInfo.put("writeDepthSensorStatusAttribute", writeCameraAvStreamManagementDepthSensorStatusAttributeInteractionInfo); + writeAttributeMap.put("cameraAvStreamManagement", writeCameraAvStreamManagementInteractionInfo); Map writeWebRTCTransportProviderInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("webRTCTransportProvider", writeWebRTCTransportProviderInteractionInfo); + Map writeWebRTCTransportRequestorInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("webRTCTransportRequestor", writeWebRTCTransportRequestorInteractionInfo); Map writeChimeInteractionInfo = new LinkedHashMap<>(); Map writeChimeActiveChimeIDCommandParams = new LinkedHashMap(); CommandParameterInfo chimeactiveChimeIDCommandParameterInfo = diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt new file mode 100644 index 0000000000..912de29377 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt @@ -0,0 +1,144 @@ +/* + * + * 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.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamChangedEvent( + val audioStreamID: UInt, + val streamType: Optional, + val audioCodec: Optional, + val channelCount: Optional, + val sampleRate: Optional, + val bitRate: Optional, + val bitDepth: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (audioCodec.isPresent) { + val optaudioCodec = audioCodec.get() + put(ContextSpecificTag(TAG_AUDIO_CODEC), optaudioCodec) + } + if (channelCount.isPresent) { + val optchannelCount = channelCount.get() + put(ContextSpecificTag(TAG_CHANNEL_COUNT), optchannelCount) + } + if (sampleRate.isPresent) { + val optsampleRate = sampleRate.get() + put(ContextSpecificTag(TAG_SAMPLE_RATE), optsampleRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (bitDepth.isPresent) { + val optbitDepth = bitDepth.get() + put(ContextSpecificTag(TAG_BIT_DEPTH), optbitDepth) + } + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val audioCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_CODEC))) + } else { + Optional.empty() + } + val channelCount = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHANNEL_COUNT))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CHANNEL_COUNT))) + } else { + Optional.empty() + } + val sampleRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SAMPLE_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_SAMPLE_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val bitDepth = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_DEPTH))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_DEPTH))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt new file mode 100644 index 0000000000..7863af3d86 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt @@ -0,0 +1,158 @@ +/* + * + * 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.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + val snapshotStreamID: UInt, + val imageCodec: Optional, + val frameRate: Optional, + val bitRate: Optional, + val minResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val quality: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + if (imageCodec.isPresent) { + val optimageCodec = imageCodec.get() + put(ContextSpecificTag(TAG_IMAGE_CODEC), optimageCodec) + } + if (frameRate.isPresent) { + val optframeRate = frameRate.get() + put(ContextSpecificTag(TAG_FRAME_RATE), optframeRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (quality.isPresent) { + val optquality = quality.get() + put(ContextSpecificTag(TAG_QUALITY), optquality) + } + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC))) + } else { + Optional.empty() + } + val frameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_FRAME_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val quality = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_QUALITY))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_QUALITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt new file mode 100644 index 0000000000..cbe9480493 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt @@ -0,0 +1,214 @@ +/* + * + * 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.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamChangedEvent( + val videoStreamID: UInt, + val streamType: Optional, + val videoCodec: Optional, + val minFrameRate: Optional, + val maxFrameRate: Optional, + val minResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + chip.devicecontroller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val minBitRate: Optional, + val maxBitRate: Optional, + val minFragmentLen: Optional, + val maxFragmentLen: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (videoCodec.isPresent) { + val optvideoCodec = videoCodec.get() + put(ContextSpecificTag(TAG_VIDEO_CODEC), optvideoCodec) + } + if (minFrameRate.isPresent) { + val optminFrameRate = minFrameRate.get() + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), optminFrameRate) + } + if (maxFrameRate.isPresent) { + val optmaxFrameRate = maxFrameRate.get() + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), optmaxFrameRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (minBitRate.isPresent) { + val optminBitRate = minBitRate.get() + put(ContextSpecificTag(TAG_MIN_BIT_RATE), optminBitRate) + } + if (maxBitRate.isPresent) { + val optmaxBitRate = maxBitRate.get() + put(ContextSpecificTag(TAG_MAX_BIT_RATE), optmaxBitRate) + } + if (minFragmentLen.isPresent) { + val optminFragmentLen = minFragmentLen.get() + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), optminFragmentLen) + } + if (maxFragmentLen.isPresent) { + val optmaxFragmentLen = maxFragmentLen.get() + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), optmaxFragmentLen) + } + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val videoCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_CODEC))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_CODEC))) + } else { + Optional.empty() + } + val minFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAME_RATE))) + } else { + Optional.empty() + } + val maxFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAME_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + chip.devicecontroller.cluster.structs + .CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val minBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_MIN_BIT_RATE))) + } else { + Optional.empty() + } + val maxBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_BIT_RATE))) { + Optional.of(tlvReader.getULong(ContextSpecificTag(TAG_MAX_BIT_RATE))) + } else { + Optional.empty() + } + val minFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) + } else { + Optional.empty() + } + val maxFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt new file mode 100644 index 0000000000..ce1aba9101 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt @@ -0,0 +1,68 @@ +/* + * + * 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.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneStoppedEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneStoppedEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt new file mode 100644 index 0000000000..610fee6521 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt @@ -0,0 +1,68 @@ +/* + * + * 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.cluster.eventstructs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeredEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUInt(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeredEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 6187cfbe7c..2aed70a3dc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -19,6 +19,15 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterChannelPagingStruct.kt", @@ -162,6 +171,12 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", ] eventstructs_sources = [ @@ -180,6 +195,9 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterActiveChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/DeviceEnergyManagementClusterPowerAdjustEndEvent.kt", @@ -249,4 +267,6 @@ eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt", ] \ No newline at end of file diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt new file mode 100644 index 0000000000..c1b428af89 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt @@ -0,0 +1,111 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioCapabilitiesStruct( + val maxNumberOfChannels: UInt, + val supportedCodecs: List, + val supportedSampleRates: List, + val supportedBitDepths: List, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n") + append("\tmaxNumberOfChannels : $maxNumberOfChannels\n") + append("\tsupportedCodecs : $supportedCodecs\n") + append("\tsupportedSampleRates : $supportedSampleRates\n") + append("\tsupportedBitDepths : $supportedBitDepths\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS), maxNumberOfChannels) + startArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + for (item in supportedCodecs.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + for (item in supportedSampleRates.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + for (item in supportedBitDepths.iterator()) { + put(AnonymousTag, item) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_MAX_NUMBER_OF_CHANNELS = 0 + private const val TAG_SUPPORTED_CODECS = 1 + private const val TAG_SUPPORTED_SAMPLE_RATES = 2 + private const val TAG_SUPPORTED_BIT_DEPTHS = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioCapabilitiesStruct { + tlvReader.enterStructure(tlvTag) + val maxNumberOfChannels = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS)) + val supportedCodecs = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedSampleRates = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getULong(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedBitDepths = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt new file mode 100644 index 0000000000..5acfc37aad --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt @@ -0,0 +1,101 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamStruct( + val audioStreamID: UInt, + val streamType: UInt, + val audioCodec: UInt, + val channelCount: UInt, + val sampleRate: ULong, + val bitRate: ULong, + val bitDepth: UInt, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamStruct {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_AUDIO_CODEC), audioCodec) + put(ContextSpecificTag(TAG_CHANNEL_COUNT), channelCount) + put(ContextSpecificTag(TAG_SAMPLE_RATE), sampleRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + put(ContextSpecificTag(TAG_BIT_DEPTH), bitDepth) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamStruct { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val audioCodec = tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_CODEC)) + val channelCount = tlvReader.getUInt(ContextSpecificTag(TAG_CHANNEL_COUNT)) + val sampleRate = tlvReader.getULong(ContextSpecificTag(TAG_SAMPLE_RATE)) + val bitRate = tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE)) + val bitDepth = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_DEPTH)) + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt new file mode 100644 index 0000000000..4bdf703326 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + val codec: UInt, + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: ULong, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n") + append("\tcodec : $codec\n") + append("\tresolution : $resolution\n") + append("\tminBitRate : $minBitRate\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CODEC), codec) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + endStructure() + } + } + + companion object { + private const val TAG_CODEC = 0 + private const val TAG_RESOLUTION = 1 + private const val TAG_MIN_BIT_RATE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + tlvReader.enterStructure(tlvTag) + val codec = tlvReader.getUInt(ContextSpecificTag(TAG_CODEC)) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getULong(ContextSpecificTag(TAG_MIN_BIT_RATE)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt new file mode 100644 index 0000000000..fa66c969ca --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotParamsStruct( + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxFrameRate: UInt, + val imageCodec: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n") + append("\tresolution : $resolution\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\timageCodec : $imageCodec\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + endStructure() + } + } + + companion object { + private const val TAG_RESOLUTION = 0 + private const val TAG_MAX_FRAME_RATE = 1 + private const val TAG_IMAGE_CODEC = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotParamsStruct { + tlvReader.enterStructure(tlvTag) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val maxFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val imageCodec = tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt new file mode 100644 index 0000000000..8686343573 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt @@ -0,0 +1,109 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamStruct( + val snapshotStreamID: UInt, + val imageCodec: UInt, + val frameRate: UInt, + val bitRate: ULong, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val quality: UInt, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + put(ContextSpecificTag(TAG_FRAME_RATE), frameRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_QUALITY), quality) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamStruct { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = tlvReader.getUInt(ContextSpecificTag(TAG_IMAGE_CODEC)) + val frameRate = tlvReader.getUInt(ContextSpecificTag(TAG_FRAME_RATE)) + val bitRate = tlvReader.getULong(ContextSpecificTag(TAG_BIT_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val quality = tlvReader.getUInt(ContextSpecificTag(TAG_QUALITY)) + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt new file mode 100644 index 0000000000..f8fde5e2c8 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt @@ -0,0 +1,59 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoResolutionStruct(val width: UInt, val height: UInt) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoResolutionStruct {\n") + append("\twidth : $width\n") + append("\theight : $height\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_WIDTH), width) + put(ContextSpecificTag(TAG_HEIGHT), height) + endStructure() + } + } + + companion object { + private const val TAG_WIDTH = 0 + private const val TAG_HEIGHT = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoResolutionStruct { + tlvReader.enterStructure(tlvTag) + val width = tlvReader.getUInt(ContextSpecificTag(TAG_WIDTH)) + val height = tlvReader.getUInt(ContextSpecificTag(TAG_HEIGHT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoResolutionStruct(width, height) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt new file mode 100644 index 0000000000..ed6516bd11 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt @@ -0,0 +1,83 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoSensorParamsStruct( + val sensorWidth: UInt, + val sensorHeight: UInt, + val HDRCapable: Boolean, + val maxFPS: UInt, + val maxHDRFPS: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n") + append("\tsensorWidth : $sensorWidth\n") + append("\tsensorHeight : $sensorHeight\n") + append("\tHDRCapable : $HDRCapable\n") + append("\tmaxFPS : $maxFPS\n") + append("\tmaxHDRFPS : $maxHDRFPS\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SENSOR_WIDTH), sensorWidth) + put(ContextSpecificTag(TAG_SENSOR_HEIGHT), sensorHeight) + put(ContextSpecificTag(TAG_HDR_CAPABLE), HDRCapable) + put(ContextSpecificTag(TAG_MAX_FPS), maxFPS) + put(ContextSpecificTag(TAG_MAX_HDRFPS), maxHDRFPS) + endStructure() + } + } + + companion object { + private const val TAG_SENSOR_WIDTH = 0 + private const val TAG_SENSOR_HEIGHT = 1 + private const val TAG_HDR_CAPABLE = 2 + private const val TAG_MAX_FPS = 3 + private const val TAG_MAX_HDRFPS = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoSensorParamsStruct { + tlvReader.enterStructure(tlvTag) + val sensorWidth = tlvReader.getUInt(ContextSpecificTag(TAG_SENSOR_WIDTH)) + val sensorHeight = tlvReader.getUInt(ContextSpecificTag(TAG_SENSOR_HEIGHT)) + val HDRCapable = tlvReader.getBoolean(ContextSpecificTag(TAG_HDR_CAPABLE)) + val maxFPS = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FPS)) + val maxHDRFPS = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_HDRFPS)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt new file mode 100644 index 0000000000..048a8a928f --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt @@ -0,0 +1,162 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamStruct( + val videoStreamID: UInt, + val streamType: UInt, + val videoCodec: UInt, + val minFrameRate: UInt, + val maxFrameRate: UInt, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: ULong, + val maxBitRate: ULong, + val minFragmentLen: UInt, + val maxFragmentLen: UInt, + val watermarkEnabled: Optional, + val OSDEnabled: Optional, + val referenceCount: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamStruct {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("\twatermarkEnabled : $watermarkEnabled\n") + append("\tOSDEnabled : $OSDEnabled\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_VIDEO_CODEC), videoCodec) + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), minFrameRate) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + put(ContextSpecificTag(TAG_MAX_BIT_RATE), maxBitRate) + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), minFragmentLen) + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), maxFragmentLen) + if (watermarkEnabled.isPresent) { + val optwatermarkEnabled = watermarkEnabled.get() + put(ContextSpecificTag(TAG_WATERMARK_ENABLED), optwatermarkEnabled) + } + if (OSDEnabled.isPresent) { + val optOSDEnabled = OSDEnabled.get() + put(ContextSpecificTag(TAG_OSD_ENABLED), optOSDEnabled) + } + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + private const val TAG_WATERMARK_ENABLED = 11 + private const val TAG_OSD_ENABLED = 12 + private const val TAG_REFERENCE_COUNT = 13 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamStruct { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoCodec = tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_CODEC)) + val minFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAME_RATE)) + val maxFrameRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getULong(ContextSpecificTag(TAG_MIN_BIT_RATE)) + val maxBitRate = tlvReader.getULong(ContextSpecificTag(TAG_MAX_BIT_RATE)) + val minFragmentLen = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN)) + val maxFragmentLen = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN)) + val watermarkEnabled = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATERMARK_ENABLED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_WATERMARK_ENABLED))) + } else { + Optional.empty() + } + val OSDEnabled = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OSD_ENABLED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_OSD_ENABLED))) + } else { + Optional.empty() + } + val referenceCount = tlvReader.getUInt(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + watermarkEnabled, + OSDEnabled, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt new file mode 100644 index 0000000000..1e4804bc3a --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt @@ -0,0 +1,69 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterViewportStruct( + val x1: UInt, + val y1: UInt, + val x2: UInt, + val y2: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterViewportStruct {\n") + append("\tx1 : $x1\n") + append("\ty1 : $y1\n") + append("\tx2 : $x2\n") + append("\ty2 : $y2\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X1), x1) + put(ContextSpecificTag(TAG_Y1), y1) + put(ContextSpecificTag(TAG_X2), x2) + put(ContextSpecificTag(TAG_Y2), y2) + endStructure() + } + } + + companion object { + private const val TAG_X1 = 0 + private const val TAG_Y1 = 1 + private const val TAG_X2 = 2 + private const val TAG_Y2 = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterViewportStruct { + tlvReader.enterStructure(tlvTag) + val x1 = tlvReader.getUInt(ContextSpecificTag(TAG_X1)) + val y1 = tlvReader.getUInt(ContextSpecificTag(TAG_Y1)) + val x2 = tlvReader.getUInt(ContextSpecificTag(TAG_X2)) + val y2 = tlvReader.getUInt(ContextSpecificTag(TAG_Y2)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt new file mode 100644 index 0000000000..4c249b90b1 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt @@ -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. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterICEServerStruct( + val urls: List, + val username: Optional, + val credential: Optional, + val caid: Optional, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterICEServerStruct {\n") + append("\turls : $urls\n") + append("\tusername : $username\n") + append("\tcredential : $credential\n") + append("\tcaid : $caid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_URLS)) + for (item in urls.iterator()) { + put(AnonymousTag, item) + } + endArray() + if (username.isPresent) { + val optusername = username.get() + put(ContextSpecificTag(TAG_USERNAME), optusername) + } + if (credential.isPresent) { + val optcredential = credential.get() + put(ContextSpecificTag(TAG_CREDENTIAL), optcredential) + } + if (caid.isPresent) { + val optcaid = caid.get() + put(ContextSpecificTag(TAG_CAID), optcaid) + } + endStructure() + } + } + + companion object { + private const val TAG_URLS = 1 + private const val TAG_USERNAME = 2 + private const val TAG_CREDENTIAL = 3 + private const val TAG_CAID = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WebRTCTransportRequestorClusterICEServerStruct { + tlvReader.enterStructure(tlvTag) + val urls = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_URLS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + val username = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_USERNAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_USERNAME))) + } else { + Optional.empty() + } + val credential = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIAL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CREDENTIAL))) + } else { + Optional.empty() + } + val caid = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAID))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_CAID))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterICEServerStruct(urls, username, credential, caid) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt new file mode 100644 index 0000000000..40c666bbd6 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt @@ -0,0 +1,115 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterWebRTCSessionStruct( + val id: UInt, + val peerNodeID: ULong, + val peerFabricIndex: UInt, + val streamType: UInt, + val videoStreamID: UInt?, + val audioStreamID: UInt?, + val metadataOptions: UInt, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n") + append("\tid : $id\n") + append("\tpeerNodeID : $peerNodeID\n") + append("\tpeerFabricIndex : $peerFabricIndex\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tmetadataOptions : $metadataOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + put(ContextSpecificTag(TAG_PEER_NODE_ID), peerNodeID) + put(ContextSpecificTag(TAG_PEER_FABRIC_INDEX), peerFabricIndex) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID != null) { + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_METADATA_OPTIONS), metadataOptions) + endStructure() + } + } + + companion object { + private const val TAG_ID = 1 + private const val TAG_PEER_NODE_ID = 2 + private const val TAG_PEER_FABRIC_INDEX = 3 + private const val TAG_STREAM_TYPE = 4 + private const val TAG_VIDEO_STREAM_ID = 5 + private const val TAG_AUDIO_STREAM_ID = 6 + private const val TAG_METADATA_OPTIONS = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WebRTCTransportRequestorClusterWebRTCSessionStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getUInt(ContextSpecificTag(TAG_ID)) + val peerNodeID = tlvReader.getULong(ContextSpecificTag(TAG_PEER_NODE_ID)) + val peerFabricIndex = tlvReader.getUInt(ContextSpecificTag(TAG_PEER_FABRIC_INDEX)) + val streamType = tlvReader.getUInt(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val metadataOptions = tlvReader.getUInt(ContextSpecificTag(TAG_METADATA_OPTIONS)) + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt new file mode 100644 index 0000000000..649b0338fd --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UInt, val y: UInt) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianVertexStruct {\n") + append("\tx : $x\n") + append("\ty : $y\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X), x) + put(ContextSpecificTag(TAG_Y), y) + endStructure() + } + } + + companion object { + private const val TAG_X = 0 + private const val TAG_Y = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct { + tlvReader.enterStructure(tlvTag) + val x = tlvReader.getUInt(ContextSpecificTag(TAG_X)) + val y = tlvReader.getUInt(ContextSpecificTag(TAG_Y)) + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianVertexStruct(x, y) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt new file mode 100644 index 0000000000..b42e6ebd80 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt @@ -0,0 +1,90 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianZoneStruct( + val name: String, + val use: UInt, + val vertices: List, + val color: Optional, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianZoneStruct {\n") + append("\tname : $name\n") + append("\tuse : $use\n") + append("\tvertices : $vertices\n") + append("\tcolor : $color\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_USE), use) + startArray(ContextSpecificTag(TAG_VERTICES)) + for (item in vertices.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (color.isPresent) { + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_USE = 1 + private const val TAG_VERTICES = 2 + private const val TAG_COLOR = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val use = tlvReader.getUInt(ContextSpecificTag(TAG_USE)) + val vertices = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES)) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val color = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt new file mode 100644 index 0000000000..3073c80152 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt @@ -0,0 +1,64 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneInformationStruct( + val zoneID: UInt, + val zoneType: UInt, + val zoneSource: UInt, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneInformationStruct {\n") + append("\tzoneID : $zoneID\n") + append("\tzoneType : $zoneType\n") + append("\tzoneSource : $zoneSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ZONE_ID), zoneID) + put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType) + put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource) + endStructure() + } + } + + companion object { + private const val TAG_ZONE_ID = 0 + private const val TAG_ZONE_TYPE = 1 + private const val TAG_ZONE_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct { + tlvReader.enterStructure(tlvTag) + val zoneID = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_ID)) + val zoneType = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_TYPE)) + val zoneSource = tlvReader.getUInt(ContextSpecificTag(TAG_ZONE_SOURCE)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt new file mode 100644 index 0000000000..3e55171ac8 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * 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.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeringTimeControlStruct( + val initialDuration: UInt, + val augmentationDuration: UInt, + val maxDuration: ULong, + val blindDuration: UInt, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUInt(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUInt(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getULong(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUInt(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt new file mode 100644 index 0000000000..c9f6d50d06 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt @@ -0,0 +1,6746 @@ +/* + * + * 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.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.BooleanSubscriptionState +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.WriteRequest +import matter.controller.WriteRequests +import matter.controller.WriteResponse +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class AudioStreamAllocateResponse(val audioStreamID: UShort) + + class VideoStreamAllocateResponse(val videoStreamID: UShort) + + class SnapshotStreamAllocateResponse(val snapshotStreamID: UShort) + + class VideoSensorParamsAttribute( + val value: CameraAvStreamManagementClusterVideoSensorParamsStruct? + ) + + sealed class VideoSensorParamsAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterVideoSensorParamsStruct?) : + VideoSensorParamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : VideoSensorParamsAttributeSubscriptionState() + + object SubscriptionEstablished : VideoSensorParamsAttributeSubscriptionState() + } + + class MinViewportAttribute(val value: CameraAvStreamManagementClusterVideoResolutionStruct?) + + sealed class MinViewportAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterVideoResolutionStruct?) : + MinViewportAttributeSubscriptionState() + + data class Error(val exception: Exception) : MinViewportAttributeSubscriptionState() + + object SubscriptionEstablished : MinViewportAttributeSubscriptionState() + } + + class RateDistortionTradeOffPointsAttribute( + val value: List? + ) + + sealed class RateDistortionTradeOffPointsAttributeSubscriptionState { + data class Success( + val value: List? + ) : RateDistortionTradeOffPointsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + RateDistortionTradeOffPointsAttributeSubscriptionState() + + object SubscriptionEstablished : RateDistortionTradeOffPointsAttributeSubscriptionState() + } + + class MicrophoneCapabilitiesAttribute( + val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct? + ) + + sealed class MicrophoneCapabilitiesAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct?) : + MicrophoneCapabilitiesAttributeSubscriptionState() + + data class Error(val exception: Exception) : MicrophoneCapabilitiesAttributeSubscriptionState() + + object SubscriptionEstablished : MicrophoneCapabilitiesAttributeSubscriptionState() + } + + class SpeakerCapabilitiesAttribute( + val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct? + ) + + sealed class SpeakerCapabilitiesAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterAudioCapabilitiesStruct?) : + SpeakerCapabilitiesAttributeSubscriptionState() + + data class Error(val exception: Exception) : SpeakerCapabilitiesAttributeSubscriptionState() + + object SubscriptionEstablished : SpeakerCapabilitiesAttributeSubscriptionState() + } + + class SupportedSnapshotParamsAttribute( + val value: List? + ) + + sealed class SupportedSnapshotParamsAttributeSubscriptionState { + data class Success(val value: List?) : + SupportedSnapshotParamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + SupportedSnapshotParamsAttributeSubscriptionState() + + object SubscriptionEstablished : SupportedSnapshotParamsAttributeSubscriptionState() + } + + class CurrentVideoCodecsAttribute(val value: List?) + + sealed class CurrentVideoCodecsAttributeSubscriptionState { + data class Success(val value: List?) : CurrentVideoCodecsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentVideoCodecsAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentVideoCodecsAttributeSubscriptionState() + } + + class CurrentSnapshotConfigAttribute( + val value: CameraAvStreamManagementClusterSnapshotParamsStruct? + ) + + sealed class CurrentSnapshotConfigAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterSnapshotParamsStruct?) : + CurrentSnapshotConfigAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentSnapshotConfigAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentSnapshotConfigAttributeSubscriptionState() + } + + class FabricsUsingCameraAttribute(val value: List) + + sealed class FabricsUsingCameraAttributeSubscriptionState { + data class Success(val value: List) : FabricsUsingCameraAttributeSubscriptionState() + + data class Error(val exception: Exception) : FabricsUsingCameraAttributeSubscriptionState() + + object SubscriptionEstablished : FabricsUsingCameraAttributeSubscriptionState() + } + + class AllocatedVideoStreamsAttribute( + val value: List? + ) + + sealed class AllocatedVideoStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedVideoStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : AllocatedVideoStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedVideoStreamsAttributeSubscriptionState() + } + + class AllocatedAudioStreamsAttribute( + val value: List? + ) + + sealed class AllocatedAudioStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedAudioStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : AllocatedAudioStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedAudioStreamsAttributeSubscriptionState() + } + + class AllocatedSnapshotStreamsAttribute( + val value: List? + ) + + sealed class AllocatedSnapshotStreamsAttributeSubscriptionState { + data class Success(val value: List?) : + AllocatedSnapshotStreamsAttributeSubscriptionState() + + data class Error(val exception: Exception) : + AllocatedSnapshotStreamsAttributeSubscriptionState() + + object SubscriptionEstablished : AllocatedSnapshotStreamsAttributeSubscriptionState() + } + + class RankedVideoStreamPrioritiesListAttribute(val value: List?) + + sealed class RankedVideoStreamPrioritiesListAttributeSubscriptionState { + data class Success(val value: List?) : + RankedVideoStreamPrioritiesListAttributeSubscriptionState() + + data class Error(val exception: Exception) : + RankedVideoStreamPrioritiesListAttributeSubscriptionState() + + object SubscriptionEstablished : RankedVideoStreamPrioritiesListAttributeSubscriptionState() + } + + class ViewportAttribute(val value: CameraAvStreamManagementClusterViewportStruct?) + + sealed class ViewportAttributeSubscriptionState { + data class Success(val value: CameraAvStreamManagementClusterViewportStruct?) : + ViewportAttributeSubscriptionState() + + data class Error(val exception: Exception) : ViewportAttributeSubscriptionState() + + object SubscriptionEstablished : ViewportAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun audioStreamAllocate( + streamType: UByte, + audioCodec: UByte, + channelCount: UByte, + sampleRate: UInt, + bitRate: UInt, + bitDepth: UByte, + timedInvokeTimeout: Duration? = null, + ): AudioStreamAllocateResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_STREAM_TYPE_REQ), streamType) + + val TAG_AUDIO_CODEC_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_AUDIO_CODEC_REQ), audioCodec) + + val TAG_CHANNEL_COUNT_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_CHANNEL_COUNT_REQ), channelCount) + + val TAG_SAMPLE_RATE_REQ: Int = 3 + tlvWriter.put(ContextSpecificTag(TAG_SAMPLE_RATE_REQ), sampleRate) + + val TAG_BIT_RATE_REQ: Int = 4 + tlvWriter.put(ContextSpecificTag(TAG_BIT_RATE_REQ), bitRate) + + val TAG_BIT_DEPTH_REQ: Int = 5 + tlvWriter.put(ContextSpecificTag(TAG_BIT_DEPTH_REQ), bitDepth) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_AUDIO_STREAM_ID: Int = 0 + var audioStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_AUDIO_STREAM_ID)) { + audioStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (audioStreamID_decoded == null) { + throw IllegalStateException("audioStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return AudioStreamAllocateResponse(audioStreamID_decoded) + } + + suspend fun audioStreamDeallocate(audioStreamID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_AUDIO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_AUDIO_STREAM_ID_REQ), audioStreamID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun videoStreamAllocate( + streamType: UByte, + videoCodec: UByte, + minFrameRate: UShort, + maxFrameRate: UShort, + minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + minBitRate: UInt, + maxBitRate: UInt, + minFragmentLen: UShort, + maxFragmentLen: UShort, + watermarkEnabled: Boolean?, + OSDEnabled: Boolean?, + timedInvokeTimeout: Duration? = null, + ): VideoStreamAllocateResponse { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_STREAM_TYPE_REQ), streamType) + + val TAG_VIDEO_CODEC_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_CODEC_REQ), videoCodec) + + val TAG_MIN_FRAME_RATE_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_MIN_FRAME_RATE_REQ), minFrameRate) + + val TAG_MAX_FRAME_RATE_REQ: Int = 3 + tlvWriter.put(ContextSpecificTag(TAG_MAX_FRAME_RATE_REQ), maxFrameRate) + + val TAG_MIN_RESOLUTION_REQ: Int = 4 + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION_REQ), tlvWriter) + + val TAG_MAX_RESOLUTION_REQ: Int = 5 + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION_REQ), tlvWriter) + + val TAG_MIN_BIT_RATE_REQ: Int = 6 + tlvWriter.put(ContextSpecificTag(TAG_MIN_BIT_RATE_REQ), minBitRate) + + val TAG_MAX_BIT_RATE_REQ: Int = 7 + tlvWriter.put(ContextSpecificTag(TAG_MAX_BIT_RATE_REQ), maxBitRate) + + val TAG_MIN_FRAGMENT_LEN_REQ: Int = 8 + tlvWriter.put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN_REQ), minFragmentLen) + + val TAG_MAX_FRAGMENT_LEN_REQ: Int = 9 + tlvWriter.put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN_REQ), maxFragmentLen) + + val TAG_WATERMARK_ENABLED_REQ: Int = 10 + watermarkEnabled?.let { + tlvWriter.put(ContextSpecificTag(TAG_WATERMARK_ENABLED_REQ), watermarkEnabled) + } + + val TAG_OSD_ENABLED_REQ: Int = 11 + OSDEnabled?.let { tlvWriter.put(ContextSpecificTag(TAG_OSD_ENABLED_REQ), OSDEnabled) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_VIDEO_STREAM_ID: Int = 0 + var videoStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_VIDEO_STREAM_ID)) { + videoStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (videoStreamID_decoded == null) { + throw IllegalStateException("videoStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return VideoStreamAllocateResponse(videoStreamID_decoded) + } + + suspend fun videoStreamModify( + videoStreamID: UShort, + resolution: CameraAvStreamManagementClusterVideoResolutionStruct?, + watermarkEnabled: Boolean?, + OSDEnabled: Boolean?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + + val TAG_RESOLUTION_REQ: Int = 1 + resolution?.let { resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION_REQ), tlvWriter) } + + val TAG_WATERMARK_ENABLED_REQ: Int = 2 + watermarkEnabled?.let { + tlvWriter.put(ContextSpecificTag(TAG_WATERMARK_ENABLED_REQ), watermarkEnabled) + } + + val TAG_OSD_ENABLED_REQ: Int = 3 + OSDEnabled?.let { tlvWriter.put(ContextSpecificTag(TAG_OSD_ENABLED_REQ), OSDEnabled) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun videoStreamDeallocate(videoStreamID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 6u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIDEO_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_VIDEO_STREAM_ID_REQ), videoStreamID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun snapshotStreamAllocate( + imageCodec: UByte, + frameRate: UShort, + bitRate: UInt, + minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + quality: UByte, + timedInvokeTimeout: Duration? = null, + ): SnapshotStreamAllocateResponse { + val commandId: UInt = 7u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_IMAGE_CODEC_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_IMAGE_CODEC_REQ), imageCodec) + + val TAG_FRAME_RATE_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_FRAME_RATE_REQ), frameRate) + + val TAG_BIT_RATE_REQ: Int = 2 + tlvWriter.put(ContextSpecificTag(TAG_BIT_RATE_REQ), bitRate) + + val TAG_MIN_RESOLUTION_REQ: Int = 3 + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION_REQ), tlvWriter) + + val TAG_MAX_RESOLUTION_REQ: Int = 4 + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION_REQ), tlvWriter) + + val TAG_QUALITY_REQ: Int = 5 + tlvWriter.put(ContextSpecificTag(TAG_QUALITY_REQ), quality) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_SNAPSHOT_STREAM_ID: Int = 0 + var snapshotStreamID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) { + snapshotStreamID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (snapshotStreamID_decoded == null) { + throw IllegalStateException("snapshotStreamID not found in TLV") + } + + tlvReader.exitContainer() + + return SnapshotStreamAllocateResponse(snapshotStreamID_decoded) + } + + suspend fun snapshotStreamDeallocate( + snapshotStreamID: UShort, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 9u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_SNAPSHOT_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID_REQ), snapshotStreamID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setStreamPriorities( + streamPriorities: List, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 10u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_STREAM_PRIORITIES_REQ: Int = 0 + tlvWriter.startArray(ContextSpecificTag(TAG_STREAM_PRIORITIES_REQ)) + for (item in streamPriorities.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun captureSnapshot( + snapshotStreamID: UShort, + requestedResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 11u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_SNAPSHOT_STREAM_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID_REQ), snapshotStreamID) + + val TAG_REQUESTED_RESOLUTION_REQ: Int = 1 + requestedResolution.toTlv(ContextSpecificTag(TAG_REQUESTED_RESOLUTION_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setViewport( + viewport: CameraAvStreamManagementClusterViewportStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 13u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_VIEWPORT_REQ: Int = 0 + viewport.toTlv(ContextSpecificTag(TAG_VIEWPORT_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setImageRotation(angle: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 14u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ANGLE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ANGLE_REQ), angle) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setImageFlipHorizontal(enabled: Boolean, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 15u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ENABLED_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun setImageFlipVertical(enabled: Boolean, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 16u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ENABLED_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ENABLED_REQ), enabled) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readMaxConcurrentVideoEncodersAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Maxconcurrentvideoencoders attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxConcurrentVideoEncodersAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Maxconcurrentvideoencoders attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxEncodedPixelRateAttribute(): UInt? { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Maxencodedpixelrate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxEncodedPixelRateAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Maxencodedpixelrate attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readVideoSensorParamsAttribute(): VideoSensorParamsAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Videosensorparams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoSensorParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoSensorParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return VideoSensorParamsAttribute(decodedValue) + } + + suspend fun subscribeVideoSensorParamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + VideoSensorParamsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Videosensorparams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoSensorParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoSensorParamsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + + decodedValue?.let { emit(VideoSensorParamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(VideoSensorParamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionCapableAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Nightvisioncapable attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeNightVisionCapableAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Nightvisioncapable attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMinViewportAttribute(): MinViewportAttribute { + val ATTRIBUTE_ID: UInt = 4u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Minviewport attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MinViewportAttribute(decodedValue) + } + + suspend fun subscribeMinViewportAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + MinViewportAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Minviewport attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterVideoResolutionStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(MinViewportAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MinViewportAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readRateDistortionTradeOffPointsAttribute(): RateDistortionTradeOffPointsAttribute { + val ATTRIBUTE_ID: UInt = 5u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Ratedistortiontradeoffpoints attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return RateDistortionTradeOffPointsAttribute(decodedValue) + } + + suspend fun subscribeRateDistortionTradeOffPointsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 5u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + RateDistortionTradeOffPointsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Ratedistortiontradeoffpoints attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: + List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { + emit(RateDistortionTradeOffPointsAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(RateDistortionTradeOffPointsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxPreRollBufferSizeAttribute(): UInt? { + val ATTRIBUTE_ID: UInt = 6u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Maxprerollbuffersize attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeMaxPreRollBufferSizeAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 6u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Maxprerollbuffersize attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneCapabilitiesAttribute(): MicrophoneCapabilitiesAttribute { + val ATTRIBUTE_ID: UInt = 7u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphonecapabilities attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return MicrophoneCapabilitiesAttribute(decodedValue) + } + + suspend fun subscribeMicrophoneCapabilitiesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 7u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + MicrophoneCapabilitiesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphonecapabilities attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + + decodedValue?.let { emit(MicrophoneCapabilitiesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(MicrophoneCapabilitiesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerCapabilitiesAttribute(): SpeakerCapabilitiesAttribute { + val ATTRIBUTE_ID: UInt = 8u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Speakercapabilities attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return SpeakerCapabilitiesAttribute(decodedValue) + } + + suspend fun subscribeSpeakerCapabilitiesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 8u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SpeakerCapabilitiesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Speakercapabilities attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterAudioCapabilitiesStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterAudioCapabilitiesStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + } else { + null + } + + decodedValue?.let { emit(SpeakerCapabilitiesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SpeakerCapabilitiesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTwoWayTalkSupportAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 9u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Twowaytalksupport attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTwoWayTalkSupportAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 9u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Twowaytalksupport attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSupportedSnapshotParamsAttribute(): SupportedSnapshotParamsAttribute { + val ATTRIBUTE_ID: UInt = 10u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Supportedsnapshotparams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return SupportedSnapshotParamsAttribute(decodedValue) + } + + suspend fun subscribeSupportedSnapshotParamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 10u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SupportedSnapshotParamsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Supportedsnapshotparams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(SupportedSnapshotParamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(SupportedSnapshotParamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMaxNetworkBandwidthAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 11u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Maxnetworkbandwidth attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeMaxNetworkBandwidthAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 11u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Maxnetworkbandwidth attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentFrameRateAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 12u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentframerate attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeCurrentFrameRateAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 12u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentframerate attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHDRModeEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 13u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Hdrmodeenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeHDRModeEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 13u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeHDRModeEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 13u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Hdrmodeenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentVideoCodecsAttribute(): CurrentVideoCodecsAttribute { + val ATTRIBUTE_ID: UInt = 14u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentvideocodecs attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return CurrentVideoCodecsAttribute(decodedValue) + } + + suspend fun subscribeCurrentVideoCodecsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 14u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentVideoCodecsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentvideocodecs attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(CurrentVideoCodecsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentVideoCodecsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readCurrentSnapshotConfigAttribute(): CurrentSnapshotConfigAttribute { + val ATTRIBUTE_ID: UInt = 15u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentsnapshotconfig attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterSnapshotParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return CurrentSnapshotConfigAttribute(decodedValue) + } + + suspend fun subscribeCurrentSnapshotConfigAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 15u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentSnapshotConfigAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentsnapshotconfig attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterSnapshotParamsStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterSnapshotParamsStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(CurrentSnapshotConfigAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentSnapshotConfigAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFabricsUsingCameraAttribute(): FabricsUsingCameraAttribute { + val ATTRIBUTE_ID: UInt = 16u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Fabricsusingcamera attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return FabricsUsingCameraAttribute(decodedValue) + } + + suspend fun subscribeFabricsUsingCameraAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + FabricsUsingCameraAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Fabricsusingcamera attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(FabricsUsingCameraAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(FabricsUsingCameraAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedVideoStreamsAttribute(): AllocatedVideoStreamsAttribute { + val ATTRIBUTE_ID: UInt = 17u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Allocatedvideostreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterVideoStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedVideoStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedVideoStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 17u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AllocatedVideoStreamsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Allocatedvideostreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterVideoStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedVideoStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedVideoStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedAudioStreamsAttribute(): AllocatedAudioStreamsAttribute { + val ATTRIBUTE_ID: UInt = 18u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Allocatedaudiostreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(CameraAvStreamManagementClusterAudioStreamStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedAudioStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedAudioStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 18u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AllocatedAudioStreamsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Allocatedaudiostreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterAudioStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedAudioStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedAudioStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAllocatedSnapshotStreamsAttribute(): AllocatedSnapshotStreamsAttribute { + val ATTRIBUTE_ID: UInt = 19u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Allocatedsnapshotstreams attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotStreamStruct.fromTlv(AnonymousTag, tlvReader) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + return AllocatedSnapshotStreamsAttribute(decodedValue) + } + + suspend fun subscribeAllocatedSnapshotStreamsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 19u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AllocatedSnapshotStreamsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Allocatedsnapshotstreams attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + CameraAvStreamManagementClusterSnapshotStreamStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(AllocatedSnapshotStreamsAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(AllocatedSnapshotStreamsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readRankedVideoStreamPrioritiesListAttribute(): + RankedVideoStreamPrioritiesListAttribute { + val ATTRIBUTE_ID: UInt = 20u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { + "Rankedvideostreamprioritieslist attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return RankedVideoStreamPrioritiesListAttribute(decodedValue) + } + + suspend fun writeRankedVideoStreamPrioritiesListAttribute( + value: List, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 20u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeRankedVideoStreamPrioritiesListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 20u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + RankedVideoStreamPrioritiesListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Rankedvideostreamprioritieslist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { + emit(RankedVideoStreamPrioritiesListAttributeSubscriptionState.Success(it)) + } + } + SubscriptionState.SubscriptionEstablished -> { + emit(RankedVideoStreamPrioritiesListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSoftRecordingPrivacyModeEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 21u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { + "Softrecordingprivacymodeenabled attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSoftRecordingPrivacyModeEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 21u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSoftRecordingPrivacyModeEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 21u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Softrecordingprivacymodeenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSoftLivestreamPrivacyModeEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 22u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { + "Softlivestreamprivacymodeenabled attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSoftLivestreamPrivacyModeEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 22u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSoftLivestreamPrivacyModeEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 22u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Softlivestreamprivacymodeenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readHardPrivacyModeOnAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 23u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Hardprivacymodeon attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeHardPrivacyModeOnAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 23u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Hardprivacymodeon attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 24u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Nightvision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeNightVisionAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 24u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeNightVisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 24u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Nightvision attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNightVisionIllumAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 25u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Nightvisionillum attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeNightVisionIllumAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 25u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeNightVisionIllumAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 25u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Nightvisionillum attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAWBEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 26u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Awbenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeAWBEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 26u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeAWBEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 26u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Awbenabled attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAutoShutterSpeedEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 27u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Autoshutterspeedenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeAutoShutterSpeedEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 27u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeAutoShutterSpeedEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 27u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Autoshutterspeedenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAutoISOEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 28u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Autoisoenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeAutoISOEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 28u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeAutoISOEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 28u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Autoisoenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readViewportAttribute(): ViewportAttribute { + val ATTRIBUTE_ID: UInt = 29u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Viewport attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterViewportStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterViewportStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + return ViewportAttribute(decodedValue) + } + + suspend fun subscribeViewportAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 29u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + ViewportAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Viewport attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: CameraAvStreamManagementClusterViewportStruct? = + if (tlvReader.isNextTag(AnonymousTag)) { + CameraAvStreamManagementClusterViewportStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + + decodedValue?.let { emit(ViewportAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ViewportAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerMutedAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 30u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Speakermuted attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerMutedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 30u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerMutedAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 30u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Speakermuted attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerVolumeLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 31u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Speakervolumelevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerVolumeLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 31u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerVolumeLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 31u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Speakervolumelevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerMaxLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 32u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Speakermaxlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerMaxLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 32u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerMaxLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 32u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Speakermaxlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSpeakerMinLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 33u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Speakerminlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeSpeakerMinLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 33u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSpeakerMinLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 33u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Speakerminlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneMutedAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 34u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphonemuted attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicrophoneMutedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 34u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicrophoneMutedAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 34u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphonemuted attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneVolumeLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 35u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphonevolumelevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicrophoneVolumeLevelAttribute( + value: UByte, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 35u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicrophoneVolumeLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 35u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphonevolumelevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneMaxLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 36u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphonemaxlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicrophoneMaxLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 36u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicrophoneMaxLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 36u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphonemaxlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneMinLevelAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 37u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphoneminlevel attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicrophoneMinLevelAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 37u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicrophoneMinLevelAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 37u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphoneminlevel attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readMicrophoneAGCEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 38u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Microphoneagcenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeMicrophoneAGCEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 38u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeMicrophoneAGCEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 38u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Microphoneagcenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageRotationAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 39u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Imagerotation attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageRotationAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 39u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Imagerotation attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageFlipHorizontalAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 40u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Imagefliphorizontal attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageFlipHorizontalAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 40u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Imagefliphorizontal attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readImageFlipVerticalAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 41u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Imageflipvertical attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeImageFlipVerticalAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 41u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Imageflipvertical attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readLocalVideoRecordingEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 42u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Localvideorecordingenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeLocalVideoRecordingEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 42u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeLocalVideoRecordingEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 42u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Localvideorecordingenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readLocalSnapshotRecordingEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 43u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { + "Localsnapshotrecordingenabled attribute not found in response" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeLocalSnapshotRecordingEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 43u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeLocalSnapshotRecordingEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 43u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Localsnapshotrecordingenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readStatusLightEnabledAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 44u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Statuslightenabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeStatusLightEnabledAttribute( + value: Boolean, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 44u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeStatusLightEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 44u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + BooleanSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Statuslightenabled attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readStatusLightBrightnessAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 45u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Statuslightbrightness attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeStatusLightBrightnessAttribute( + value: UByte, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 45u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeStatusLightBrightnessAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 45u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Statuslightbrightness attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readDepthSensorStatusAttribute(): UByte? { + val ATTRIBUTE_ID: UInt = 46u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Depthsensorstatus attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun writeDepthSensorStatusAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 46u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeDepthSensorStatusAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 46u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Depthsensorstatus attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUByte(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(CameraAvStreamManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1361u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt index 92e76e250f..93fafc69f4 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/GeneralCommissioningCluster.kt @@ -1170,6 +1170,99 @@ class GeneralCommissioningCluster( } } + suspend fun readTCUpdateDeadlineAttribute(): UInt? { + val ATTRIBUTE_ID: UInt = 9u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Tcupdatedeadline attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeTCUpdateDeadlineAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 9u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Tcupdatedeadline attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUInt(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt new file mode 100644 index 0000000000..2d5f7d8ed5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt @@ -0,0 +1,873 @@ +/* + * + * 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.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class CurrentSessionsAttribute( + val value: List + ) + + sealed class CurrentSessionsAttributeSubscriptionState { + data class Success(val value: List) : + CurrentSessionsAttributeSubscriptionState() + + data class Error(val exception: Exception) : CurrentSessionsAttributeSubscriptionState() + + object SubscriptionEstablished : CurrentSessionsAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun offer( + webRTCSessionID: UShort, + sdp: String, + ICEServers: List?, + ICETransportPolicy: String?, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 1u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_SDP_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_SDP_REQ), sdp) + + val TAG_ICE_SERVERS_REQ: Int = 2 + ICEServers?.let { + tlvWriter.startArray(ContextSpecificTag(TAG_ICE_SERVERS_REQ)) + for (item in ICEServers.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + } + + val TAG_ICE_TRANSPORT_POLICY_REQ: Int = 3 + ICETransportPolicy?.let { + tlvWriter.put(ContextSpecificTag(TAG_ICE_TRANSPORT_POLICY_REQ), ICETransportPolicy) + } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun answer(webRTCSessionID: UShort, sdp: String, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_SDP_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_SDP_REQ), sdp) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun ICECandidate( + webRTCSessionID: UShort, + ICECandidate: String, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_ICE_CANDIDATE_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_ICE_CANDIDATE_REQ), ICECandidate) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun end(webRTCSessionID: UShort, reason: UByte, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 4u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_WEB_RTC_SESSION_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_WEB_RTC_SESSION_ID_REQ), webRTCSessionID) + + val TAG_REASON_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_REASON_REQ), reason) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readCurrentSessionsAttribute(): CurrentSessionsAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Currentsessions attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(WebRTCTransportRequestorClusterWebRTCSessionStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + return CurrentSessionsAttribute(decodedValue) + } + + suspend fun subscribeCurrentSessionsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + CurrentSessionsAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Currentsessions attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + WebRTCTransportRequestorClusterWebRTCSessionStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + + emit(CurrentSessionsAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(CurrentSessionsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(WebRTCTransportRequestorCluster::class.java.name) + const val CLUSTER_ID: UInt = 1364u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt new file mode 100644 index 0000000000..c51fe6eaf0 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt @@ -0,0 +1,1296 @@ +/* + * + * 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.controller.cluster.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.WriteRequest +import matter.controller.WriteRequests +import matter.controller.WriteResponse +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementCluster( + private val controller: MatterController, + private val endpointId: UShort, +) { + class CreateTwoDCartesianZoneResponse(val zoneID: UShort) + + class GetTwoDCartesianZoneResponse(val zones: List) + + class SupportedZoneSourcesAttribute(val value: List) + + sealed class SupportedZoneSourcesAttributeSubscriptionState { + data class Success(val value: List) : SupportedZoneSourcesAttributeSubscriptionState() + + data class Error(val exception: Exception) : SupportedZoneSourcesAttributeSubscriptionState() + + object SubscriptionEstablished : SupportedZoneSourcesAttributeSubscriptionState() + } + + class ZonesAttribute(val value: List?) + + sealed class ZonesAttributeSubscriptionState { + data class Success(val value: List?) : + ZonesAttributeSubscriptionState() + + data class Error(val exception: Exception) : ZonesAttributeSubscriptionState() + + object SubscriptionEstablished : ZonesAttributeSubscriptionState() + } + + class TimeControlAttribute(val value: List) + + sealed class TimeControlAttributeSubscriptionState { + data class Success(val value: List) : + TimeControlAttributeSubscriptionState() + + data class Error(val exception: Exception) : TimeControlAttributeSubscriptionState() + + object SubscriptionEstablished : TimeControlAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun createTwoDCartesianZone( + zone: ZoneManagementClusterTwoDCartesianZoneStruct, + timedInvokeTimeout: Duration? = null, + ): CreateTwoDCartesianZoneResponse { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_REQ: Int = 0 + zone.toTlv(ContextSpecificTag(TAG_ZONE_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_ZONE_ID: Int = 0 + var zoneID_decoded: UShort? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_ZONE_ID)) { + zoneID_decoded = tlvReader.getUShort(tag) + } else { + tlvReader.skipElement() + } + } + + if (zoneID_decoded == null) { + throw IllegalStateException("zoneID not found in TLV") + } + + tlvReader.exitContainer() + + return CreateTwoDCartesianZoneResponse(zoneID_decoded) + } + + suspend fun updateTwoDCartesianZone( + zoneID: UShort, + zone: ZoneManagementClusterTwoDCartesianZoneStruct, + timedInvokeTimeout: Duration? = null, + ) { + val commandId: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) + + val TAG_ZONE_REQ: Int = 1 + zone.toTlv(ContextSpecificTag(TAG_ZONE_REQ), tlvWriter) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun getTwoDCartesianZone( + zoneID: UShort?, + timedInvokeTimeout: Duration? = null, + ): GetTwoDCartesianZoneResponse { + val commandId: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + zoneID?.let { tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) } + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_ZONES: Int = 0 + var zones_decoded: List? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_ZONES)) { + zones_decoded = + buildList { + tlvReader.enterArray(tag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianZoneStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + tlvReader.skipElement() + } + } + + if (zones_decoded == null) { + throw IllegalStateException("zones not found in TLV") + } + + tlvReader.exitContainer() + + return GetTwoDCartesianZoneResponse(zones_decoded) + } + + suspend fun removeZone(zoneID: UShort, timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 5u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_ZONE_ID_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_ZONE_ID_REQ), zoneID) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readSupportedZoneSourcesAttribute(): SupportedZoneSourcesAttribute { + val ATTRIBUTE_ID: UInt = 0u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Supportedzonesources attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return SupportedZoneSourcesAttribute(decodedValue) + } + + suspend fun subscribeSupportedZoneSourcesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + SupportedZoneSourcesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Supportedzonesources attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(SupportedZoneSourcesAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(SupportedZoneSourcesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readZonesAttribute(): ZonesAttribute { + val ATTRIBUTE_ID: UInt = 1u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Zones attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + return ZonesAttribute(decodedValue) + } + + suspend fun subscribeZonesAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + ZonesAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Zones attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List? = + if (tlvReader.isNextTag(AnonymousTag)) { + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneInformationStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } else { + null + } + + decodedValue?.let { emit(ZonesAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(ZonesAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readTimeControlAttribute(): TimeControlAttribute { + val ATTRIBUTE_ID: UInt = 2u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Timecontrol attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + return TimeControlAttribute(decodedValue) + } + + suspend fun writeTimeControlAttribute( + value: List, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.startArray(AnonymousTag) + for (item in value.iterator()) { + item.toTlv(AnonymousTag, tlvWriter) + } + tlvWriter.endArray() + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeTimeControlAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + TimeControlAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Timecontrol attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add( + ZoneManagementClusterZoneTriggeringTimeControlStruct.fromTlv( + AnonymousTag, + tlvReader, + ) + ) + } + tlvReader.exitContainer() + } + + emit(TimeControlAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(TimeControlAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readSensitivityAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 3u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Sensitivity attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun writeSensitivityAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 3u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeSensitivityAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 3u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UByteSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Sensitivity attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + GeneratedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AcceptedCommandListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + EventListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + AttributeListAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UIntSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + UShortSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(ZoneManagementCluster::class.java.name) + const val CLUSTER_ID: UInt = 1360u + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt new file mode 100644 index 0000000000..c398f49796 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt @@ -0,0 +1,144 @@ +/* + * + * 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.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamChangedEvent( + val audioStreamID: UShort, + val streamType: Optional, + val audioCodec: Optional, + val channelCount: Optional, + val sampleRate: Optional, + val bitRate: Optional, + val bitDepth: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamChangedEvent {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (audioCodec.isPresent) { + val optaudioCodec = audioCodec.get() + put(ContextSpecificTag(TAG_AUDIO_CODEC), optaudioCodec) + } + if (channelCount.isPresent) { + val optchannelCount = channelCount.get() + put(ContextSpecificTag(TAG_CHANNEL_COUNT), optchannelCount) + } + if (sampleRate.isPresent) { + val optsampleRate = sampleRate.get() + put(ContextSpecificTag(TAG_SAMPLE_RATE), optsampleRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (bitDepth.isPresent) { + val optbitDepth = bitDepth.get() + put(ContextSpecificTag(TAG_BIT_DEPTH), optbitDepth) + } + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val audioCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AUDIO_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_AUDIO_CODEC))) + } else { + Optional.empty() + } + val channelCount = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CHANNEL_COUNT))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_CHANNEL_COUNT))) + } else { + Optional.empty() + } + val sampleRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_SAMPLE_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_SAMPLE_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val bitDepth = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_DEPTH))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_BIT_DEPTH))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamChangedEvent( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt new file mode 100644 index 0000000000..074df191c9 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt @@ -0,0 +1,156 @@ +/* + * + * 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.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + val snapshotStreamID: UShort, + val imageCodec: Optional, + val frameRate: Optional, + val bitRate: Optional, + val minResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val quality: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamChangedEvent {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + if (imageCodec.isPresent) { + val optimageCodec = imageCodec.get() + put(ContextSpecificTag(TAG_IMAGE_CODEC), optimageCodec) + } + if (frameRate.isPresent) { + val optframeRate = frameRate.get() + put(ContextSpecificTag(TAG_FRAME_RATE), optframeRate) + } + if (bitRate.isPresent) { + val optbitRate = bitRate.get() + put(ContextSpecificTag(TAG_BIT_RATE), optbitRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (quality.isPresent) { + val optquality = quality.get() + put(ContextSpecificTag(TAG_QUALITY), optquality) + } + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_IMAGE_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC))) + } else { + Optional.empty() + } + val frameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_FRAME_RATE))) + } else { + Optional.empty() + } + val bitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val quality = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_QUALITY))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_QUALITY))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamChangedEvent( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt new file mode 100644 index 0000000000..c618556cd5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt @@ -0,0 +1,212 @@ +/* + * + * 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.controller.cluster.eventstructs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamChangedEvent( + val videoStreamID: UShort, + val streamType: Optional, + val videoCodec: Optional, + val minFrameRate: Optional, + val maxFrameRate: Optional, + val minResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val maxResolution: + Optional< + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + >, + val minBitRate: Optional, + val maxBitRate: Optional, + val minFragmentLen: Optional, + val maxFragmentLen: Optional, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamChangedEvent {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + if (streamType.isPresent) { + val optstreamType = streamType.get() + put(ContextSpecificTag(TAG_STREAM_TYPE), optstreamType) + } + if (videoCodec.isPresent) { + val optvideoCodec = videoCodec.get() + put(ContextSpecificTag(TAG_VIDEO_CODEC), optvideoCodec) + } + if (minFrameRate.isPresent) { + val optminFrameRate = minFrameRate.get() + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), optminFrameRate) + } + if (maxFrameRate.isPresent) { + val optmaxFrameRate = maxFrameRate.get() + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), optmaxFrameRate) + } + if (minResolution.isPresent) { + val optminResolution = minResolution.get() + optminResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + } + if (maxResolution.isPresent) { + val optmaxResolution = maxResolution.get() + optmaxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + } + if (minBitRate.isPresent) { + val optminBitRate = minBitRate.get() + put(ContextSpecificTag(TAG_MIN_BIT_RATE), optminBitRate) + } + if (maxBitRate.isPresent) { + val optmaxBitRate = maxBitRate.get() + put(ContextSpecificTag(TAG_MAX_BIT_RATE), optmaxBitRate) + } + if (minFragmentLen.isPresent) { + val optminFragmentLen = minFragmentLen.get() + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), optminFragmentLen) + } + if (maxFragmentLen.isPresent) { + val optmaxFragmentLen = maxFragmentLen.get() + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), optmaxFragmentLen) + } + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamChangedEvent { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_STREAM_TYPE))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE))) + } else { + Optional.empty() + } + val videoCodec = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_VIDEO_CODEC))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_VIDEO_CODEC))) + } else { + Optional.empty() + } + val minFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAME_RATE))) + } else { + Optional.empty() + } + val maxFrameRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAME_RATE))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE))) + } else { + Optional.empty() + } + val minResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val maxResolution = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_RESOLUTION))) { + Optional.of( + matter.controller.cluster.structs.CameraAvStreamManagementClusterVideoResolutionStruct + .fromTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), tlvReader) + ) + } else { + Optional.empty() + } + val minBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE))) + } else { + Optional.empty() + } + val maxBitRate = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_BIT_RATE))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MAX_BIT_RATE))) + } else { + Optional.empty() + } + val minFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN))) + } else { + Optional.empty() + } + val maxFragmentLen = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamChangedEvent( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt new file mode 100644 index 0000000000..424437cf89 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt @@ -0,0 +1,68 @@ +/* + * + * 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.controller.cluster.eventstructs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneStoppedEvent(val zones: List, val reason: UByte) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneStoppedEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneStoppedEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneStoppedEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt new file mode 100644 index 0000000000..42300fd350 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt @@ -0,0 +1,68 @@ +/* + * + * 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.controller.cluster.eventstructs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeredEvent(val zones: List, val reason: UByte) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeredEvent {\n") + append("\tzones : $zones\n") + append("\treason : $reason\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_ZONES)) + for (item in zones.iterator()) { + put(AnonymousTag, item) + } + endArray() + put(ContextSpecificTag(TAG_REASON), reason) + endStructure() + } + } + + companion object { + private const val TAG_ZONES = 0 + private const val TAG_REASON = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneTriggeredEvent { + tlvReader.enterStructure(tlvTag) + val zones = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_ZONES)) + while (!tlvReader.isEndOfContainer()) { + this.add(tlvReader.getUShort(AnonymousTag)) + } + tlvReader.exitContainer() + } + val reason = tlvReader.getUByte(ContextSpecificTag(TAG_REASON)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeredEvent(zones, reason) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 6a7e5b317e..15406011f7 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -19,6 +19,15 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BridgedDeviceBasicInformationClusterProductAppearanceStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterChannelInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterChannelPagingStruct.kt", @@ -162,6 +171,12 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeTagStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterICEServerStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportProviderClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt", ] matter_eventstructs_sources = [ @@ -180,6 +195,9 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterActiveChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterReachableChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/BridgedDeviceBasicInformationClusterStartUpEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterAudioStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterSnapshotStreamChangedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CameraAvStreamManagementClusterVideoStreamChangedEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/CommissionerControlClusterCommissioningRequestResultEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/DemandResponseLoadControlClusterLoadControlEventStatusChangeEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/DeviceEnergyManagementClusterPowerAdjustEndEvent.kt", @@ -249,6 +267,8 @@ matter_eventstructs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterAssociationFailureEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterConnectionStatusEvent.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/WiFiNetworkDiagnosticsClusterDisconnectionEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneStoppedEvent.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/eventstructs/ZoneManagementClusterZoneTriggeredEvent.kt", ] matter_clusters_sources = [ @@ -267,6 +287,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateConfigurationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CameraAvStreamManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonDioxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonMonoxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt", @@ -373,7 +394,9 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportProviderCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WebRTCTransportRequestorCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkDiagnosticsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WiFiNetworkManagementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/WindowCoveringCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ZoneManagementCluster.kt", ] \ No newline at end of file diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt new file mode 100644 index 0000000000..89db650126 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioCapabilitiesStruct.kt @@ -0,0 +1,111 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioCapabilitiesStruct( + val maxNumberOfChannels: UByte, + val supportedCodecs: List, + val supportedSampleRates: List, + val supportedBitDepths: List, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioCapabilitiesStruct {\n") + append("\tmaxNumberOfChannels : $maxNumberOfChannels\n") + append("\tsupportedCodecs : $supportedCodecs\n") + append("\tsupportedSampleRates : $supportedSampleRates\n") + append("\tsupportedBitDepths : $supportedBitDepths\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS), maxNumberOfChannels) + startArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + for (item in supportedCodecs.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + for (item in supportedSampleRates.iterator()) { + put(AnonymousTag, item) + } + endArray() + startArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + for (item in supportedBitDepths.iterator()) { + put(AnonymousTag, item) + } + endArray() + endStructure() + } + } + + companion object { + private const val TAG_MAX_NUMBER_OF_CHANNELS = 0 + private const val TAG_SUPPORTED_CODECS = 1 + private const val TAG_SUPPORTED_SAMPLE_RATES = 2 + private const val TAG_SUPPORTED_BIT_DEPTHS = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioCapabilitiesStruct { + tlvReader.enterStructure(tlvTag) + val maxNumberOfChannels = tlvReader.getUByte(ContextSpecificTag(TAG_MAX_NUMBER_OF_CHANNELS)) + val supportedCodecs = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_CODECS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedSampleRates = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_SAMPLE_RATES)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + val supportedBitDepths = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_SUPPORTED_BIT_DEPTHS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUByte(AnonymousTag)) + } + tlvReader.exitContainer() + } + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioCapabilitiesStruct( + maxNumberOfChannels, + supportedCodecs, + supportedSampleRates, + supportedBitDepths, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt new file mode 100644 index 0000000000..0ede21e0d3 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterAudioStreamStruct.kt @@ -0,0 +1,101 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterAudioStreamStruct( + val audioStreamID: UShort, + val streamType: UByte, + val audioCodec: UByte, + val channelCount: UByte, + val sampleRate: UInt, + val bitRate: UInt, + val bitDepth: UByte, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterAudioStreamStruct {\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tstreamType : $streamType\n") + append("\taudioCodec : $audioCodec\n") + append("\tchannelCount : $channelCount\n") + append("\tsampleRate : $sampleRate\n") + append("\tbitRate : $bitRate\n") + append("\tbitDepth : $bitDepth\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_AUDIO_CODEC), audioCodec) + put(ContextSpecificTag(TAG_CHANNEL_COUNT), channelCount) + put(ContextSpecificTag(TAG_SAMPLE_RATE), sampleRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + put(ContextSpecificTag(TAG_BIT_DEPTH), bitDepth) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_AUDIO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_AUDIO_CODEC = 2 + private const val TAG_CHANNEL_COUNT = 3 + private const val TAG_SAMPLE_RATE = 4 + private const val TAG_BIT_RATE = 5 + private const val TAG_BIT_DEPTH = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterAudioStreamStruct { + tlvReader.enterStructure(tlvTag) + val audioStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val audioCodec = tlvReader.getUByte(ContextSpecificTag(TAG_AUDIO_CODEC)) + val channelCount = tlvReader.getUByte(ContextSpecificTag(TAG_CHANNEL_COUNT)) + val sampleRate = tlvReader.getUInt(ContextSpecificTag(TAG_SAMPLE_RATE)) + val bitRate = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE)) + val bitDepth = tlvReader.getUByte(ContextSpecificTag(TAG_BIT_DEPTH)) + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterAudioStreamStruct( + audioStreamID, + streamType, + audioCodec, + channelCount, + sampleRate, + bitRate, + bitDepth, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt new file mode 100644 index 0000000000..b6d493446b --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + val codec: UByte, + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: UInt, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct {\n") + append("\tcodec : $codec\n") + append("\tresolution : $resolution\n") + append("\tminBitRate : $minBitRate\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CODEC), codec) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + endStructure() + } + } + + companion object { + private const val TAG_CODEC = 0 + private const val TAG_RESOLUTION = 1 + private const val TAG_MIN_BIT_RATE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct { + tlvReader.enterStructure(tlvTag) + val codec = tlvReader.getUByte(ContextSpecificTag(TAG_CODEC)) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct( + codec, + resolution, + minBitRate, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt new file mode 100644 index 0000000000..5f639597bc --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotParamsStruct.kt @@ -0,0 +1,75 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotParamsStruct( + val resolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxFrameRate: UShort, + val imageCodec: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotParamsStruct {\n") + append("\tresolution : $resolution\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\timageCodec : $imageCodec\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + resolution.toTlv(ContextSpecificTag(TAG_RESOLUTION), this) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + endStructure() + } + } + + companion object { + private const val TAG_RESOLUTION = 0 + private const val TAG_MAX_FRAME_RATE = 1 + private const val TAG_IMAGE_CODEC = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotParamsStruct { + tlvReader.enterStructure(tlvTag) + val resolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_RESOLUTION), + tlvReader, + ) + val maxFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val imageCodec = tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotParamsStruct( + resolution, + maxFrameRate, + imageCodec, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt new file mode 100644 index 0000000000..8e98459d04 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterSnapshotStreamStruct.kt @@ -0,0 +1,109 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterSnapshotStreamStruct( + val snapshotStreamID: UShort, + val imageCodec: UByte, + val frameRate: UShort, + val bitRate: UInt, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val quality: UByte, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterSnapshotStreamStruct {\n") + append("\tsnapshotStreamID : $snapshotStreamID\n") + append("\timageCodec : $imageCodec\n") + append("\tframeRate : $frameRate\n") + append("\tbitRate : $bitRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tquality : $quality\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID), snapshotStreamID) + put(ContextSpecificTag(TAG_IMAGE_CODEC), imageCodec) + put(ContextSpecificTag(TAG_FRAME_RATE), frameRate) + put(ContextSpecificTag(TAG_BIT_RATE), bitRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_QUALITY), quality) + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_SNAPSHOT_STREAM_ID = 0 + private const val TAG_IMAGE_CODEC = 1 + private const val TAG_FRAME_RATE = 2 + private const val TAG_BIT_RATE = 3 + private const val TAG_MIN_RESOLUTION = 4 + private const val TAG_MAX_RESOLUTION = 5 + private const val TAG_QUALITY = 6 + private const val TAG_REFERENCE_COUNT = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterSnapshotStreamStruct { + tlvReader.enterStructure(tlvTag) + val snapshotStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_SNAPSHOT_STREAM_ID)) + val imageCodec = tlvReader.getUByte(ContextSpecificTag(TAG_IMAGE_CODEC)) + val frameRate = tlvReader.getUShort(ContextSpecificTag(TAG_FRAME_RATE)) + val bitRate = tlvReader.getUInt(ContextSpecificTag(TAG_BIT_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val quality = tlvReader.getUByte(ContextSpecificTag(TAG_QUALITY)) + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterSnapshotStreamStruct( + snapshotStreamID, + imageCodec, + frameRate, + bitRate, + minResolution, + maxResolution, + quality, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt new file mode 100644 index 0000000000..4e15313837 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoResolutionStruct.kt @@ -0,0 +1,59 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoResolutionStruct(val width: UShort, val height: UShort) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoResolutionStruct {\n") + append("\twidth : $width\n") + append("\theight : $height\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_WIDTH), width) + put(ContextSpecificTag(TAG_HEIGHT), height) + endStructure() + } + } + + companion object { + private const val TAG_WIDTH = 0 + private const val TAG_HEIGHT = 1 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoResolutionStruct { + tlvReader.enterStructure(tlvTag) + val width = tlvReader.getUShort(ContextSpecificTag(TAG_WIDTH)) + val height = tlvReader.getUShort(ContextSpecificTag(TAG_HEIGHT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoResolutionStruct(width, height) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt new file mode 100644 index 0000000000..5cf6052a75 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoSensorParamsStruct.kt @@ -0,0 +1,83 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoSensorParamsStruct( + val sensorWidth: UShort, + val sensorHeight: UShort, + val HDRCapable: Boolean, + val maxFPS: UShort, + val maxHDRFPS: UShort, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoSensorParamsStruct {\n") + append("\tsensorWidth : $sensorWidth\n") + append("\tsensorHeight : $sensorHeight\n") + append("\tHDRCapable : $HDRCapable\n") + append("\tmaxFPS : $maxFPS\n") + append("\tmaxHDRFPS : $maxHDRFPS\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_SENSOR_WIDTH), sensorWidth) + put(ContextSpecificTag(TAG_SENSOR_HEIGHT), sensorHeight) + put(ContextSpecificTag(TAG_HDR_CAPABLE), HDRCapable) + put(ContextSpecificTag(TAG_MAX_FPS), maxFPS) + put(ContextSpecificTag(TAG_MAX_HDRFPS), maxHDRFPS) + endStructure() + } + } + + companion object { + private const val TAG_SENSOR_WIDTH = 0 + private const val TAG_SENSOR_HEIGHT = 1 + private const val TAG_HDR_CAPABLE = 2 + private const val TAG_MAX_FPS = 3 + private const val TAG_MAX_HDRFPS = 4 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoSensorParamsStruct { + tlvReader.enterStructure(tlvTag) + val sensorWidth = tlvReader.getUShort(ContextSpecificTag(TAG_SENSOR_WIDTH)) + val sensorHeight = tlvReader.getUShort(ContextSpecificTag(TAG_SENSOR_HEIGHT)) + val HDRCapable = tlvReader.getBoolean(ContextSpecificTag(TAG_HDR_CAPABLE)) + val maxFPS = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FPS)) + val maxHDRFPS = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_HDRFPS)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoSensorParamsStruct( + sensorWidth, + sensorHeight, + HDRCapable, + maxFPS, + maxHDRFPS, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt new file mode 100644 index 0000000000..65941f8ba5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterVideoStreamStruct.kt @@ -0,0 +1,162 @@ +/* + * + * 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.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterVideoStreamStruct( + val videoStreamID: UShort, + val streamType: UByte, + val videoCodec: UByte, + val minFrameRate: UShort, + val maxFrameRate: UShort, + val minResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val maxResolution: CameraAvStreamManagementClusterVideoResolutionStruct, + val minBitRate: UInt, + val maxBitRate: UInt, + val minFragmentLen: UShort, + val maxFragmentLen: UShort, + val watermarkEnabled: Optional, + val OSDEnabled: Optional, + val referenceCount: UByte, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterVideoStreamStruct {\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\tstreamType : $streamType\n") + append("\tvideoCodec : $videoCodec\n") + append("\tminFrameRate : $minFrameRate\n") + append("\tmaxFrameRate : $maxFrameRate\n") + append("\tminResolution : $minResolution\n") + append("\tmaxResolution : $maxResolution\n") + append("\tminBitRate : $minBitRate\n") + append("\tmaxBitRate : $maxBitRate\n") + append("\tminFragmentLen : $minFragmentLen\n") + append("\tmaxFragmentLen : $maxFragmentLen\n") + append("\twatermarkEnabled : $watermarkEnabled\n") + append("\tOSDEnabled : $OSDEnabled\n") + append("\treferenceCount : $referenceCount\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + put(ContextSpecificTag(TAG_VIDEO_CODEC), videoCodec) + put(ContextSpecificTag(TAG_MIN_FRAME_RATE), minFrameRate) + put(ContextSpecificTag(TAG_MAX_FRAME_RATE), maxFrameRate) + minResolution.toTlv(ContextSpecificTag(TAG_MIN_RESOLUTION), this) + maxResolution.toTlv(ContextSpecificTag(TAG_MAX_RESOLUTION), this) + put(ContextSpecificTag(TAG_MIN_BIT_RATE), minBitRate) + put(ContextSpecificTag(TAG_MAX_BIT_RATE), maxBitRate) + put(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN), minFragmentLen) + put(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN), maxFragmentLen) + if (watermarkEnabled.isPresent) { + val optwatermarkEnabled = watermarkEnabled.get() + put(ContextSpecificTag(TAG_WATERMARK_ENABLED), optwatermarkEnabled) + } + if (OSDEnabled.isPresent) { + val optOSDEnabled = OSDEnabled.get() + put(ContextSpecificTag(TAG_OSD_ENABLED), optOSDEnabled) + } + put(ContextSpecificTag(TAG_REFERENCE_COUNT), referenceCount) + endStructure() + } + } + + companion object { + private const val TAG_VIDEO_STREAM_ID = 0 + private const val TAG_STREAM_TYPE = 1 + private const val TAG_VIDEO_CODEC = 2 + private const val TAG_MIN_FRAME_RATE = 3 + private const val TAG_MAX_FRAME_RATE = 4 + private const val TAG_MIN_RESOLUTION = 5 + private const val TAG_MAX_RESOLUTION = 6 + private const val TAG_MIN_BIT_RATE = 7 + private const val TAG_MAX_BIT_RATE = 8 + private const val TAG_MIN_FRAGMENT_LEN = 9 + private const val TAG_MAX_FRAGMENT_LEN = 10 + private const val TAG_WATERMARK_ENABLED = 11 + private const val TAG_OSD_ENABLED = 12 + private const val TAG_REFERENCE_COUNT = 13 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): CameraAvStreamManagementClusterVideoStreamStruct { + tlvReader.enterStructure(tlvTag) + val videoStreamID = tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoCodec = tlvReader.getUByte(ContextSpecificTag(TAG_VIDEO_CODEC)) + val minFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAME_RATE)) + val maxFrameRate = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAME_RATE)) + val minResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MIN_RESOLUTION), + tlvReader, + ) + val maxResolution = + CameraAvStreamManagementClusterVideoResolutionStruct.fromTlv( + ContextSpecificTag(TAG_MAX_RESOLUTION), + tlvReader, + ) + val minBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MIN_BIT_RATE)) + val maxBitRate = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_BIT_RATE)) + val minFragmentLen = tlvReader.getUShort(ContextSpecificTag(TAG_MIN_FRAGMENT_LEN)) + val maxFragmentLen = tlvReader.getUShort(ContextSpecificTag(TAG_MAX_FRAGMENT_LEN)) + val watermarkEnabled = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_WATERMARK_ENABLED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_WATERMARK_ENABLED))) + } else { + Optional.empty() + } + val OSDEnabled = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OSD_ENABLED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_OSD_ENABLED))) + } else { + Optional.empty() + } + val referenceCount = tlvReader.getUByte(ContextSpecificTag(TAG_REFERENCE_COUNT)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterVideoStreamStruct( + videoStreamID, + streamType, + videoCodec, + minFrameRate, + maxFrameRate, + minResolution, + maxResolution, + minBitRate, + maxBitRate, + minFragmentLen, + maxFragmentLen, + watermarkEnabled, + OSDEnabled, + referenceCount, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt new file mode 100644 index 0000000000..f89dac2b39 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/CameraAvStreamManagementClusterViewportStruct.kt @@ -0,0 +1,69 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class CameraAvStreamManagementClusterViewportStruct( + val x1: UShort, + val y1: UShort, + val x2: UShort, + val y2: UShort, +) { + override fun toString(): String = buildString { + append("CameraAvStreamManagementClusterViewportStruct {\n") + append("\tx1 : $x1\n") + append("\ty1 : $y1\n") + append("\tx2 : $x2\n") + append("\ty2 : $y2\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X1), x1) + put(ContextSpecificTag(TAG_Y1), y1) + put(ContextSpecificTag(TAG_X2), x2) + put(ContextSpecificTag(TAG_Y2), y2) + endStructure() + } + } + + companion object { + private const val TAG_X1 = 0 + private const val TAG_Y1 = 1 + private const val TAG_X2 = 2 + private const val TAG_Y2 = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): CameraAvStreamManagementClusterViewportStruct { + tlvReader.enterStructure(tlvTag) + val x1 = tlvReader.getUShort(ContextSpecificTag(TAG_X1)) + val y1 = tlvReader.getUShort(ContextSpecificTag(TAG_Y1)) + val x2 = tlvReader.getUShort(ContextSpecificTag(TAG_X2)) + val y2 = tlvReader.getUShort(ContextSpecificTag(TAG_Y2)) + + tlvReader.exitContainer() + + return CameraAvStreamManagementClusterViewportStruct(x1, y1, x2, y2) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt new file mode 100644 index 0000000000..c7b5e5ef27 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterICEServerStruct.kt @@ -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. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterICEServerStruct( + val urls: List, + val username: Optional, + val credential: Optional, + val caid: Optional, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterICEServerStruct {\n") + append("\turls : $urls\n") + append("\tusername : $username\n") + append("\tcredential : $credential\n") + append("\tcaid : $caid\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + startArray(ContextSpecificTag(TAG_URLS)) + for (item in urls.iterator()) { + put(AnonymousTag, item) + } + endArray() + if (username.isPresent) { + val optusername = username.get() + put(ContextSpecificTag(TAG_USERNAME), optusername) + } + if (credential.isPresent) { + val optcredential = credential.get() + put(ContextSpecificTag(TAG_CREDENTIAL), optcredential) + } + if (caid.isPresent) { + val optcaid = caid.get() + put(ContextSpecificTag(TAG_CAID), optcaid) + } + endStructure() + } + } + + companion object { + private const val TAG_URLS = 1 + private const val TAG_USERNAME = 2 + private const val TAG_CREDENTIAL = 3 + private const val TAG_CAID = 4 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): WebRTCTransportRequestorClusterICEServerStruct { + tlvReader.enterStructure(tlvTag) + val urls = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_URLS)) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getString(AnonymousTag)) + } + tlvReader.exitContainer() + } + val username = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_USERNAME))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_USERNAME))) + } else { + Optional.empty() + } + val credential = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CREDENTIAL))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_CREDENTIAL))) + } else { + Optional.empty() + } + val caid = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_CAID))) { + Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_CAID))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterICEServerStruct(urls, username, credential, caid) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt new file mode 100644 index 0000000000..9c572a4097 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/WebRTCTransportRequestorClusterWebRTCSessionStruct.kt @@ -0,0 +1,115 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class WebRTCTransportRequestorClusterWebRTCSessionStruct( + val id: UShort, + val peerNodeID: ULong, + val peerFabricIndex: UByte, + val streamType: UByte, + val videoStreamID: UShort?, + val audioStreamID: UShort?, + val metadataOptions: UByte, +) { + override fun toString(): String = buildString { + append("WebRTCTransportRequestorClusterWebRTCSessionStruct {\n") + append("\tid : $id\n") + append("\tpeerNodeID : $peerNodeID\n") + append("\tpeerFabricIndex : $peerFabricIndex\n") + append("\tstreamType : $streamType\n") + append("\tvideoStreamID : $videoStreamID\n") + append("\taudioStreamID : $audioStreamID\n") + append("\tmetadataOptions : $metadataOptions\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ID), id) + put(ContextSpecificTag(TAG_PEER_NODE_ID), peerNodeID) + put(ContextSpecificTag(TAG_PEER_FABRIC_INDEX), peerFabricIndex) + put(ContextSpecificTag(TAG_STREAM_TYPE), streamType) + if (videoStreamID != null) { + put(ContextSpecificTag(TAG_VIDEO_STREAM_ID), videoStreamID) + } else { + putNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } + if (audioStreamID != null) { + put(ContextSpecificTag(TAG_AUDIO_STREAM_ID), audioStreamID) + } else { + putNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } + put(ContextSpecificTag(TAG_METADATA_OPTIONS), metadataOptions) + endStructure() + } + } + + companion object { + private const val TAG_ID = 1 + private const val TAG_PEER_NODE_ID = 2 + private const val TAG_PEER_FABRIC_INDEX = 3 + private const val TAG_STREAM_TYPE = 4 + private const val TAG_VIDEO_STREAM_ID = 5 + private const val TAG_AUDIO_STREAM_ID = 6 + private const val TAG_METADATA_OPTIONS = 7 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): WebRTCTransportRequestorClusterWebRTCSessionStruct { + tlvReader.enterStructure(tlvTag) + val id = tlvReader.getUShort(ContextSpecificTag(TAG_ID)) + val peerNodeID = tlvReader.getULong(ContextSpecificTag(TAG_PEER_NODE_ID)) + val peerFabricIndex = tlvReader.getUByte(ContextSpecificTag(TAG_PEER_FABRIC_INDEX)) + val streamType = tlvReader.getUByte(ContextSpecificTag(TAG_STREAM_TYPE)) + val videoStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUShort(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_VIDEO_STREAM_ID)) + null + } + val audioStreamID = + if (!tlvReader.isNull()) { + tlvReader.getUShort(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AUDIO_STREAM_ID)) + null + } + val metadataOptions = tlvReader.getUByte(ContextSpecificTag(TAG_METADATA_OPTIONS)) + + tlvReader.exitContainer() + + return WebRTCTransportRequestorClusterWebRTCSessionStruct( + id, + peerNodeID, + peerFabricIndex, + streamType, + videoStreamID, + audioStreamID, + metadataOptions, + ) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt new file mode 100644 index 0000000000..3ff890b7ec --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianVertexStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianVertexStruct(val x: UShort, val y: UShort) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianVertexStruct {\n") + append("\tx : $x\n") + append("\ty : $y\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_X), x) + put(ContextSpecificTag(TAG_Y), y) + endStructure() + } + } + + companion object { + private const val TAG_X = 0 + private const val TAG_Y = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianVertexStruct { + tlvReader.enterStructure(tlvTag) + val x = tlvReader.getUShort(ContextSpecificTag(TAG_X)) + val y = tlvReader.getUShort(ContextSpecificTag(TAG_Y)) + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianVertexStruct(x, y) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt new file mode 100644 index 0000000000..117fabb709 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterTwoDCartesianZoneStruct.kt @@ -0,0 +1,90 @@ +/* + * + * 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.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.AnonymousTag +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterTwoDCartesianZoneStruct( + val name: String, + val use: UByte, + val vertices: List, + val color: Optional, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterTwoDCartesianZoneStruct {\n") + append("\tname : $name\n") + append("\tuse : $use\n") + append("\tvertices : $vertices\n") + append("\tcolor : $color\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + put(ContextSpecificTag(TAG_USE), use) + startArray(ContextSpecificTag(TAG_VERTICES)) + for (item in vertices.iterator()) { + item.toTlv(AnonymousTag, this) + } + endArray() + if (color.isPresent) { + val optcolor = color.get() + put(ContextSpecificTag(TAG_COLOR), optcolor) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_USE = 1 + private const val TAG_VERTICES = 2 + private const val TAG_COLOR = 3 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterTwoDCartesianZoneStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val use = tlvReader.getUByte(ContextSpecificTag(TAG_USE)) + val vertices = + buildList { + tlvReader.enterArray(ContextSpecificTag(TAG_VERTICES)) + while (!tlvReader.isEndOfContainer()) { + add(ZoneManagementClusterTwoDCartesianVertexStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + val color = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_COLOR))) { + Optional.of(tlvReader.getString(ContextSpecificTag(TAG_COLOR))) + } else { + Optional.empty() + } + + tlvReader.exitContainer() + + return ZoneManagementClusterTwoDCartesianZoneStruct(name, use, vertices, color) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt new file mode 100644 index 0000000000..8de10c83a4 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneInformationStruct.kt @@ -0,0 +1,64 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneInformationStruct( + val zoneID: UShort, + val zoneType: UByte, + val zoneSource: UByte, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneInformationStruct {\n") + append("\tzoneID : $zoneID\n") + append("\tzoneType : $zoneType\n") + append("\tzoneSource : $zoneSource\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ZONE_ID), zoneID) + put(ContextSpecificTag(TAG_ZONE_TYPE), zoneType) + put(ContextSpecificTag(TAG_ZONE_SOURCE), zoneSource) + endStructure() + } + } + + companion object { + private const val TAG_ZONE_ID = 0 + private const val TAG_ZONE_TYPE = 1 + private const val TAG_ZONE_SOURCE = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ZoneManagementClusterZoneInformationStruct { + tlvReader.enterStructure(tlvTag) + val zoneID = tlvReader.getUShort(ContextSpecificTag(TAG_ZONE_ID)) + val zoneType = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_TYPE)) + val zoneSource = tlvReader.getUByte(ContextSpecificTag(TAG_ZONE_SOURCE)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneInformationStruct(zoneID, zoneType, zoneSource) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt new file mode 100644 index 0000000000..8978d74256 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ZoneManagementClusterZoneTriggeringTimeControlStruct.kt @@ -0,0 +1,77 @@ +/* + * + * 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.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ZoneManagementClusterZoneTriggeringTimeControlStruct( + val initialDuration: UShort, + val augmentationDuration: UShort, + val maxDuration: UInt, + val blindDuration: UShort, +) { + override fun toString(): String = buildString { + append("ZoneManagementClusterZoneTriggeringTimeControlStruct {\n") + append("\tinitialDuration : $initialDuration\n") + append("\taugmentationDuration : $augmentationDuration\n") + append("\tmaxDuration : $maxDuration\n") + append("\tblindDuration : $blindDuration\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_INITIAL_DURATION), initialDuration) + put(ContextSpecificTag(TAG_AUGMENTATION_DURATION), augmentationDuration) + put(ContextSpecificTag(TAG_MAX_DURATION), maxDuration) + put(ContextSpecificTag(TAG_BLIND_DURATION), blindDuration) + endStructure() + } + } + + companion object { + private const val TAG_INITIAL_DURATION = 0 + private const val TAG_AUGMENTATION_DURATION = 1 + private const val TAG_MAX_DURATION = 2 + private const val TAG_BLIND_DURATION = 3 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): ZoneManagementClusterZoneTriggeringTimeControlStruct { + tlvReader.enterStructure(tlvTag) + val initialDuration = tlvReader.getUShort(ContextSpecificTag(TAG_INITIAL_DURATION)) + val augmentationDuration = tlvReader.getUShort(ContextSpecificTag(TAG_AUGMENTATION_DURATION)) + val maxDuration = tlvReader.getUInt(ContextSpecificTag(TAG_MAX_DURATION)) + val blindDuration = tlvReader.getUShort(ContextSpecificTag(TAG_BLIND_DURATION)) + + tlvReader.exitContainer() + + return ZoneManagementClusterZoneTriggeringTimeControlStruct( + initialDuration, + augmentationDuration, + maxDuration, + blindDuration, + ) + } + } +} diff --git a/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java b/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java index a3321af6d3..bd1343387a 100644 --- a/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java +++ b/src/controller/java/src/chip/devicecontroller/GetConnectedDeviceCallbackForTestJni.java @@ -37,9 +37,9 @@ public void onDeviceConnected(GetConnectedDeviceCallbackJni callback) { private native void onDeviceConnected(long callbackHandle, long messagingContextHandle); - public void onDeviceConnectionFailure(GetConnectedDeviceCallbackJni callback, int errorCode) { + public void onDeviceConnectionFailure(GetConnectedDeviceCallbackJni callback, long errorCode) { onDeviceConnectionFailure(callback.getCallbackHandle(), errorCode); } - private native void onDeviceConnectionFailure(long callbackHandle, int errorCode); + private native void onDeviceConnectionFailure(long callbackHandle, long errorCode); } diff --git a/src/controller/java/templates/partials/decode_value.zapt b/src/controller/java/templates/partials/decode_value.zapt index 1562309b13..6401ef1c8b 100644 --- a/src/controller/java/templates/partials/decode_value.zapt +++ b/src/controller/java/templates/partials/decode_value.zapt @@ -31,28 +31,30 @@ if ({{source}}.IsNull()) { {{>decode_value target=(concat ../target "_" (asLowerCamelCase label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) omitDeclaration=false earlyReturn=../earlyReturn}} {{/zcl_struct_items_by_struct_and_cluster_name}} - jclass {{asLowerCamelCase type}}StructClass_{{depth}}; - err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); - return {{earlyReturn}}; - } + { + jclass {{asLowerCamelCase type}}StructClass_{{depth}}; + err = chip::JniReferences::GetInstance().GetLocalClassRef(env, "chip/devicecontroller/ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}", {{asLowerCamelCase type}}StructClass_{{depth}}); + if (err != CHIP_NO_ERROR) { + ChipLogError(Zcl, "Could not find class ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}}"); + return {{earlyReturn}}; + } - jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; - err = chip::JniReferences::GetInstance().FindMethod( - env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", - "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", - &{{asLowerCamelCase type}}StructCtor_{{depth}}); - if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); - return {{earlyReturn}}; - } + jmethodID {{asLowerCamelCase type}}StructCtor_{{depth}}; + err = chip::JniReferences::GetInstance().FindMethod( + env, {{asLowerCamelCase type}}StructClass_{{depth}}, "", + "({{#zcl_struct_items_by_struct_and_cluster_name type cluster}}{{asJniSignature type null (asUpperCamelCase ../cluster) true}}{{/zcl_struct_items_by_struct_and_cluster_name}})V", + &{{asLowerCamelCase type}}StructCtor_{{depth}}); + if (err != CHIP_NO_ERROR || {{asLowerCamelCase type}}StructCtor_{{depth}} == nullptr) { + ChipLogError(Zcl, "Could not find ChipStructs${{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} constructor"); + return {{earlyReturn}}; + } - {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} - {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} - , {{../target}}_{{asLowerCamelCase label}} - {{/zcl_struct_items_by_struct_and_cluster_name}} - ); + {{target}} = env->NewObject({{asLowerCamelCase type}}StructClass_{{depth}}, {{asLowerCamelCase type}}StructCtor_{{depth}} + {{#zcl_struct_items_by_struct_and_cluster_name type cluster}} + , {{../target}}_{{asLowerCamelCase label}} + {{/zcl_struct_items_by_struct_and_cluster_name}} + ); + } {{else}} {{#if_is_strongly_typed_chip_enum type}} std::string {{target}}ClassName = "{{asJniClassName type null (asUpperCamelCase cluster)}}"; diff --git a/src/controller/java/tests/README.md b/src/controller/java/tests/README.md index 14aedc4b60..a389cfde6e 100644 --- a/src/controller/java/tests/README.md +++ b/src/controller/java/tests/README.md @@ -4,5 +4,6 @@ ## Building & setting up emulator -Please refer to [Building Android](../../../../docs/guides/android_building.md) -guide to learn how to setup & run these tests in an android emulator. +Please refer to +[Building Android](../../../../docs/platforms/android/android_building.md) guide +to learn how to setup & run these tests in an android emulator. diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 741e40567f..905347e73f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1183,27 +1183,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_revisionCtorSignature.c_str(), jninewElement_0_revision, newElement_0_revision); - jclass deviceTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DescriptorClusterDeviceTypeStruct", deviceTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceTypeStruct"); - return nullptr; - } + jclass deviceTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DescriptorClusterDeviceTypeStruct", deviceTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterDeviceTypeStruct"); + return nullptr; + } - jmethodID deviceTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;)V", - &deviceTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterDeviceTypeStruct constructor"); - return nullptr; - } + jmethodID deviceTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;)V", + &deviceTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterDeviceTypeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(deviceTypeStructStructClass_1, deviceTypeStructStructCtor_1, newElement_0_deviceType, - newElement_0_revision); + newElement_0 = env->NewObject(deviceTypeStructStructClass_1, deviceTypeStructStructCtor_1, + newElement_0_deviceType, newElement_0_revision); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1347,28 +1349,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass semanticTagStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DescriptorClusterSemanticTagStruct", semanticTagStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterSemanticTagStruct"); - return nullptr; - } + jclass semanticTagStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DescriptorClusterSemanticTagStruct", + semanticTagStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DescriptorClusterSemanticTagStruct"); + return nullptr; + } - jmethodID semanticTagStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, semanticTagStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", - &semanticTagStructStructCtor_1); - if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterSemanticTagStruct constructor"); - return nullptr; - } + jmethodID semanticTagStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, semanticTagStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", + &semanticTagStructStructCtor_1); + if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DescriptorClusterSemanticTagStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(semanticTagStructStructClass_1, semanticTagStructStructCtor_1, newElement_0_mfgCode, - newElement_0_namespaceID, newElement_0_tag, newElement_0_label); + newElement_0 = + env->NewObject(semanticTagStructStructClass_1, semanticTagStructStructCtor_1, newElement_0_mfgCode, + newElement_0_namespaceID, newElement_0_tag, newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1605,29 +1611,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass targetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", targetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); - return nullptr; - } + jclass targetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BindingClusterTargetStruct", targetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BindingClusterTargetStruct"); + return nullptr; + } - jmethodID targetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, targetStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", - &targetStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); - return nullptr; - } + jmethodID targetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, targetStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &targetStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BindingClusterTargetStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(targetStructStructClass_1, targetStructStructCtor_1, newElement_0_node, newElement_0_group, - newElement_0_endpoint, newElement_0_cluster, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(targetStructStructClass_1, targetStructStructCtor_1, newElement_0_node, newElement_0_group, + newElement_0_endpoint, newElement_0_cluster, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1883,29 +1891,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_3_deviceType, newElement_3_deviceType); } - jclass accessControlTargetStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", - accessControlTargetStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); - return nullptr; - } + jclass accessControlTargetStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", + accessControlTargetStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); + return nullptr; + } - jmethodID accessControlTargetStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlTargetStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); - if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); - return nullptr; - } + jmethodID accessControlTargetStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlTargetStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); + if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); + return nullptr; + } - newElement_3 = env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, - newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); + newElement_3 = + env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, + newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); + } chip::JniReferences::GetInstance().AddToList(newElement_0_targets, newElement_3); } } @@ -1917,30 +1928,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessControlEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", - accessControlEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); - return nullptr; - } + jclass accessControlEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", + accessControlEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); + return nullptr; + } - jmethodID accessControlEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessControlEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); - return nullptr; - } + jmethodID accessControlEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessControlEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, - newElement_0_privilege, newElement_0_authMode, newElement_0_subjects, - newElement_0_targets, newElement_0_fabricIndex); + newElement_0 = env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, + newElement_0_privilege, newElement_0_authMode, newElement_0_subjects, + newElement_0_targets, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -1974,28 +1987,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessControlExtensionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", - accessControlExtensionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); - return nullptr; - } + jclass accessControlExtensionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", + accessControlExtensionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); + return nullptr; + } - jmethodID accessControlExtensionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", - "([BLjava/lang/Integer;)V", - &accessControlExtensionStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); - return nullptr; - } + jmethodID accessControlExtensionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", + "([BLjava/lang/Integer;)V", + &accessControlExtensionStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, - newElement_0_data, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, + newElement_0_data, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2108,58 +2125,62 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_id, newElement_2_id); } - jclass accessRestrictionStructStructClass_3; + { + jclass accessRestrictionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", + accessRestrictionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + return nullptr; + } + + jmethodID accessRestrictionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &accessRestrictionStructStructCtor_3); + if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, + newElement_2_type, newElement_2_id); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); + } + + { + jclass commissioningAccessRestrictionEntryStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", - accessRestrictionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct", + commissioningAccessRestrictionEntryStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + ChipLogError( + Zcl, "Could not find class ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct"); return nullptr; } - jmethodID accessRestrictionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &accessRestrictionStructStructCtor_3); - if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + jmethodID commissioningAccessRestrictionEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, commissioningAccessRestrictionEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &commissioningAccessRestrictionEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || commissioningAccessRestrictionEntryStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, - newElement_2_type, newElement_2_id); - chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); - } - - jclass commissioningAccessRestrictionEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct", - commissioningAccessRestrictionEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct"); - return nullptr; + newElement_0 = env->NewObject(commissioningAccessRestrictionEntryStructStructClass_1, + commissioningAccessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, + newElement_0_cluster, newElement_0_restrictions); } - - jmethodID commissioningAccessRestrictionEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, commissioningAccessRestrictionEntryStructStructClass_1, - "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &commissioningAccessRestrictionEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || commissioningAccessRestrictionEntryStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$AccessControlClusterCommissioningAccessRestrictionEntryStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(commissioningAccessRestrictionEntryStructStructClass_1, - commissioningAccessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, - newElement_0_cluster, newElement_0_restrictions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2224,28 +2245,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_id, newElement_2_id); } - jclass accessRestrictionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", - accessRestrictionStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); - return nullptr; - } + jclass accessRestrictionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionStruct", + accessRestrictionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionStruct"); + return nullptr; + } - jmethodID accessRestrictionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &accessRestrictionStructStructCtor_3); - if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); - return nullptr; - } + jmethodID accessRestrictionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, accessRestrictionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &accessRestrictionStructStructCtor_3); + if (err != CHIP_NO_ERROR || accessRestrictionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, - newElement_2_type, newElement_2_id); + newElement_2 = env->NewObject(accessRestrictionStructStructClass_3, accessRestrictionStructStructCtor_3, + newElement_2_type, newElement_2_id); + } chip::JniReferences::GetInstance().AddToList(newElement_0_restrictions, newElement_2); } jobject newElement_0_fabricIndex; @@ -2256,30 +2279,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass accessRestrictionEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionEntryStruct", - accessRestrictionEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionEntryStruct"); - return nullptr; - } + jclass accessRestrictionEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessRestrictionEntryStruct", + accessRestrictionEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessRestrictionEntryStruct"); + return nullptr; + } - jmethodID accessRestrictionEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessRestrictionEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessRestrictionEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessRestrictionEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessRestrictionEntryStruct constructor"); - return nullptr; - } + jmethodID accessRestrictionEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessRestrictionEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessRestrictionEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessRestrictionEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessRestrictionEntryStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(accessRestrictionEntryStructStructClass_1, accessRestrictionEntryStructStructCtor_1, - newElement_0_endpoint, newElement_0_cluster, newElement_0_restrictions, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(accessRestrictionEntryStructStructClass_1, + accessRestrictionEntryStructStructCtor_1, newElement_0_endpoint, + newElement_0_cluster, newElement_0_restrictions, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2480,30 +2506,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_stateCtorSignature.c_str(), jninewElement_0_state, newElement_0_state); - jclass actionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActionsClusterActionStruct", actionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterActionStruct"); - return nullptr; - } + jclass actionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActionsClusterActionStruct", actionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterActionStruct"); + return nullptr; + } - jmethodID actionStructStructCtor_1; - err = - chip::JniReferences::GetInstance().FindMethod(env, actionStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &actionStructStructCtor_1); - if (err != CHIP_NO_ERROR || actionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterActionStruct constructor"); - return nullptr; - } + jmethodID actionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, actionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;)V", + &actionStructStructCtor_1); + if (err != CHIP_NO_ERROR || actionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterActionStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(actionStructStructClass_1, actionStructStructCtor_1, newElement_0_actionID, - newElement_0_name, newElement_0_type, newElement_0_endpointListID, - newElement_0_supportedCommands, newElement_0_state); + newElement_0 = env->NewObject(actionStructStructClass_1, actionStructStructCtor_1, newElement_0_actionID, + newElement_0_name, newElement_0_type, newElement_0_endpointListID, + newElement_0_supportedCommands, newElement_0_state); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -2556,29 +2584,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); } - jclass endpointListStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActionsClusterEndpointListStruct", endpointListStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterEndpointListStruct"); - return nullptr; - } + jclass endpointListStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActionsClusterEndpointListStruct", endpointListStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ActionsClusterEndpointListStruct"); + return nullptr; + } - jmethodID endpointListStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, endpointListStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &endpointListStructStructCtor_1); - if (err != CHIP_NO_ERROR || endpointListStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterEndpointListStruct constructor"); - return nullptr; - } + jmethodID endpointListStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, endpointListStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", + &endpointListStructStructCtor_1); + if (err != CHIP_NO_ERROR || endpointListStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ActionsClusterEndpointListStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(endpointListStructStructClass_1, endpointListStructStructCtor_1, newElement_0_endpointListID, - newElement_0_name, newElement_0_type, newElement_0_endpoints); + newElement_0 = + env->NewObject(endpointListStructStructClass_1, endpointListStructStructCtor_1, newElement_0_endpointListID, + newElement_0_name, newElement_0_type, newElement_0_endpoints); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -3017,28 +3047,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_subscriptionsPerFabricClassName.c_str(), value_subscriptionsPerFabricCtorSignature.c_str(), jnivalue_subscriptionsPerFabric, value_subscriptionsPerFabric); - jclass capabilityMinimaStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BasicInformationClusterCapabilityMinimaStruct", - capabilityMinimaStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterCapabilityMinimaStruct"); - return nullptr; - } + jclass capabilityMinimaStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BasicInformationClusterCapabilityMinimaStruct", + capabilityMinimaStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterCapabilityMinimaStruct"); + return nullptr; + } - jmethodID capabilityMinimaStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, capabilityMinimaStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &capabilityMinimaStructStructCtor_0); - if (err != CHIP_NO_ERROR || capabilityMinimaStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterCapabilityMinimaStruct constructor"); - return nullptr; - } + jmethodID capabilityMinimaStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, capabilityMinimaStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &capabilityMinimaStructStructCtor_0); + if (err != CHIP_NO_ERROR || capabilityMinimaStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterCapabilityMinimaStruct constructor"); + return nullptr; + } - value = env->NewObject(capabilityMinimaStructStructClass_0, capabilityMinimaStructStructCtor_0, - value_caseSessionsPerFabric, value_subscriptionsPerFabric); + value = env->NewObject(capabilityMinimaStructStructClass_0, capabilityMinimaStructStructCtor_0, + value_caseSessionsPerFabric, value_subscriptionsPerFabric); + } return value; } case Attributes::ProductAppearance::Id: { @@ -3071,28 +3103,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue_primaryColor, value_primaryColor); } - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterProductAppearanceStruct"); - return nullptr; - } + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterProductAppearanceStruct"); + return nullptr; + } - jmethodID productAppearanceStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &productAppearanceStructStructCtor_0); - if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterProductAppearanceStruct constructor"); - return nullptr; - } + jmethodID productAppearanceStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &productAppearanceStructStructCtor_0); + if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; + } - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); + } return value; } case Attributes::SpecificationVersion::Id: { @@ -3449,28 +3483,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass providerLocationStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation", - providerLocationStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); - return nullptr; - } + jclass providerLocationStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation", + providerLocationStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation"); + return nullptr; + } - jmethodID providerLocationStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, providerLocationStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &providerLocationStructCtor_1); - if (err != CHIP_NO_ERROR || providerLocationStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation constructor"); - return nullptr; - } + jmethodID providerLocationStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, providerLocationStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &providerLocationStructCtor_1); + if (err != CHIP_NO_ERROR || providerLocationStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$OtaSoftwareUpdateRequestorClusterProviderLocation constructor"); + return nullptr; + } - newElement_0 = env->NewObject(providerLocationStructClass_1, providerLocationStructCtor_1, - newElement_0_providerNodeID, newElement_0_endpoint, newElement_0_fabricIndex); + newElement_0 = env->NewObject(providerLocationStructClass_1, providerLocationStructCtor_1, + newElement_0_providerNodeID, newElement_0_endpoint, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -5141,28 +5178,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_maxCumulativeFailsafeSecondsClassName.c_str(), value_maxCumulativeFailsafeSecondsCtorSignature.c_str(), jnivalue_maxCumulativeFailsafeSeconds, value_maxCumulativeFailsafeSeconds); - jclass basicCommissioningInfoStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo", - basicCommissioningInfoStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo"); - return nullptr; - } + jclass basicCommissioningInfoStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo", + basicCommissioningInfoStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo"); + return nullptr; + } - jmethodID basicCommissioningInfoStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, basicCommissioningInfoStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &basicCommissioningInfoStructCtor_0); - if (err != CHIP_NO_ERROR || basicCommissioningInfoStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo constructor"); - return nullptr; - } + jmethodID basicCommissioningInfoStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, basicCommissioningInfoStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &basicCommissioningInfoStructCtor_0); + if (err != CHIP_NO_ERROR || basicCommissioningInfoStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GeneralCommissioningClusterBasicCommissioningInfo constructor"); + return nullptr; + } - value = env->NewObject(basicCommissioningInfoStructClass_0, basicCommissioningInfoStructCtor_0, - value_failSafeExpiryLengthSeconds, value_maxCumulativeFailsafeSeconds); + value = env->NewObject(basicCommissioningInfoStructClass_0, basicCommissioningInfoStructCtor_0, + value_failSafeExpiryLengthSeconds, value_maxCumulativeFailsafeSeconds); + } return value; } case Attributes::RegulatoryConfig::Id: { @@ -5277,6 +5316,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue, value); return value; } + case Attributes::TCUpdateDeadline::Id: { + using TypeInfo = Attributes::TCUpdateDeadline::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -5512,29 +5567,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_clientIdentifier); } - jclass networkInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$NetworkCommissioningClusterNetworkInfoStruct", - networkInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfoStruct"); - return nullptr; - } + jclass networkInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$NetworkCommissioningClusterNetworkInfoStruct", + networkInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$NetworkCommissioningClusterNetworkInfoStruct"); + return nullptr; + } - jmethodID networkInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, networkInfoStructStructClass_1, "", - "([BLjava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;)V", &networkInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || networkInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$NetworkCommissioningClusterNetworkInfoStruct constructor"); - return nullptr; - } + jmethodID networkInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, networkInfoStructStructClass_1, "", + "([BLjava/lang/Boolean;Ljava/util/Optional;Ljava/util/Optional;)V", &networkInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || networkInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$NetworkCommissioningClusterNetworkInfoStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(networkInfoStructStructClass_1, networkInfoStructStructCtor_1, newElement_0_networkID, - newElement_0_connected, newElement_0_networkIdentifier, newElement_0_clientIdentifier); + newElement_0 = + env->NewObject(networkInfoStructStructClass_1, networkInfoStructStructCtor_1, newElement_0_networkID, + newElement_0_connected, newElement_0_networkIdentifier, newElement_0_clientIdentifier); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -6096,32 +6153,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_typeCtorSignature.c_str(), jninewElement_0_type, newElement_0_type); - jclass networkInterfaceStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GeneralDiagnosticsClusterNetworkInterface", - networkInterfaceStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterface"); - return nullptr; - } + jclass networkInterfaceStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GeneralDiagnosticsClusterNetworkInterface", + networkInterfaceStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GeneralDiagnosticsClusterNetworkInterface"); + return nullptr; + } - jmethodID networkInterfaceStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, networkInterfaceStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/util/ArrayList;Ljava/util/" - "ArrayList;Ljava/lang/Integer;)V", - &networkInterfaceStructCtor_1); - if (err != CHIP_NO_ERROR || networkInterfaceStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GeneralDiagnosticsClusterNetworkInterface constructor"); - return nullptr; - } + jmethodID networkInterfaceStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, networkInterfaceStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;[BLjava/util/ArrayList;Ljava/" + "util/ArrayList;Ljava/lang/Integer;)V", + &networkInterfaceStructCtor_1); + if (err != CHIP_NO_ERROR || networkInterfaceStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GeneralDiagnosticsClusterNetworkInterface constructor"); + return nullptr; + } - newElement_0 = env->NewObject(networkInterfaceStructClass_1, networkInterfaceStructCtor_1, newElement_0_name, - newElement_0_isOperational, newElement_0_offPremiseServicesReachableIPv4, - newElement_0_offPremiseServicesReachableIPv6, newElement_0_hardwareAddress, - newElement_0_IPv4Addresses, newElement_0_IPv6Addresses, newElement_0_type); + newElement_0 = env->NewObject(networkInterfaceStructClass_1, networkInterfaceStructCtor_1, newElement_0_name, + newElement_0_isOperational, newElement_0_offPremiseServicesReachableIPv4, + newElement_0_offPremiseServicesReachableIPv6, newElement_0_hardwareAddress, + newElement_0_IPv4Addresses, newElement_0_IPv6Addresses, newElement_0_type); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -6511,30 +6570,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_stackSizeInsideOptional, newElement_0_stackSize); } - jclass threadMetricsStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct", - threadMetricsStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct"); - return nullptr; - } + jclass threadMetricsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct", + threadMetricsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct"); + return nullptr; + } - jmethodID threadMetricsStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, threadMetricsStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &threadMetricsStructStructCtor_1); - if (err != CHIP_NO_ERROR || threadMetricsStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct constructor"); - return nullptr; - } + jmethodID threadMetricsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, threadMetricsStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &threadMetricsStructStructCtor_1); + if (err != CHIP_NO_ERROR || threadMetricsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$SoftwareDiagnosticsClusterThreadMetricsStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(threadMetricsStructStructClass_1, threadMetricsStructStructCtor_1, newElement_0_id, - newElement_0_name, newElement_0_stackFreeCurrent, newElement_0_stackFreeMinimum, - newElement_0_stackSize); + newElement_0 = env->NewObject(threadMetricsStructStructClass_1, threadMetricsStructStructCtor_1, + newElement_0_id, newElement_0_name, newElement_0_stackFreeCurrent, + newElement_0_stackFreeMinimum, newElement_0_stackSize); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -7007,34 +7068,38 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_isChildCtorSignature.c_str(), jninewElement_0_isChild, newElement_0_isChild); - jclass neighborTableStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct", - neighborTableStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct"); - return nullptr; - } + jclass neighborTableStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct", + neighborTableStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct"); + return nullptr; + } - jmethodID neighborTableStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, neighborTableStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/" - "lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/" - "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", - &neighborTableStructStructCtor_1); - if (err != CHIP_NO_ERROR || neighborTableStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct constructor"); - return nullptr; - } + jmethodID neighborTableStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, neighborTableStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", + &neighborTableStructStructCtor_1); + if (err != CHIP_NO_ERROR || neighborTableStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterNeighborTableStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject( - neighborTableStructStructClass_1, neighborTableStructStructCtor_1, newElement_0_extAddress, newElement_0_age, - newElement_0_rloc16, newElement_0_linkFrameCounter, newElement_0_mleFrameCounter, newElement_0_lqi, - newElement_0_averageRssi, newElement_0_lastRssi, newElement_0_frameErrorRate, newElement_0_messageErrorRate, - newElement_0_rxOnWhenIdle, newElement_0_fullThreadDevice, newElement_0_fullNetworkData, newElement_0_isChild); + newElement_0 = env->NewObject( + neighborTableStructStructClass_1, neighborTableStructStructCtor_1, newElement_0_extAddress, + newElement_0_age, newElement_0_rloc16, newElement_0_linkFrameCounter, newElement_0_mleFrameCounter, + newElement_0_lqi, newElement_0_averageRssi, newElement_0_lastRssi, newElement_0_frameErrorRate, + newElement_0_messageErrorRate, newElement_0_rxOnWhenIdle, newElement_0_fullThreadDevice, + newElement_0_fullNetworkData, newElement_0_isChild); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -7126,32 +7191,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_linkEstablishedClassName.c_str(), newElement_0_linkEstablishedCtorSignature.c_str(), jninewElement_0_linkEstablished, newElement_0_linkEstablished); - jclass routeTableStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct", - routeTableStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct"); - return nullptr; - } + jclass routeTableStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct", + routeTableStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct"); + return nullptr; + } - jmethodID routeTableStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, routeTableStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", - &routeTableStructStructCtor_1); - if (err != CHIP_NO_ERROR || routeTableStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct constructor"); - return nullptr; - } + jmethodID routeTableStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, routeTableStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V", + &routeTableStructStructCtor_1); + if (err != CHIP_NO_ERROR || routeTableStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterRouteTableStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(routeTableStructStructClass_1, routeTableStructStructCtor_1, newElement_0_extAddress, - newElement_0_rloc16, newElement_0_routerId, newElement_0_nextHop, - newElement_0_pathCost, newElement_0_LQIIn, newElement_0_LQIOut, newElement_0_age, - newElement_0_allocated, newElement_0_linkEstablished); + newElement_0 = env->NewObject( + routeTableStructStructClass_1, routeTableStructStructCtor_1, newElement_0_extAddress, newElement_0_rloc16, + newElement_0_routerId, newElement_0_nextHop, newElement_0_pathCost, newElement_0_LQIIn, newElement_0_LQIOut, + newElement_0_age, newElement_0_allocated, newElement_0_linkEstablished); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -8041,27 +8108,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_flagsClassName.c_str(), value_flagsCtorSignature.c_str(), jnivalue_flags, value_flags); - jclass securityPolicyStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy", - securityPolicyStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); - return nullptr; - } + jclass securityPolicyStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy", + securityPolicyStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy"); + return nullptr; + } - jmethodID securityPolicyStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, securityPolicyStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &securityPolicyStructCtor_1); - if (err != CHIP_NO_ERROR || securityPolicyStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy constructor"); - return nullptr; - } + jmethodID securityPolicyStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, securityPolicyStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &securityPolicyStructCtor_1); + if (err != CHIP_NO_ERROR || securityPolicyStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterSecurityPolicy constructor"); + return nullptr; + } - value = env->NewObject(securityPolicyStructClass_1, securityPolicyStructCtor_1, value_rotationTime, value_flags); + value = + env->NewObject(securityPolicyStructClass_1, securityPolicyStructCtor_1, value_rotationTime, value_flags); + } } return value; } @@ -8187,36 +8257,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_channelMaskPresentClassName.c_str(), value_channelMaskPresentCtorSignature.c_str(), jnivalue_channelMaskPresent, value_channelMaskPresent); - jclass operationalDatasetComponentsStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents", - operationalDatasetComponentsStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); - return nullptr; - } + jclass operationalDatasetComponentsStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents", + operationalDatasetComponentsStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents"); + return nullptr; + } - jmethodID operationalDatasetComponentsStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, operationalDatasetComponentsStructClass_1, "", - "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" - "Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/" - "lang/Boolean;)V", - &operationalDatasetComponentsStructCtor_1); - if (err != CHIP_NO_ERROR || operationalDatasetComponentsStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents constructor"); - return nullptr; - } + jmethodID operationalDatasetComponentsStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, operationalDatasetComponentsStructClass_1, "", + "(Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/" + "lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/" + "Boolean;Ljava/lang/Boolean;)V", + &operationalDatasetComponentsStructCtor_1); + if (err != CHIP_NO_ERROR || operationalDatasetComponentsStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ThreadNetworkDiagnosticsClusterOperationalDatasetComponents constructor"); + return nullptr; + } - value = env->NewObject(operationalDatasetComponentsStructClass_1, operationalDatasetComponentsStructCtor_1, - value_activeTimestampPresent, value_pendingTimestampPresent, value_masterKeyPresent, - value_networkNamePresent, value_extendedPanIdPresent, value_meshLocalPrefixPresent, - value_delayPresent, value_panIdPresent, value_channelPresent, value_pskcPresent, - value_securityPolicyPresent, value_channelMaskPresent); + value = env->NewObject(operationalDatasetComponentsStructClass_1, operationalDatasetComponentsStructCtor_1, + value_activeTimestampPresent, value_pendingTimestampPresent, value_masterKeyPresent, + value_networkNamePresent, value_extendedPanIdPresent, value_meshLocalPrefixPresent, + value_delayPresent, value_panIdPresent, value_channelPresent, value_pskcPresent, + value_securityPolicyPresent, value_channelMaskPresent); + } } return value; } @@ -9224,28 +9297,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_endpointClassName.c_str(), value_endpointCtorSignature.c_str(), jnivalue_endpoint, value_endpoint); - jclass trustedTimeSourceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", - trustedTimeSourceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); - return nullptr; - } + jclass trustedTimeSourceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", + trustedTimeSourceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); + return nullptr; + } - jmethodID trustedTimeSourceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, trustedTimeSourceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", - &trustedTimeSourceStructStructCtor_1); - if (err != CHIP_NO_ERROR || trustedTimeSourceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); - return nullptr; - } + jmethodID trustedTimeSourceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, trustedTimeSourceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", + &trustedTimeSourceStructStructCtor_1); + if (err != CHIP_NO_ERROR || trustedTimeSourceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); + return nullptr; + } - value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, value_fabricIndex, - value_nodeID, value_endpoint); + value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, + value_fabricIndex, value_nodeID, value_endpoint); + } } return value; } @@ -9311,27 +9387,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); } - jclass timeZoneStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); - return nullptr; - } + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", + timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return nullptr; + } - jmethodID timeZoneStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, timeZoneStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V", - &timeZoneStructStructCtor_1); - if (err != CHIP_NO_ERROR || timeZoneStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); - return nullptr; - } + jmethodID timeZoneStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, timeZoneStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V", + &timeZoneStructStructCtor_1); + if (err != CHIP_NO_ERROR || timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, - newElement_0_validAt, newElement_0_name); + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -9381,28 +9460,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_validUntil, newElement_0_validUntil); } - jclass DSTOffsetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", - DSTOffsetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); - return nullptr; - } + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", + DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return nullptr; + } - jmethodID DSTOffsetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, DSTOffsetStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", - &DSTOffsetStructStructCtor_1); - if (err != CHIP_NO_ERROR || DSTOffsetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); - return nullptr; - } + jmethodID DSTOffsetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, DSTOffsetStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", + &DSTOffsetStructStructCtor_1); + if (err != CHIP_NO_ERROR || DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, - newElement_0_validStarting, newElement_0_validUntil); + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -9894,29 +9975,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue_primaryColor, value_primaryColor); } - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); - return nullptr; - } + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); + return nullptr; + } - jmethodID productAppearanceStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &productAppearanceStructStructCtor_0); - if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); - return nullptr; - } + jmethodID productAppearanceStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, productAppearanceStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &productAppearanceStructStructCtor_0); + if (err != CHIP_NO_ERROR || productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; + } - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -10496,26 +10580,28 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return nullptr; - } + jclass NOCStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); + return nullptr; + } - jmethodID NOCStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, NOCStructStructClass_1, "", - "([B[BLjava/lang/Integer;)V", &NOCStructStructCtor_1); - if (err != CHIP_NO_ERROR || NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return nullptr; - } + jmethodID NOCStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, NOCStructStructClass_1, "", + "([B[BLjava/lang/Integer;)V", &NOCStructStructCtor_1); + if (err != CHIP_NO_ERROR || NOCStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, + newElement_0_icac, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10573,30 +10659,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass fabricDescriptorStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); - return nullptr; - } + jclass fabricDescriptorStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + return nullptr; + } - jmethodID fabricDescriptorStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V", - &fabricDescriptorStructStructCtor_1); - if (err != CHIP_NO_ERROR || fabricDescriptorStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); - return nullptr; - } + jmethodID fabricDescriptorStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V", + &fabricDescriptorStructStructCtor_1); + if (err != CHIP_NO_ERROR || fabricDescriptorStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, - newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, + newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10853,28 +10942,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass groupKeyMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", - groupKeyMapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); - return nullptr; - } + jclass groupKeyMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", + groupKeyMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + return nullptr; + } - jmethodID groupKeyMapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, groupKeyMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &groupKeyMapStructStructCtor_1); - if (err != CHIP_NO_ERROR || groupKeyMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); - return nullptr; - } + jmethodID groupKeyMapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, groupKeyMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &groupKeyMapStructStructCtor_1); + if (err != CHIP_NO_ERROR || groupKeyMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, + newElement_0_groupId, newElement_0_groupKeySetID, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -10937,29 +11028,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass groupInfoMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", - groupInfoMapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); - return nullptr; - } + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", + groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return nullptr; + } - jmethodID groupInfoMapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V", - &groupInfoMapStructStructCtor_1); - if (err != CHIP_NO_ERROR || groupInfoMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); - return nullptr; - } + jmethodID groupInfoMapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V", + &groupInfoMapStructStructCtor_1); + if (err != CHIP_NO_ERROR || groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -11159,26 +11253,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_value; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return nullptr; - } + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return nullptr; + } - jmethodID labelStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V", &labelStructStructCtor_1); - if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return nullptr; - } + jmethodID labelStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, labelStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/String;)V", + &labelStructStructCtor_1); + if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -11346,26 +11443,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_value; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return nullptr; - } + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); + return nullptr; + } - jmethodID labelStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V", &labelStructStructCtor_1); - if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return nullptr; - } + jmethodID labelStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, labelStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/String;)V", + &labelStructStructCtor_1); + if (err != CHIP_NO_ERROR || labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12189,30 +12289,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass monitoringRegistrationStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", - monitoringRegistrationStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); - return nullptr; - } + jclass monitoringRegistrationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$IcdManagementClusterMonitoringRegistrationStruct", + monitoringRegistrationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$IcdManagementClusterMonitoringRegistrationStruct"); + return nullptr; + } - jmethodID monitoringRegistrationStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, monitoringRegistrationStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &monitoringRegistrationStructStructCtor_1); - if (err != CHIP_NO_ERROR || monitoringRegistrationStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); - return nullptr; - } + jmethodID monitoringRegistrationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, monitoringRegistrationStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &monitoringRegistrationStructStructCtor_1); + if (err != CHIP_NO_ERROR || monitoringRegistrationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$IcdManagementClusterMonitoringRegistrationStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(monitoringRegistrationStructStructClass_1, monitoringRegistrationStructStructCtor_1, - newElement_0_checkInNodeID, newElement_0_monitoredSubject, newElement_0_clientType, - newElement_0_fabricIndex); + newElement_0 = env->NewObject(monitoringRegistrationStructStructClass_1, + monitoringRegistrationStructStructCtor_1, newElement_0_checkInNodeID, + newElement_0_monitoredSubject, newElement_0_clientType, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12752,29 +12855,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -12836,28 +12942,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -13060,51 +13168,55 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -13586,52 +13698,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass semanticTagStructStructClass_3; + { + jclass semanticTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", + semanticTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); + return nullptr; + } + + jmethodID semanticTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, semanticTagStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &semanticTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, + newElement_2_mfgCode, newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterSemanticTagStruct", - semanticTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterSemanticTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); return nullptr; } - jmethodID semanticTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, semanticTagStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &semanticTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterSemanticTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, - newElement_2_mfgCode, newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_semanticTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ModeSelectClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ModeSelectClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ModeSelectClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_semanticTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_semanticTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -13898,52 +14014,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$LaundryWasherModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$LaundryWasherModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$LaundryWasherModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -14210,62 +14331,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct " + "constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( env, - "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct", - modeTagStructStructClass_3); + "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct " + "constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError( - Zcl, - "Could not find class ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find " - "ChipStructs$RefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -14759,51 +14887,55 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcRunModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcRunModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcRunModeClusterModeOptionStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -15024,51 +15156,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcCleanModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcCleanModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcCleanModeClusterModeOptionStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -15722,51 +15859,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DishwasherModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DishwasherModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DishwasherModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -16747,52 +16890,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MicrowaveOvenModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MicrowaveOvenModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MicrowaveOvenModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17361,28 +17509,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17444,27 +17594,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -17720,28 +17873,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_operationalStateLabel); } - jclass operationalStateStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", - operationalStateStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); - return nullptr; - } + jclass operationalStateStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterOperationalStateStruct", + operationalStateStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterOperationalStateStruct"); + return nullptr; + } - jmethodID operationalStateStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &operationalStateStructStructCtor_1); - if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); - return nullptr; - } + jmethodID operationalStateStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, operationalStateStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &operationalStateStructStructCtor_1); + if (err != CHIP_NO_ERROR || operationalStateStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$RvcOperationalStateClusterOperationalStateStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, - newElement_0_operationalStateID, newElement_0_operationalStateLabel); + newElement_0 = env->NewObject(operationalStateStructStructClass_1, operationalStateStructStructCtor_1, + newElement_0_operationalStateID, newElement_0_operationalStateLabel); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -17803,27 +17959,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_errorStateDetailsInsideOptional, value_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, - value_errorStateLabel, value_errorStateDetails); + value = env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorStateID, + value_errorStateLabel, value_errorStateDetails); + } return value; } case Attributes::GeneratedCommandList::Id: { @@ -18066,30 +18225,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass sceneInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ScenesManagementClusterSceneInfoStruct", sceneInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ScenesManagementClusterSceneInfoStruct"); - return nullptr; - } + jclass sceneInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ScenesManagementClusterSceneInfoStruct", + sceneInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ScenesManagementClusterSceneInfoStruct"); + return nullptr; + } - jmethodID sceneInfoStructStructCtor_1; - err = - chip::JniReferences::GetInstance().FindMethod(env, sceneInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/" - "lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &sceneInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || sceneInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ScenesManagementClusterSceneInfoStruct constructor"); - return nullptr; - } + jmethodID sceneInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, sceneInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/" + "lang/Integer;)V", + &sceneInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || sceneInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ScenesManagementClusterSceneInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(sceneInfoStructStructClass_1, sceneInfoStructStructCtor_1, newElement_0_sceneCount, - newElement_0_currentScene, newElement_0_currentGroup, newElement_0_sceneValid, - newElement_0_remainingCapacity, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(sceneInfoStructStructClass_1, sceneInfoStructStructCtor_1, newElement_0_sceneCount, + newElement_0_currentScene, newElement_0_currentGroup, newElement_0_sceneValid, + newElement_0_remainingCapacity, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -18350,28 +18513,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, newElement_0_productIdentifierValue)); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } + jclass replacementProductStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } - jmethodID replacementProductStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &replacementProductStructStructCtor_1); - if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + jmethodID replacementProductStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &replacementProductStructStructCtor_1); + if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, + newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -18632,31 +18798,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, newElement_0_productIdentifierValue)); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } + jclass replacementProductStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } - jmethodID replacementProductStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &replacementProductStructStructCtor_1); - if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + jmethodID replacementProductStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, replacementProductStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &replacementProductStructStructCtor_1); + if (err != CHIP_NO_ERROR || replacementProductStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct " + "constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, + newElement_0_productIdentifierType, newElement_0_productIdentifierValue); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -19654,65 +19822,72 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_fixedTypical); } - jclass measurementAccuracyRangeStructStructClass_3; + { + jclass measurementAccuracyRangeStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, + "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct", + measurementAccuracyRangeStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct"); + return nullptr; + } + + jmethodID measurementAccuracyRangeStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementAccuracyRangeStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &measurementAccuracyRangeStructStructCtor_3); + if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject( + measurementAccuracyRangeStructStructClass_3, measurementAccuracyRangeStructStructCtor_3, + newElement_2_rangeMin, newElement_2_rangeMax, newElement_2_percentMax, newElement_2_percentMin, + newElement_2_percentTypical, newElement_2_fixedMax, newElement_2_fixedMin, newElement_2_fixedTypical); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_accuracyRanges, newElement_2); + } + + { + jclass measurementAccuracyStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct", - measurementAccuracyRangeStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct", + measurementAccuracyStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct"); return nullptr; } - jmethodID measurementAccuracyRangeStructStructCtor_3; + jmethodID measurementAccuracyStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyRangeStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &measurementAccuracyRangeStructStructCtor_3); - if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_3 == nullptr) + env, measurementAccuracyStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &measurementAccuracyStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyRangeStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct constructor"); return nullptr; } - newElement_2 = env->NewObject( - measurementAccuracyRangeStructStructClass_3, measurementAccuracyRangeStructStructCtor_3, - newElement_2_rangeMin, newElement_2_rangeMax, newElement_2_percentMax, newElement_2_percentMin, - newElement_2_percentTypical, newElement_2_fixedMax, newElement_2_fixedMin, newElement_2_fixedTypical); - chip::JniReferences::GetInstance().AddToList(newElement_0_accuracyRanges, newElement_2); - } - - jclass measurementAccuracyStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct", - measurementAccuracyStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct"); - return nullptr; - } - - jmethodID measurementAccuracyStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &measurementAccuracyStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementAccuracyStruct constructor"); - return nullptr; + newElement_0 = + env->NewObject(measurementAccuracyStructStructClass_1, measurementAccuracyStructStructCtor_1, + newElement_0_measurementType, newElement_0_measured, newElement_0_minMeasuredValue, + newElement_0_maxMeasuredValue, newElement_0_accuracyRanges); } - - newElement_0 = env->NewObject(measurementAccuracyStructStructClass_1, measurementAccuracyStructStructCtor_1, - newElement_0_measurementType, newElement_0_measured, newElement_0_minMeasuredValue, - newElement_0_maxMeasuredValue, newElement_0_accuracyRanges); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -19899,35 +20074,38 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_maxSystime); } - jclass measurementRangeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", - measurementRangeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); - return nullptr; - } + jclass measurementRangeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", + measurementRangeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); + return nullptr; + } - jmethodID measurementRangeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementRangeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;)V", - &measurementRangeStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); - return nullptr; - } + jmethodID measurementRangeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementRangeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;)V", + &measurementRangeStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, - newElement_0_measurementType, newElement_0_min, newElement_0_max, - newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, - newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, - newElement_0_minSystime, newElement_0_maxSystime); + newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, + newElement_0_measurementType, newElement_0_min, newElement_0_max, + newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, + newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, + newElement_0_minSystime, newElement_0_maxSystime); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -20229,31 +20407,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_1_measurement, newElement_1_measurement); } - jclass harmonicMeasurementStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", - harmonicMeasurementStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); - return nullptr; - } + jclass harmonicMeasurementStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", + harmonicMeasurementStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); + return nullptr; + } - jmethodID harmonicMeasurementStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &harmonicMeasurementStructStructCtor_2); - if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct constructor"); - return nullptr; - } + jmethodID harmonicMeasurementStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &harmonicMeasurementStructStructCtor_2); + if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct " + "constructor"); + return nullptr; + } - newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, - newElement_1_order, newElement_1_measurement); + newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, + newElement_1_order, newElement_1_measurement); + } chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -20303,31 +20483,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_1_measurement, newElement_1_measurement); } - jclass harmonicMeasurementStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", - harmonicMeasurementStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); - return nullptr; - } + jclass harmonicMeasurementStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct", + harmonicMeasurementStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct"); + return nullptr; + } - jmethodID harmonicMeasurementStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Long;)V", - &harmonicMeasurementStructStructCtor_2); - if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct constructor"); - return nullptr; - } + jmethodID harmonicMeasurementStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, harmonicMeasurementStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Long;)V", + &harmonicMeasurementStructStructCtor_2); + if (err != CHIP_NO_ERROR || harmonicMeasurementStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalPowerMeasurementClusterHarmonicMeasurementStruct " + "constructor"); + return nullptr; + } - newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, - newElement_1_order, newElement_1_measurement); + newElement_1 = env->NewObject(harmonicMeasurementStructStructClass_2, harmonicMeasurementStructStructCtor_2, + newElement_1_order, newElement_1_measurement); + } chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -20686,63 +20868,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_fixedTypical); } - jclass measurementAccuracyRangeStructStructClass_2; + { + jclass measurementAccuracyRangeStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct", + measurementAccuracyRangeStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct"); + return nullptr; + } + + jmethodID measurementAccuracyRangeStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementAccuracyRangeStructStructClass_2, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &measurementAccuracyRangeStructStructCtor_2); + if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct " + "constructor"); + return nullptr; + } + + newElement_1 = env->NewObject( + measurementAccuracyRangeStructStructClass_2, measurementAccuracyRangeStructStructCtor_2, + newElement_1_rangeMin, newElement_1_rangeMax, newElement_1_percentMax, newElement_1_percentMin, + newElement_1_percentTypical, newElement_1_fixedMax, newElement_1_fixedMin, newElement_1_fixedTypical); + } + chip::JniReferences::GetInstance().AddToList(value_accuracyRanges, newElement_1); + } + + { + jclass measurementAccuracyStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct", - measurementAccuracyRangeStructStructClass_2); + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct", + measurementAccuracyStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct"); return nullptr; } - jmethodID measurementAccuracyRangeStructStructCtor_2; + jmethodID measurementAccuracyStructStructCtor_0; err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyRangeStructStructClass_2, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &measurementAccuracyRangeStructStructCtor_2); - if (err != CHIP_NO_ERROR || measurementAccuracyRangeStructStructCtor_2 == nullptr) + env, measurementAccuracyStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", + &measurementAccuracyStructStructCtor_0); + if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_0 == nullptr) { ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyRangeStruct constructor"); + Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct constructor"); return nullptr; } - newElement_1 = env->NewObject( - measurementAccuracyRangeStructStructClass_2, measurementAccuracyRangeStructStructCtor_2, newElement_1_rangeMin, - newElement_1_rangeMax, newElement_1_percentMax, newElement_1_percentMin, newElement_1_percentTypical, - newElement_1_fixedMax, newElement_1_fixedMin, newElement_1_fixedTypical); - chip::JniReferences::GetInstance().AddToList(value_accuracyRanges, newElement_1); + value = env->NewObject(measurementAccuracyStructStructClass_0, measurementAccuracyStructStructCtor_0, + value_measurementType, value_measured, value_minMeasuredValue, value_maxMeasuredValue, + value_accuracyRanges); } - - jclass measurementAccuracyStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct", - measurementAccuracyStructStructClass_0); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct"); - return nullptr; - } - - jmethodID measurementAccuracyStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementAccuracyStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/ArrayList;)V", - &measurementAccuracyStructStructCtor_0); - if (err != CHIP_NO_ERROR || measurementAccuracyStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterMeasurementAccuracyStruct constructor"); - return nullptr; - } - - value = - env->NewObject(measurementAccuracyStructStructClass_0, measurementAccuracyStructStructCtor_0, value_measurementType, - value_measured, value_minMeasuredValue, value_maxMeasuredValue, value_accuracyRanges); return value; } case Attributes::CumulativeEnergyImported::Id: { @@ -20832,30 +21020,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -20946,30 +21138,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21060,30 +21256,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21174,30 +21374,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endSystimeInsideOptional, value_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, - value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + value = env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, value_energy, + value_startTimestamp, value_endTimestamp, value_startSystime, value_endSystime); + } } return value; } @@ -21321,33 +21525,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_exportedResetSystime); } - jclass cumulativeEnergyResetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct", - cumulativeEnergyResetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct"); - return nullptr; - } + jclass cumulativeEnergyResetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct", + cumulativeEnergyResetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct"); + return nullptr; + } - jmethodID cumulativeEnergyResetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, cumulativeEnergyResetStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &cumulativeEnergyResetStructStructCtor_1); - if (err != CHIP_NO_ERROR || cumulativeEnergyResetStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct constructor"); - return nullptr; - } + jmethodID cumulativeEnergyResetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, cumulativeEnergyResetStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &cumulativeEnergyResetStructStructCtor_1); + if (err != CHIP_NO_ERROR || cumulativeEnergyResetStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterCumulativeEnergyResetStruct constructor"); + return nullptr; + } - value = env->NewObject(cumulativeEnergyResetStructStructClass_1, cumulativeEnergyResetStructStructCtor_1, - value_importedResetTimestamp, value_exportedResetTimestamp, value_importedResetSystime, - value_exportedResetSystime); + value = env->NewObject(cumulativeEnergyResetStructStructClass_1, cumulativeEnergyResetStructStructCtor_1, + value_importedResetTimestamp, value_exportedResetTimestamp, value_importedResetSystime, + value_exportedResetSystime); + } } return value; } @@ -21798,31 +22004,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_randomDurationMinutes); } - jclass loadControlProgramStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", - loadControlProgramStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); - return nullptr; - } + jclass loadControlProgramStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct", + loadControlProgramStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct"); + return nullptr; + } - jmethodID loadControlProgramStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlProgramStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &loadControlProgramStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlProgramStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); - return nullptr; - } + jmethodID loadControlProgramStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlProgramStructStructClass_1, "", + "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &loadControlProgramStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlProgramStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlProgramStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, - newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, - newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); + newElement_0 = env->NewObject(loadControlProgramStructStructClass_1, loadControlProgramStructStructCtor_1, + newElement_0_programID, newElement_0_name, newElement_0_enrollmentGroup, + newElement_0_randomStartMinutes, newElement_0_randomDurationMinutes); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -22099,36 +22308,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_5, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct " + "constructor"); + return nullptr; + } - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + newElement_2_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, + newElement_2_temperatureControlInsideOptional_coolingTempOffset, + newElement_2_temperatureControlInsideOptional_heatingtTempOffset, + newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, + newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, newElement_2_temperatureControl); } @@ -22151,32 +22363,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, newElement_2_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } + jclass averageLoadControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - jmethodID averageLoadControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jmethodID averageLoadControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct " + "constructor"); + return nullptr; + } - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); + newElement_2_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, + newElement_2_averageLoadControlInsideOptional_loadAdjustment); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, newElement_2_averageLoadControl); } @@ -22199,32 +22414,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, newElement_2_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct " + "constructor"); + return nullptr; + } - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); + newElement_2_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, + newElement_2_dutyCycleControlInsideOptional_dutyCycle); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, newElement_2_dutyCycleControl); } @@ -22247,32 +22464,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_powerSavingsControlInsideOptional_powerSavings, newElement_2_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct " + "constructor"); + return nullptr; + } - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); + newElement_2_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, + newElement_2_powerSavingsControlInsideOptional_powerSavings); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, newElement_2_powerSavingsControl); } @@ -22295,97 +22515,107 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_heatingSourceControlInsideOptional_heatingSource, newElement_2_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_5; + { + jclass heatingSourceControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } + + jmethodID heatingSourceControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); + return nullptr; + } + + newElement_2_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, + newElement_2_heatingSourceControlInsideOptional_heatingSource); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, + newElement_2_heatingSourceControl); + } + + { + jclass loadControlEventTransitionStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); + env, + "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", + loadControlEventTransitionStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); return nullptr; } - jmethodID heatingSourceControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + jmethodID loadControlEventTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlEventTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &loadControlEventTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " + "constructor"); return nullptr; } - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); + newElement_2 = env->NewObject(loadControlEventTransitionStructStructClass_3, + loadControlEventTransitionStructStructCtor_3, newElement_2_duration, + newElement_2_control, newElement_2_temperatureControl, + newElement_2_averageLoadControl, newElement_2_dutyCycleControl, + newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); } + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } - jclass loadControlEventTransitionStructStructClass_3; + { + jclass loadControlEventStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", + loadControlEventStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); return nullptr; } - jmethodID loadControlEventTransitionStructStructCtor_3; + jmethodID loadControlEventStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;)V", - &loadControlEventTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) + env, loadControlEventStructStructClass_1, "", + "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" + "ArrayList;)V", + &loadControlEventStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); return nullptr; } - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; - } - - jmethodID loadControlEventStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" - "ArrayList;)V", - &loadControlEventStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, + newElement_0_eventID, newElement_0_programID, newElement_0_control, + newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, + newElement_0_startTime, newElement_0_transitions); } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -22646,36 +22876,39 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_5, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_5, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct " + "constructor"); + return nullptr; + } - newElement_2_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, - newElement_2_temperatureControlInsideOptional_coolingTempOffset, - newElement_2_temperatureControlInsideOptional_heatingtTempOffset, - newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, - newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + newElement_2_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_5, temperatureControlStructStructCtor_5, + newElement_2_temperatureControlInsideOptional_coolingTempOffset, + newElement_2_temperatureControlInsideOptional_heatingtTempOffset, + newElement_2_temperatureControlInsideOptional_coolingTempSetpoint, + newElement_2_temperatureControlInsideOptional_heatingTempSetpoint); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_temperatureControlInsideOptional, newElement_2_temperatureControl); } @@ -22698,32 +22931,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_averageLoadControlInsideOptional_loadAdjustment, newElement_2_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } + jclass averageLoadControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - jmethodID averageLoadControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jmethodID averageLoadControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct " + "constructor"); + return nullptr; + } - newElement_2_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, - newElement_2_averageLoadControlInsideOptional_loadAdjustment); + newElement_2_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_5, averageLoadControlStructStructCtor_5, + newElement_2_averageLoadControlInsideOptional_loadAdjustment); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_averageLoadControlInsideOptional, newElement_2_averageLoadControl); } @@ -22746,32 +22982,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_dutyCycleControlInsideOptional_dutyCycle, newElement_2_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_5, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct " + "constructor"); + return nullptr; + } - newElement_2_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, - newElement_2_dutyCycleControlInsideOptional_dutyCycle); + newElement_2_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_5, dutyCycleControlStructStructCtor_5, + newElement_2_dutyCycleControlInsideOptional_dutyCycle); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_dutyCycleControlInsideOptional, newElement_2_dutyCycleControl); } @@ -22794,32 +23032,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_powerSavingsControlInsideOptional_powerSavings, newElement_2_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_5; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_5); - if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct " + "constructor"); + return nullptr; + } - newElement_2_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, - newElement_2_powerSavingsControlInsideOptional_powerSavings); + newElement_2_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_5, powerSavingsControlStructStructCtor_5, + newElement_2_powerSavingsControlInsideOptional_powerSavings); + } chip::JniReferences::GetInstance().CreateOptional(newElement_2_powerSavingsControlInsideOptional, newElement_2_powerSavingsControl); } @@ -22842,97 +23083,107 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_2_heatingSourceControlInsideOptional_heatingSource, newElement_2_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_5; + { + jclass heatingSourceControlStructStructClass_5; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_5); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } + + jmethodID heatingSourceControlStructStructCtor_5; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, + "", "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_5); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + { + ChipLogError(Zcl, + "Could not find " + "ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); + return nullptr; + } + + newElement_2_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, + newElement_2_heatingSourceControlInsideOptional_heatingSource); + } + chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, + newElement_2_heatingSourceControl); + } + + { + jclass loadControlEventTransitionStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_5); + env, + "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", + loadControlEventTransitionStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + ChipLogError(Zcl, + "Could not find class " + "ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); return nullptr; } - jmethodID heatingSourceControlStructStructCtor_5; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_5, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_5); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_5 == nullptr) + jmethodID loadControlEventTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, loadControlEventTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &loadControlEventTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " - "constructor"); + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " + "constructor"); return nullptr; } - newElement_2_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_5, heatingSourceControlStructStructCtor_5, - newElement_2_heatingSourceControlInsideOptional_heatingSource); - chip::JniReferences::GetInstance().CreateOptional(newElement_2_heatingSourceControlInsideOptional, - newElement_2_heatingSourceControl); + newElement_2 = env->NewObject(loadControlEventTransitionStructStructClass_3, + loadControlEventTransitionStructStructCtor_3, newElement_2_duration, + newElement_2_control, newElement_2_temperatureControl, + newElement_2_averageLoadControl, newElement_2_dutyCycleControl, + newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); } + chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); + } - jclass loadControlEventTransitionStructStructClass_3; + { + jclass loadControlEventStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct", - loadControlEventTransitionStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", + loadControlEventStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError( - Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct"); + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); return nullptr; } - jmethodID loadControlEventTransitionStructStructCtor_3; + jmethodID loadControlEventStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;)V", - &loadControlEventTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || loadControlEventTransitionStructStructCtor_3 == nullptr) + env, loadControlEventStructStructClass_1, "", + "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" + "ArrayList;)V", + &loadControlEventStructStructCtor_1); + if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventTransitionStruct " - "constructor"); + ChipLogError( + Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); return nullptr; } - newElement_2 = - env->NewObject(loadControlEventTransitionStructStructClass_3, loadControlEventTransitionStructStructCtor_3, - newElement_2_duration, newElement_2_control, newElement_2_temperatureControl, - newElement_2_averageLoadControl, newElement_2_dutyCycleControl, - newElement_2_powerSavingsControl, newElement_2_heatingSourceControl); - chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); - } - - jclass loadControlEventStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct", - loadControlEventStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct"); - return nullptr; + newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, + newElement_0_eventID, newElement_0_programID, newElement_0_control, + newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, + newElement_0_startTime, newElement_0_transitions); } - - jmethodID loadControlEventStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, loadControlEventStructStructClass_1, "", - "([B[BLjava/lang/Integer;Ljava/lang/Long;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Long;Ljava/util/" - "ArrayList;)V", - &loadControlEventStructStructCtor_1); - if (err != CHIP_NO_ERROR || loadControlEventStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterLoadControlEventStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(loadControlEventStructStructClass_1, loadControlEventStructStructCtor_1, - newElement_0_eventID, newElement_0_programID, newElement_0_control, - newElement_0_deviceClass, newElement_0_enrollmentGroup, newElement_0_criticality, - newElement_0_startTime, newElement_0_transitions); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -23256,57 +23507,63 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_3_labelInsideOptional, newElement_3_label); } - jclass messageResponseOptionStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageResponseOptionStruct", - messageResponseOptionStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageResponseOptionStruct"); - return nullptr; - } + jclass messageResponseOptionStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageResponseOptionStruct", + messageResponseOptionStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageResponseOptionStruct"); + return nullptr; + } - jmethodID messageResponseOptionStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, messageResponseOptionStructStructClass_4, "", - "(Ljava/util/Optional;Ljava/util/Optional;)V", - &messageResponseOptionStructStructCtor_4); - if (err != CHIP_NO_ERROR || messageResponseOptionStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageResponseOptionStruct constructor"); - return nullptr; - } + jmethodID messageResponseOptionStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, messageResponseOptionStructStructClass_4, "", + "(Ljava/util/Optional;Ljava/util/Optional;)V", &messageResponseOptionStructStructCtor_4); + if (err != CHIP_NO_ERROR || messageResponseOptionStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MessagesClusterMessageResponseOptionStruct constructor"); + return nullptr; + } - newElement_3 = - env->NewObject(messageResponseOptionStructStructClass_4, messageResponseOptionStructStructCtor_4, - newElement_3_messageResponseID, newElement_3_label); + newElement_3 = + env->NewObject(messageResponseOptionStructStructClass_4, messageResponseOptionStructStructCtor_4, + newElement_3_messageResponseID, newElement_3_label); + } chip::JniReferences::GetInstance().AddToList(newElement_0_responsesInsideOptional, newElement_3); } chip::JniReferences::GetInstance().CreateOptional(newElement_0_responsesInsideOptional, newElement_0_responses); } - jclass messageStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageStruct", messageStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageStruct"); - return nullptr; - } + jclass messageStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MessagesClusterMessageStruct", messageStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MessagesClusterMessageStruct"); + return nullptr; + } - jmethodID messageStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, messageStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Long;Ljava/lang/Long;Ljava/lang/String;Ljava/util/Optional;)V", - &messageStructStructCtor_1); - if (err != CHIP_NO_ERROR || messageStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageStruct constructor"); - return nullptr; - } + jmethodID messageStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, messageStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/util/" + "Optional;)V", + &messageStructStructCtor_1); + if (err != CHIP_NO_ERROR || messageStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MessagesClusterMessageStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(messageStructStructClass_1, messageStructStructCtor_1, newElement_0_messageID, - newElement_0_priority, newElement_0_messageControl, newElement_0_startTime, - newElement_0_duration, newElement_0_messageText, newElement_0_responses); + newElement_0 = env->NewObject(messageStructStructClass_1, messageStructStructCtor_1, newElement_0_messageID, + newElement_0_priority, newElement_0_messageControl, newElement_0_startTime, + newElement_0_duration, newElement_0_messageText, newElement_0_responses); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -23615,30 +23872,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_3_maxDurationClassName.c_str(), newElement_3_maxDurationCtorSignature.c_str(), jninewElement_3_maxDuration, newElement_3_maxDuration); - jclass powerAdjustStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", - powerAdjustStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); - return nullptr; - } + jclass powerAdjustStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct", + powerAdjustStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct"); + return nullptr; + } - jmethodID powerAdjustStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, powerAdjustStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", &powerAdjustStructStructCtor_4); - if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); - return nullptr; - } + jmethodID powerAdjustStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, powerAdjustStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V", + &powerAdjustStructStructCtor_4); + if (err != CHIP_NO_ERROR || powerAdjustStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustStruct constructor"); + return nullptr; + } - newElement_3 = - env->NewObject(powerAdjustStructStructClass_4, powerAdjustStructStructCtor_4, newElement_3_minPower, - newElement_3_maxPower, newElement_3_minDuration, newElement_3_maxDuration); + newElement_3 = + env->NewObject(powerAdjustStructStructClass_4, powerAdjustStructStructCtor_4, newElement_3_minPower, + newElement_3_maxPower, newElement_3_minDuration, newElement_3_maxDuration); + } chip::JniReferences::GetInstance().AddToList(value_powerAdjustCapability, newElement_3); } } @@ -23649,29 +23910,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( value_causeClassName.c_str(), value_causeCtorSignature.c_str(), jnivalue_cause, value_cause); - jclass powerAdjustCapabilityStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", - powerAdjustCapabilityStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); - return nullptr; - } + jclass powerAdjustCapabilityStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct", + powerAdjustCapabilityStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct"); + return nullptr; + } - jmethodID powerAdjustCapabilityStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_1, "", - "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &powerAdjustCapabilityStructStructCtor_1); - if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); - return nullptr; - } + jmethodID powerAdjustCapabilityStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, powerAdjustCapabilityStructStructClass_1, "", + "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &powerAdjustCapabilityStructStructCtor_1); + if (err != CHIP_NO_ERROR || powerAdjustCapabilityStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterPowerAdjustCapabilityStruct constructor"); + return nullptr; + } - value = env->NewObject(powerAdjustCapabilityStructStructClass_1, powerAdjustCapabilityStructStructCtor_1, - value_powerAdjustCapability, value_cause); + value = env->NewObject(powerAdjustCapabilityStructStructClass_1, powerAdjustCapabilityStructStructCtor_1, + value_powerAdjustCapability, value_cause); + } } return value; } @@ -24016,29 +24280,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_5_currency); } - jclass costStructStructClass_6; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterCostStruct", - costStructStructClass_6); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterCostStruct"); - return nullptr; + jclass costStructStructClass_6; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterCostStruct", + costStructStructClass_6); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterCostStruct"); + return nullptr; + } + + jmethodID costStructStructCtor_6; + err = chip::JniReferences::GetInstance().FindMethod( + env, costStructStructClass_6, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;)V", + &costStructStructCtor_6); + if (err != CHIP_NO_ERROR || costStructStructCtor_6 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementClusterCostStruct constructor"); + return nullptr; + } + + newElement_5 = + env->NewObject(costStructStructClass_6, costStructStructCtor_6, newElement_5_costType, + newElement_5_value, newElement_5_decimalPoints, newElement_5_currency); } - - jmethodID costStructStructCtor_6; - err = chip::JniReferences::GetInstance().FindMethod( - env, costStructStructClass_6, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;)V", - &costStructStructCtor_6); - if (err != CHIP_NO_ERROR || costStructStructCtor_6 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterCostStruct constructor"); - return nullptr; - } - - newElement_5 = env->NewObject(costStructStructClass_6, costStructStructCtor_6, newElement_5_costType, - newElement_5_value, newElement_5_decimalPoints, newElement_5_currency); chip::JniReferences::GetInstance().AddToList(newElement_2_costsInsideOptional, newElement_5); } chip::JniReferences::GetInstance().CreateOptional(newElement_2_costsInsideOptional, newElement_2_costs); @@ -24120,36 +24388,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_maxDurationAdjustment); } - jclass slotStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterSlotStruct", slotStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterSlotStruct"); - return nullptr; - } + jclass slotStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterSlotStruct", + slotStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterSlotStruct"); + return nullptr; + } - jmethodID slotStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, slotStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &slotStructStructCtor_3); - if (err != CHIP_NO_ERROR || slotStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterSlotStruct constructor"); - return nullptr; - } + jmethodID slotStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, slotStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &slotStructStructCtor_3); + if (err != CHIP_NO_ERROR || slotStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterSlotStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject( - slotStructStructClass_3, slotStructStructCtor_3, newElement_2_minDuration, newElement_2_maxDuration, - newElement_2_defaultDuration, newElement_2_elapsedSlotTime, newElement_2_remainingSlotTime, - newElement_2_slotIsPausable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, - newElement_2_manufacturerESAState, newElement_2_nominalPower, newElement_2_minPower, newElement_2_maxPower, - newElement_2_nominalEnergy, newElement_2_costs, newElement_2_minPowerAdjustment, - newElement_2_maxPowerAdjustment, newElement_2_minDurationAdjustment, newElement_2_maxDurationAdjustment); + newElement_2 = env->NewObject( + slotStructStructClass_3, slotStructStructCtor_3, newElement_2_minDuration, newElement_2_maxDuration, + newElement_2_defaultDuration, newElement_2_elapsedSlotTime, newElement_2_remainingSlotTime, + newElement_2_slotIsPausable, newElement_2_minPauseDuration, newElement_2_maxPauseDuration, + newElement_2_manufacturerESAState, newElement_2_nominalPower, newElement_2_minPower, + newElement_2_maxPower, newElement_2_nominalEnergy, newElement_2_costs, newElement_2_minPowerAdjustment, + newElement_2_maxPowerAdjustment, newElement_2_minDurationAdjustment, + newElement_2_maxDurationAdjustment); + } chip::JniReferences::GetInstance().AddToList(value_slots, newElement_2); } jobject value_forecastUpdateReason; @@ -24160,31 +24432,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_forecastUpdateReasonClassName.c_str(), value_forecastUpdateReasonCtorSignature.c_str(), jnivalue_forecastUpdateReason, value_forecastUpdateReason); - jclass forecastStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterForecastStruct", - forecastStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterForecastStruct"); - return nullptr; - } + jclass forecastStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementClusterForecastStruct", + forecastStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementClusterForecastStruct"); + return nullptr; + } - jmethodID forecastStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, forecastStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/lang/Boolean;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &forecastStructStructCtor_1); - if (err != CHIP_NO_ERROR || forecastStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterForecastStruct constructor"); - return nullptr; - } + jmethodID forecastStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, forecastStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/lang/Boolean;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &forecastStructStructCtor_1); + if (err != CHIP_NO_ERROR || forecastStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementClusterForecastStruct constructor"); + return nullptr; + } - value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastID, - value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, - value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); + value = env->NewObject(forecastStructStructClass_1, forecastStructStructCtor_1, value_forecastID, + value_activeSlotNumber, value_startTime, value_endTime, value_earliestStartTime, + value_latestEndTime, value_isPausable, value_slots, value_forecastUpdateReason); + } } return value; } @@ -24993,27 +25267,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass balanceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); - return nullptr; - } + jclass balanceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); + return nullptr; + } - jmethodID balanceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &balanceStructStructCtor_1); - if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); - return nullptr; - } + jmethodID balanceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &balanceStructStructCtor_1); + if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, newElement_0_label); + newElement_0 = env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, + newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25095,27 +25371,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_labelInsideOptional, newElement_0_label); } - jclass balanceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); - return nullptr; - } + jclass balanceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyPreferenceClusterBalanceStruct", balanceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyPreferenceClusterBalanceStruct"); + return nullptr; + } - jmethodID balanceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;)V", - &balanceStructStructCtor_1); - if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); - return nullptr; - } + jmethodID balanceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, balanceStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;)V", + &balanceStructStructCtor_1); + if (err != CHIP_NO_ERROR || balanceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyPreferenceClusterBalanceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, newElement_0_label); + newElement_0 = env->NewObject(balanceStructStructClass_1, balanceStructStructCtor_1, newElement_0_step, + newElement_0_label); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25528,51 +25806,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EnergyEvseModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$EnergyEvseModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EnergyEvseModeClusterModeOptionStruct constructor"); - return nullptr; - } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -25839,51 +26123,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeTagStruct", modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterModeClusterModeOptionStruct", modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -26150,53 +26440,59 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_valueCtorSignature.c_str(), jninewElement_2_value, newElement_2_value); - jclass modeTagStructStructClass_3; + { + jclass modeTagStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct", + modeTagStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct"); + return nullptr; + } + + jmethodID modeTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", + "(Ljava/util/Optional;Ljava/lang/Integer;)V", + &modeTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_value); + } + chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); + } + + { + jclass modeOptionStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct", - modeTagStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct", + modeOptionStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct"); return nullptr; } - jmethodID modeTagStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, modeTagStructStructClass_3, "", - "(Ljava/util/Optional;Ljava/lang/Integer;)V", - &modeTagStructStructCtor_3); - if (err != CHIP_NO_ERROR || modeTagStructStructCtor_3 == nullptr) + jmethodID modeOptionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, modeOptionStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", &modeOptionStructStructCtor_1); + if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeTagStruct constructor"); + ChipLogError(Zcl, + "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct constructor"); return nullptr; } - newElement_2 = env->NewObject(modeTagStructStructClass_3, modeTagStructStructCtor_3, newElement_2_mfgCode, - newElement_2_value); - chip::JniReferences::GetInstance().AddToList(newElement_0_modeTags, newElement_2); - } - - jclass modeOptionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct", - modeOptionStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct"); - return nullptr; - } - - jmethodID modeOptionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, modeOptionStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/ArrayList;)V", - &modeOptionStructStructCtor_1); - if (err != CHIP_NO_ERROR || modeOptionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$DeviceEnergyManagementModeClusterModeOptionStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, + newElement_0_mode, newElement_0_modeTags); } - - newElement_0 = env->NewObject(modeOptionStructStructClass_1, modeOptionStructStructCtor_1, newElement_0_label, - newElement_0_mode, newElement_0_modeTags); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -27941,30 +28237,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_areaInfo_locationInfo_areaType, newElement_0_areaInfo_locationInfo_areaType); } - jclass locationDescriptorStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct", - locationDescriptorStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLocationDescriptorStruct"); - return nullptr; - } + jclass locationDescriptorStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct", + locationDescriptorStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLocationDescriptorStruct"); + return nullptr; + } - jmethodID locationDescriptorStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, locationDescriptorStructStructClass_4, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_4); - if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLocationDescriptorStruct constructor"); - return nullptr; - } + jmethodID locationDescriptorStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, locationDescriptorStructStructClass_4, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_4); + if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLocationDescriptorStruct constructor"); + return nullptr; + } - newElement_0_areaInfo_locationInfo = - env->NewObject(locationDescriptorStructStructClass_4, locationDescriptorStructStructCtor_4, - newElement_0_areaInfo_locationInfo_locationName, - newElement_0_areaInfo_locationInfo_floorNumber, newElement_0_areaInfo_locationInfo_areaType); + newElement_0_areaInfo_locationInfo = env->NewObject( + locationDescriptorStructStructClass_4, locationDescriptorStructStructCtor_4, + newElement_0_areaInfo_locationInfo_locationName, newElement_0_areaInfo_locationInfo_floorNumber, + newElement_0_areaInfo_locationInfo_areaType); + } } jobject newElement_0_areaInfo_landmarkInfo; if (entry_0.areaInfo.landmarkInfo.IsNull()) @@ -28000,77 +28298,83 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_areaInfo_landmarkInfo_relativePositionTag); } - jclass landmarkInfoStructStructClass_4; + { + jclass landmarkInfoStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLandmarkInfoStruct", + landmarkInfoStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLandmarkInfoStruct"); + return nullptr; + } + + jmethodID landmarkInfoStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, landmarkInfoStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &landmarkInfoStructStructCtor_4); + if (err != CHIP_NO_ERROR || landmarkInfoStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLandmarkInfoStruct constructor"); + return nullptr; + } + + newElement_0_areaInfo_landmarkInfo = env->NewObject( + landmarkInfoStructStructClass_4, landmarkInfoStructStructCtor_4, + newElement_0_areaInfo_landmarkInfo_landmarkTag, newElement_0_areaInfo_landmarkInfo_relativePositionTag); + } + } + + { + jclass areaInfoStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterLandmarkInfoStruct", - landmarkInfoStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct", areaInfoStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterLandmarkInfoStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaInfoStruct"); return nullptr; } - jmethodID landmarkInfoStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, landmarkInfoStructStructClass_4, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &landmarkInfoStructStructCtor_4); - if (err != CHIP_NO_ERROR || landmarkInfoStructStructCtor_4 == nullptr) + jmethodID areaInfoStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, areaInfoStructStructClass_2, "", + "(Lchip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct;Lchip/devicecontroller/" + "ChipStructs$ServiceAreaClusterLandmarkInfoStruct;)V", + &areaInfoStructStructCtor_2); + if (err != CHIP_NO_ERROR || areaInfoStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterLandmarkInfoStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaInfoStruct constructor"); return nullptr; } - newElement_0_areaInfo_landmarkInfo = env->NewObject( - landmarkInfoStructStructClass_4, landmarkInfoStructStructCtor_4, - newElement_0_areaInfo_landmarkInfo_landmarkTag, newElement_0_areaInfo_landmarkInfo_relativePositionTag); + newElement_0_areaInfo = env->NewObject(areaInfoStructStructClass_2, areaInfoStructStructCtor_2, + newElement_0_areaInfo_locationInfo, newElement_0_areaInfo_landmarkInfo); } - jclass areaInfoStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct", areaInfoStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaInfoStruct"); - return nullptr; - } - - jmethodID areaInfoStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, areaInfoStructStructClass_2, "", - "(Lchip/devicecontroller/ChipStructs$ServiceAreaClusterLocationDescriptorStruct;Lchip/devicecontroller/" - "ChipStructs$ServiceAreaClusterLandmarkInfoStruct;)V", - &areaInfoStructStructCtor_2); - if (err != CHIP_NO_ERROR || areaInfoStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaInfoStruct constructor"); - return nullptr; - } - - newElement_0_areaInfo = env->NewObject(areaInfoStructStructClass_2, areaInfoStructStructCtor_2, - newElement_0_areaInfo_locationInfo, newElement_0_areaInfo_landmarkInfo); + jclass areaStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaStruct", areaStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaStruct"); + return nullptr; + } - jclass areaStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterAreaStruct", areaStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterAreaStruct"); - return nullptr; - } + jmethodID areaStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, areaStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Lchip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct;)V", + &areaStructStructCtor_1); + if (err != CHIP_NO_ERROR || areaStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaStruct constructor"); + return nullptr; + } - jmethodID areaStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, areaStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;Lchip/devicecontroller/ChipStructs$ServiceAreaClusterAreaInfoStruct;)V", - &areaStructStructCtor_1); - if (err != CHIP_NO_ERROR || areaStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterAreaStruct constructor"); - return nullptr; + newElement_0 = env->NewObject(areaStructStructClass_1, areaStructStructCtor_1, newElement_0_areaID, + newElement_0_mapID, newElement_0_areaInfo); } - - newElement_0 = env->NewObject(areaStructStructClass_1, areaStructStructCtor_1, newElement_0_areaID, - newElement_0_mapID, newElement_0_areaInfo); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -28101,25 +28405,28 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass mapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterMapStruct", mapStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterMapStruct"); - return nullptr; - } + jclass mapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterMapStruct", mapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterMapStruct"); + return nullptr; + } - jmethodID mapStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, mapStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/String;)V", &mapStructStructCtor_1); - if (err != CHIP_NO_ERROR || mapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterMapStruct constructor"); - return nullptr; - } + jmethodID mapStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, mapStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/String;)V", &mapStructStructCtor_1); + if (err != CHIP_NO_ERROR || mapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterMapStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(mapStructStructClass_1, mapStructStructCtor_1, newElement_0_mapID, newElement_0_name); + newElement_0 = + env->NewObject(mapStructStructClass_1, mapStructStructCtor_1, newElement_0_mapID, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -28278,27 +28585,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_estimatedTime); } - jclass progressStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterProgressStruct", progressStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterProgressStruct"); - return nullptr; - } + jclass progressStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ServiceAreaClusterProgressStruct", progressStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ServiceAreaClusterProgressStruct"); + return nullptr; + } - jmethodID progressStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, progressStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", &progressStructStructCtor_1); - if (err != CHIP_NO_ERROR || progressStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterProgressStruct constructor"); - return nullptr; - } + jmethodID progressStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, progressStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &progressStructStructCtor_1); + if (err != CHIP_NO_ERROR || progressStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ServiceAreaClusterProgressStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(progressStructStructClass_1, progressStructStructCtor_1, newElement_0_areaID, - newElement_0_status, newElement_0_totalOperationalTime, newElement_0_estimatedTime); + newElement_0 = + env->NewObject(progressStructStructClass_1, progressStructStructCtor_1, newElement_0_areaID, + newElement_0_status, newElement_0_totalOperationalTime, newElement_0_estimatedTime); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -29980,28 +30291,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_presetTypeFeaturesClassName.c_str(), newElement_0_presetTypeFeaturesCtorSignature.c_str(), jninewElement_0_presetTypeFeatures, newElement_0_presetTypeFeatures); - jclass presetTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); - return nullptr; - } + jclass presetTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetTypeStruct", presetTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetTypeStruct"); + return nullptr; + } - jmethodID presetTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, presetTypeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &presetTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); - return nullptr; - } + jmethodID presetTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &presetTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetTypeStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, - newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + newElement_0 = + env->NewObject(presetTypeStructStructClass_1, presetTypeStructStructCtor_1, newElement_0_presetScenario, + newElement_0_numberOfPresets, newElement_0_presetTypeFeatures); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30044,28 +30357,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_scheduleTypeFeaturesClassName.c_str(), newElement_0_scheduleTypeFeaturesCtorSignature.c_str(), jninewElement_0_scheduleTypeFeatures, newElement_0_scheduleTypeFeatures); - jclass scheduleTypeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", scheduleTypeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); - return nullptr; - } + jclass scheduleTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTypeStruct", + scheduleTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTypeStruct"); + return nullptr; + } - jmethodID scheduleTypeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, scheduleTypeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &scheduleTypeStructStructCtor_1); - if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); - return nullptr; - } + jmethodID scheduleTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleTypeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &scheduleTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTypeStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, - newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + newElement_0 = + env->NewObject(scheduleTypeStructStructClass_1, scheduleTypeStructStructCtor_1, newElement_0_systemMode, + newElement_0_numberOfSchedules, newElement_0_scheduleTypeFeatures); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30292,29 +30608,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_builtIn, newElement_0_builtIn); } - jclass presetStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", presetStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); - return nullptr; - } + jclass presetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterPresetStruct", presetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterPresetStruct"); + return nullptr; + } - jmethodID presetStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, presetStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", - &presetStructStructCtor_1); - if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); - return nullptr; - } + jmethodID presetStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, presetStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Boolean;)V", + &presetStructStructCtor_1); + if (err != CHIP_NO_ERROR || presetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterPresetStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, - newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, - newElement_0_heatingSetpoint, newElement_0_builtIn); + newElement_0 = env->NewObject(presetStructStructClass_1, presetStructStructCtor_1, newElement_0_presetHandle, + newElement_0_presetScenario, newElement_0_name, newElement_0_coolingSetpoint, + newElement_0_heatingSetpoint, newElement_0_builtIn); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -30479,32 +30797,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_heatingSetpoint); } - jclass scheduleTransitionStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", - scheduleTransitionStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); - return nullptr; - } + jclass scheduleTransitionStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleTransitionStruct", + scheduleTransitionStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleTransitionStruct"); + return nullptr; + } - jmethodID scheduleTransitionStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, scheduleTransitionStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;)V", - &scheduleTransitionStructStructCtor_3); - if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); - return nullptr; - } + jmethodID scheduleTransitionStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleTransitionStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &scheduleTransitionStructStructCtor_3); + if (err != CHIP_NO_ERROR || scheduleTransitionStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleTransitionStruct constructor"); + return nullptr; + } - newElement_2 = - env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, - newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, - newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + newElement_2 = + env->NewObject(scheduleTransitionStructStructClass_3, scheduleTransitionStructStructCtor_3, + newElement_2_dayOfWeek, newElement_2_transitionTime, newElement_2_presetHandle, + newElement_2_systemMode, newElement_2_coolingSetpoint, newElement_2_heatingSetpoint); + } chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); } jobject newElement_0_builtIn; @@ -30522,29 +30842,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jninewElement_0_builtIn, newElement_0_builtIn); } - jclass scheduleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); - return nullptr; - } + jclass scheduleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThermostatClusterScheduleStruct", scheduleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThermostatClusterScheduleStruct"); + return nullptr; + } - jmethodID scheduleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, scheduleStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", - &scheduleStructStructCtor_1); - if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); - return nullptr; - } + jmethodID scheduleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, scheduleStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", + &scheduleStructStructCtor_1); + if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ThermostatClusterScheduleStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, newElement_0_scheduleHandle, - newElement_0_systemMode, newElement_0_name, newElement_0_presetHandle, - newElement_0_transitions, newElement_0_builtIn); + newElement_0 = env->NewObject(scheduleStructStructClass_1, scheduleStructStructCtor_1, + newElement_0_scheduleHandle, newElement_0_systemMode, newElement_0_name, + newElement_0_presetHandle, newElement_0_transitions, newElement_0_builtIn); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -34046,28 +34368,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_holdTimeDefaultCtorSignature.c_str(), jnivalue_holdTimeDefault, value_holdTimeDefault); - jclass holdTimeLimitsStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct", - holdTimeLimitsStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct"); - return nullptr; - } + jclass holdTimeLimitsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct", + holdTimeLimitsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct"); + return nullptr; + } - jmethodID holdTimeLimitsStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, holdTimeLimitsStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &holdTimeLimitsStructStructCtor_0); - if (err != CHIP_NO_ERROR || holdTimeLimitsStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct constructor"); - return nullptr; - } + jmethodID holdTimeLimitsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, holdTimeLimitsStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &holdTimeLimitsStructStructCtor_0); + if (err != CHIP_NO_ERROR || holdTimeLimitsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OccupancySensingClusterHoldTimeLimitsStruct constructor"); + return nullptr; + } - value = env->NewObject(holdTimeLimitsStructStructClass_0, holdTimeLimitsStructStructCtor_0, value_holdTimeMin, - value_holdTimeMax, value_holdTimeDefault); + value = env->NewObject(holdTimeLimitsStructStructClass_0, holdTimeLimitsStructStructCtor_0, value_holdTimeMin, + value_holdTimeMax, value_holdTimeDefault); + } return value; } case Attributes::PIROccupiedToUnoccupiedDelay::Id: { @@ -38382,29 +38706,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_activeTimestampClassName.c_str(), newElement_0_activeTimestampCtorSignature.c_str(), jninewElement_0_activeTimestamp, newElement_0_activeTimestamp); - jclass threadNetworkStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct", - threadNetworkStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct"); - return nullptr; - } + jclass threadNetworkStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct", + threadNetworkStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct"); + return nullptr; + } - jmethodID threadNetworkStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, threadNetworkStructStructClass_1, "", - "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V", - &threadNetworkStructStructCtor_1); - if (err != CHIP_NO_ERROR || threadNetworkStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct constructor"); - return nullptr; - } + jmethodID threadNetworkStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, threadNetworkStructStructClass_1, "", + "([BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/Long;)V", &threadNetworkStructStructCtor_1); + if (err != CHIP_NO_ERROR || threadNetworkStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ThreadNetworkDirectoryClusterThreadNetworkStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(threadNetworkStructStructClass_1, threadNetworkStructStructCtor_1, newElement_0_extendedPanID, - newElement_0_networkName, newElement_0_channel, newElement_0_activeTimestamp); + newElement_0 = env->NewObject(threadNetworkStructStructClass_1, threadNetworkStructStructCtor_1, + newElement_0_extendedPanID, newElement_0_networkName, newElement_0_channel, + newElement_0_activeTimestamp); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -38833,31 +39160,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(newElement_0_typeInsideOptional, newElement_0_type); } - jclass channelInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); - return nullptr; - } + jclass channelInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); + return nullptr; + } - jmethodID channelInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;)V", - &channelInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); - return nullptr; - } + jmethodID channelInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;)V", + &channelInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, - newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, - newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); + newElement_0 = + env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, newElement_0_majorNumber, + newElement_0_minorNumber, newElement_0_name, newElement_0_callSign, + newElement_0_affiliateCallSign, newElement_0_identifier, newElement_0_type); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -38912,28 +39241,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_lineupInfoTypeCtorSignature.c_str(), jnivalue_lineupInfoType, value_lineupInfoType); - jclass lineupInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfoStruct", lineupInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfoStruct"); - return nullptr; - } + jclass lineupInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterLineupInfoStruct", lineupInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterLineupInfoStruct"); + return nullptr; + } - jmethodID lineupInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, lineupInfoStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", - &lineupInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || lineupInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfoStruct constructor"); - return nullptr; - } + jmethodID lineupInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, lineupInfoStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &lineupInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || lineupInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterLineupInfoStruct constructor"); + return nullptr; + } - value = env->NewObject(lineupInfoStructStructClass_1, lineupInfoStructStructCtor_1, value_operatorName, - value_lineupName, value_postalCode, value_lineupInfoType); + value = env->NewObject(lineupInfoStructStructClass_1, lineupInfoStructStructCtor_1, value_operatorName, + value_lineupName, value_postalCode, value_lineupInfoType); + } } return value; } @@ -39032,30 +39363,32 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_typeInsideOptional, value_type); } - jclass channelInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); - return nullptr; - } + jclass channelInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChannelClusterChannelInfoStruct", channelInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChannelClusterChannelInfoStruct"); + return nullptr; + } - jmethodID channelInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, channelInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;)V", - &channelInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); - return nullptr; - } + jmethodID channelInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, channelInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;)V", + &channelInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || channelInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChannelClusterChannelInfoStruct constructor"); + return nullptr; + } - value = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, value_majorNumber, - value_minorNumber, value_name, value_callSign, value_affiliateCallSign, value_identifier, - value_type); + value = env->NewObject(channelInfoStructStructClass_1, channelInfoStructStructCtor_1, value_majorNumber, + value_minorNumber, value_name, value_callSign, value_affiliateCallSign, value_identifier, + value_type); + } } return value; } @@ -39227,27 +39560,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass targetInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", targetInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); - return nullptr; - } + jclass targetInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", + targetInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); + return nullptr; + } - jmethodID targetInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &targetInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); - return nullptr; - } + jmethodID targetInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &targetInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, newElement_0_identifier, - newElement_0_name); + newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, + newElement_0_identifier, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -39507,28 +39843,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_positionClassName.c_str(), value_positionCtorSignature.c_str(), jnivalue_position, value_position); } - jclass playbackPositionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", - playbackPositionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); - return nullptr; - } + jclass playbackPositionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", + playbackPositionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); + return nullptr; + } - jmethodID playbackPositionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/lang/Long;)V", - &playbackPositionStructStructCtor_1); - if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); - return nullptr; - } + jmethodID playbackPositionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;)V", + &playbackPositionStructStructCtor_1); + if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); + return nullptr; + } - value = env->NewObject(playbackPositionStructStructClass_1, playbackPositionStructStructCtor_1, value_updatedAt, - value_position); + value = env->NewObject(playbackPositionStructStructClass_1, playbackPositionStructStructCtor_1, value_updatedAt, + value_position); + } } return value; } @@ -39643,51 +39981,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_3; + { + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_3); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = + env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_3); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + jmethodID trackStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_1); + if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, - value_trackAttributes_languageCode, value_trackAttributes_displayName); - } - - jclass trackStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; - } - - jmethodID trackStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_1); - if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } - - value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } return value; } @@ -39747,53 +40090,58 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_4; + { + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_4); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_4); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + jmethodID trackStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_2); + if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - newElement_1_trackAttributes = - env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, - newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); - } - - jclass trackStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); } - - jmethodID trackStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_2, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_2); - if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; - } - - newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, - newElement_1_trackAttributes); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -39848,51 +40196,56 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_3; + { + jclass trackAttributesStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_3); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + value_trackAttributes = + env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, + value_trackAttributes_languageCode, value_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_3); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_3, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_3); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_3 == nullptr) + jmethodID trackStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_1); + if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - value_trackAttributes = env->NewObject(trackAttributesStructStructClass_3, trackAttributesStructStructCtor_3, - value_trackAttributes_languageCode, value_trackAttributes_displayName); - } - - jclass trackStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; + value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } - - jmethodID trackStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_1); - if (err != CHIP_NO_ERROR || trackStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; - } - - value = env->NewObject(trackStructStructClass_1, trackStructStructCtor_1, value_id, value_trackAttributes); } return value; } @@ -39952,53 +40305,58 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_1_trackAttributes_displayNameInsideOptional, newElement_1_trackAttributes_displayName); } - jclass trackAttributesStructStructClass_4; + { + jclass trackAttributesStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", + trackAttributesStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + return nullptr; + } + + jmethodID trackAttributesStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &trackAttributesStructStructCtor_4); + if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + return nullptr; + } + + newElement_1_trackAttributes = + env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, + newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); + } + } + + { + jclass trackStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct", - trackAttributesStructStructClass_4); + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackAttributesStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); return nullptr; } - jmethodID trackAttributesStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod(env, trackAttributesStructStructClass_4, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &trackAttributesStructStructCtor_4); - if (err != CHIP_NO_ERROR || trackAttributesStructStructCtor_4 == nullptr) + jmethodID trackStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, trackStructStructClass_2, "", + "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", + &trackStructStructCtor_2); + if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackAttributesStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); return nullptr; } - newElement_1_trackAttributes = - env->NewObject(trackAttributesStructStructClass_4, trackAttributesStructStructCtor_4, - newElement_1_trackAttributes_languageCode, newElement_1_trackAttributes_displayName); - } - - jclass trackStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackStruct", trackStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterTrackStruct"); - return nullptr; - } - - jmethodID trackStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, trackStructStructClass_2, "", - "(Ljava/lang/String;Lchip/devicecontroller/ChipStructs$MediaPlaybackClusterTrackAttributesStruct;)V", - &trackStructStructCtor_2); - if (err != CHIP_NO_ERROR || trackStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterTrackStruct constructor"); - return nullptr; + newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, + newElement_1_trackAttributes); } - - newElement_1 = env->NewObject(trackStructStructClass_2, trackStructStructCtor_2, newElement_1_id, - newElement_1_trackAttributes); chip::JniReferences::GetInstance().AddToList(value, newElement_1); } } @@ -40182,27 +40540,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure( chip::JniReferences::GetInstance().CharToStringUTF(entry_0.description, newElement_0_description)); - jclass inputInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaInputClusterInputInfoStruct", inputInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfoStruct"); - return nullptr; - } + jclass inputInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaInputClusterInputInfoStruct", inputInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaInputClusterInputInfoStruct"); + return nullptr; + } - jmethodID inputInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, inputInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V", &inputInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || inputInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaInputClusterInputInfoStruct constructor"); - return nullptr; - } + jmethodID inputInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, inputInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;)V", + &inputInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || inputInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaInputClusterInputInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(inputInfoStructStructClass_1, inputInfoStructStructCtor_1, newElement_0_index, - newElement_0_inputType, newElement_0_name, newElement_0_description); + newElement_0 = env->NewObject(inputInfoStructStructClass_1, inputInfoStructStructCtor_1, newElement_0_index, + newElement_0_inputType, newElement_0_name, newElement_0_description); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -40861,27 +41222,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass outputInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AudioOutputClusterOutputInfoStruct", outputInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfoStruct"); - return nullptr; - } + jclass outputInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AudioOutputClusterOutputInfoStruct", outputInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AudioOutputClusterOutputInfoStruct"); + return nullptr; + } - jmethodID outputInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, outputInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", - &outputInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || outputInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AudioOutputClusterOutputInfoStruct constructor"); - return nullptr; - } + jmethodID outputInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, outputInfoStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/String;)V", + &outputInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || outputInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AudioOutputClusterOutputInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(outputInfoStructStructClass_1, outputInfoStructStructCtor_1, newElement_0_index, - newElement_0_outputType, newElement_0_name); + newElement_0 = env->NewObject(outputInfoStructStructClass_1, outputInfoStructStructCtor_1, newElement_0_index, + newElement_0_outputType, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -41096,28 +41459,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().application.applicationID, value_application_applicationID)); - jclass applicationStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct", - applicationStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationStruct"); - return nullptr; - } + jclass applicationStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct", + applicationStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationStruct"); + return nullptr; + } - jmethodID applicationStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &applicationStructStructCtor_2); - if (err != CHIP_NO_ERROR || applicationStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationStruct constructor"); - return nullptr; - } + jmethodID applicationStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &applicationStructStructCtor_2); + if (err != CHIP_NO_ERROR || applicationStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationStruct constructor"); + return nullptr; + } - value_application = env->NewObject(applicationStructStructClass_2, applicationStructStructCtor_2, - value_application_catalogVendorID, value_application_applicationID); + value_application = env->NewObject(applicationStructStructClass_2, applicationStructStructCtor_2, + value_application_catalogVendorID, value_application_applicationID); + } jobject value_endpoint; if (!cppValue.Value().endpoint.HasValue()) { @@ -41135,29 +41500,327 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_endpointInsideOptional, value_endpoint); } - jclass applicationEPStructStructClass_1; + { + jclass applicationEPStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEPStruct", + applicationEPStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEPStruct"); + return nullptr; + } + + jmethodID applicationEPStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, applicationEPStructStructClass_1, "", + "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct;Ljava/util/Optional;)V", + &applicationEPStructStructCtor_1); + if (err != CHIP_NO_ERROR || applicationEPStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEPStruct constructor"); + return nullptr; + } + + value = env->NewObject(applicationEPStructStructClass_1, applicationEPStructStructCtor_1, value_application, + value_endpoint); + } + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::ApplicationBasic::Id: { + using namespace app::Clusters::ApplicationBasic; + switch (aPath.mAttributeId) + { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::ApplicationName::Id: { + using TypeInfo = Attributes::ApplicationName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::Application::Id: { + using TypeInfo = Attributes::Application::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_catalogVendorID; + std::string value_catalogVendorIDClassName = "java/lang/Integer"; + std::string value_catalogVendorIDCtorSignature = "(I)V"; + jint jnivalue_catalogVendorID = static_cast(cppValue.catalogVendorID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIDClassName.c_str(), + value_catalogVendorIDCtorSignature.c_str(), + jnivalue_catalogVendorID, value_catalogVendorID); + jobject value_applicationID; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.applicationID, value_applicationID)); + + { + jclass applicationStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationEPStruct", - applicationEPStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationStruct", + applicationStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationLauncherClusterApplicationEPStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationStruct"); return nullptr; } - jmethodID applicationEPStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, applicationEPStructStructClass_1, "", - "(Lchip/devicecontroller/ChipStructs$ApplicationLauncherClusterApplicationStruct;Ljava/util/Optional;)V", - &applicationEPStructStructCtor_1); - if (err != CHIP_NO_ERROR || applicationEPStructStructCtor_1 == nullptr) + jmethodID applicationStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &applicationStructStructCtor_0); + if (err != CHIP_NO_ERROR || applicationStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationLauncherClusterApplicationEPStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationStruct constructor"); return nullptr; } - value = env->NewObject(applicationEPStructStructClass_1, applicationEPStructStructCtor_1, value_application, - value_endpoint); + value = env->NewObject(applicationStructStructClass_0, applicationStructStructCtor_0, value_catalogVendorID, + value_applicationID); + } + return value; + } + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::ApplicationVersion::Id: { + using TypeInfo = Attributes::ApplicationVersion::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::AllowedVendorList::Id: { + using TypeInfo = Attributes::AllowedVendorList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } @@ -41299,12 +41962,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::ApplicationBasic::Id: { - using namespace app::Clusters::ApplicationBasic; + case app::Clusters::AccountLogin::Id: { + using namespace app::Clusters::AccountLogin; switch (aPath.mAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41312,11 +41975,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41324,15 +42000,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::ApplicationName::Id: { - using TypeInfo = Attributes::ApplicationName::TypeInfo; + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41340,11 +42025,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::TypeInfo; + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41352,15 +42050,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::Application::Id: { - using TypeInfo = Attributes::Application::TypeInfo; + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41368,41 +42075,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jobject value_catalogVendorID; - std::string value_catalogVendorIDClassName = "java/lang/Integer"; - std::string value_catalogVendorIDCtorSignature = "(I)V"; - jint jnivalue_catalogVendorID = static_cast(cppValue.catalogVendorID); - chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIDClassName.c_str(), - value_catalogVendorIDCtorSignature.c_str(), - jnivalue_catalogVendorID, value_catalogVendorID); - jobject value_applicationID; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.applicationID, value_applicationID)); - - jclass applicationStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationStruct", applicationStructStructClass_0); - if (err != CHIP_NO_ERROR) + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationStruct"); return nullptr; } - - jmethodID applicationStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, applicationStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &applicationStructStructCtor_0); - if (err != CHIP_NO_ERROR || applicationStructStructCtor_0 == nullptr) + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::ContentControl::Id: { + using namespace app::Clusters::ContentControl; + switch (aPath.mAttributeId) + { + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationStruct constructor"); return nullptr; } - - value = env->NewObject(applicationStructStructClass_0, applicationStructStructCtor_0, value_catalogVendorID, - value_applicationID); + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); return value; } - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::TypeInfo; + case Attributes::OnDemandRatings::Id: { + using TypeInfo = Attributes::OnDemandRatings::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41410,15 +42133,59 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + { + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", + ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } + + jmethodID ratingNameStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &ratingNameStructStructCtor_1); + if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, + newElement_0_ratingName, newElement_0_ratingNameDesc); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::ApplicationVersion::Id: { - using TypeInfo = Attributes::ApplicationVersion::TypeInfo; + case Attributes::OnDemandRatingThreshold::Id: { + using TypeInfo = Attributes::OnDemandRatingThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41429,8 +42196,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AllowedVendorList::Id: { - using TypeInfo = Attributes::AllowedVendorList::TypeInfo; + case Attributes::ScheduledContentRatings::Id: { + using TypeInfo = Attributes::ScheduledContentRatings::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41445,15 +42212,110 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Integer"; - std::string newElement_0CtorSignature = "(I)V"; - jint jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + jobject newElement_0_ratingName; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); + jobject newElement_0_ratingNameDesc; + if (!entry_0.ratingNameDesc.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); + } + else + { + jobject newElement_0_ratingNameDescInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( + entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, + newElement_0_ratingNameDesc); + } + + { + jclass ratingNameStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", + ratingNameStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); + return nullptr; + } + + jmethodID ratingNameStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", + "(Ljava/lang/String;Ljava/util/Optional;)V", + &ratingNameStructStructCtor_1); + if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, + newElement_0_ratingName, newElement_0_ratingNameDesc); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } + case Attributes::ScheduledContentRatingThreshold::Id: { + using TypeInfo = Attributes::ScheduledContentRatingThreshold::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ScreenDailyTime::Id: { + using TypeInfo = Attributes::ScreenDailyTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::RemainingScreenTime::Id: { + using TypeInfo = Attributes::RemainingScreenTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::BlockUnrated::Id: { + using TypeInfo = Attributes::BlockUnrated::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -41592,8 +42454,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::AccountLogin::Id: { - using namespace app::Clusters::AccountLogin; + case app::Clusters::ContentAppObserver::Id: { + using namespace app::Clusters::ContentAppObserver; switch (aPath.mAttributeId) { case Attributes::GeneratedCommandList::Id: { @@ -41734,12 +42596,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::ContentControl::Id: { - using namespace app::Clusters::ContentControl; + case app::Clusters::ZoneManagement::Id: { + using namespace app::Clusters::ZoneManagement; switch (aPath.mAttributeId) { - case Attributes::Enabled::Id: { - using TypeInfo = Attributes::Enabled::TypeInfo; + case Attributes::SupportedZoneSources::Id: { + using TypeInfo = Attributes::SupportedZoneSources::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41747,15 +42609,24 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Boolean"; - std::string valueCtorSignature = "(Z)V"; - jboolean jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::OnDemandRatings::Id: { - using TypeInfo = Attributes::OnDemandRatings::TypeInfo; + case Attributes::Zones::Id: { + using TypeInfo = Attributes::Zones::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41770,61 +42641,58 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_ratingName; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); - jobject newElement_0_ratingNameDesc; - if (!entry_0.ratingNameDesc.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); - } - else - { - jobject newElement_0_ratingNameDescInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, - newElement_0_ratingNameDesc); - } + jobject newElement_0_zoneID; + std::string newElement_0_zoneIDClassName = "java/lang/Integer"; + std::string newElement_0_zoneIDCtorSignature = "(I)V"; + jint jninewElement_0_zoneID = static_cast(entry_0.zoneID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneIDClassName.c_str(), + newElement_0_zoneIDCtorSignature.c_str(), + jninewElement_0_zoneID, newElement_0_zoneID); + jobject newElement_0_zoneType; + std::string newElement_0_zoneTypeClassName = "java/lang/Integer"; + std::string newElement_0_zoneTypeCtorSignature = "(I)V"; + jint jninewElement_0_zoneType = static_cast(entry_0.zoneType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneTypeClassName.c_str(), + newElement_0_zoneTypeCtorSignature.c_str(), + jninewElement_0_zoneType, newElement_0_zoneType); + jobject newElement_0_zoneSource; + std::string newElement_0_zoneSourceClassName = "java/lang/Integer"; + std::string newElement_0_zoneSourceCtorSignature = "(I)V"; + jint jninewElement_0_zoneSource = static_cast(entry_0.zoneSource); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_zoneSourceClassName.c_str(), + newElement_0_zoneSourceCtorSignature.c_str(), + jninewElement_0_zoneSource, newElement_0_zoneSource); - jclass ratingNameStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); - return nullptr; - } + jclass zoneInformationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneInformationStruct", + zoneInformationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneInformationStruct"); + return nullptr; + } - jmethodID ratingNameStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &ratingNameStructStructCtor_1); - if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); - return nullptr; - } + jmethodID zoneInformationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneInformationStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &zoneInformationStructStructCtor_1); + if (err != CHIP_NO_ERROR || zoneInformationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ZoneManagementClusterZoneInformationStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, - newElement_0_ratingNameDesc); + newElement_0 = env->NewObject(zoneInformationStructStructClass_1, zoneInformationStructStructCtor_1, + newElement_0_zoneID, newElement_0_zoneType, newElement_0_zoneSource); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::OnDemandRatingThreshold::Id: { - using TypeInfo = Attributes::OnDemandRatingThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::ScheduledContentRatings::Id: { - using TypeInfo = Attributes::ScheduledContentRatings::TypeInfo; + case Attributes::TimeControl::Id: { + using TypeInfo = Attributes::TimeControl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41839,93 +42707,69 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_ratingName; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.ratingName, newElement_0_ratingName)); - jobject newElement_0_ratingNameDesc; - if (!entry_0.ratingNameDesc.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_ratingNameDesc); - } - else - { - jobject newElement_0_ratingNameDescInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - entry_0.ratingNameDesc.Value(), newElement_0_ratingNameDescInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_ratingNameDescInsideOptional, - newElement_0_ratingNameDesc); - } + jobject newElement_0_initialDuration; + std::string newElement_0_initialDurationClassName = "java/lang/Integer"; + std::string newElement_0_initialDurationCtorSignature = "(I)V"; + jint jninewElement_0_initialDuration = static_cast(entry_0.initialDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_initialDurationClassName.c_str(), newElement_0_initialDurationCtorSignature.c_str(), + jninewElement_0_initialDuration, newElement_0_initialDuration); + jobject newElement_0_augmentationDuration; + std::string newElement_0_augmentationDurationClassName = "java/lang/Integer"; + std::string newElement_0_augmentationDurationCtorSignature = "(I)V"; + jint jninewElement_0_augmentationDuration = static_cast(entry_0.augmentationDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_augmentationDurationClassName.c_str(), newElement_0_augmentationDurationCtorSignature.c_str(), + jninewElement_0_augmentationDuration, newElement_0_augmentationDuration); + jobject newElement_0_maxDuration; + std::string newElement_0_maxDurationClassName = "java/lang/Long"; + std::string newElement_0_maxDurationCtorSignature = "(J)V"; + jlong jninewElement_0_maxDuration = static_cast(entry_0.maxDuration); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxDurationClassName.c_str(), + newElement_0_maxDurationCtorSignature.c_str(), + jninewElement_0_maxDuration, newElement_0_maxDuration); + jobject newElement_0_blindDuration; + std::string newElement_0_blindDurationClassName = "java/lang/Integer"; + std::string newElement_0_blindDurationCtorSignature = "(I)V"; + jint jninewElement_0_blindDuration = static_cast(entry_0.blindDuration); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_blindDurationClassName.c_str(), newElement_0_blindDurationCtorSignature.c_str(), + jninewElement_0_blindDuration, newElement_0_blindDuration); - jclass ratingNameStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ContentControlClusterRatingNameStruct", ratingNameStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ContentControlClusterRatingNameStruct"); - return nullptr; - } + jclass zoneTriggeringTimeControlStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct", + zoneTriggeringTimeControlStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct"); + return nullptr; + } - jmethodID ratingNameStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, ratingNameStructStructClass_1, "", - "(Ljava/lang/String;Ljava/util/Optional;)V", - &ratingNameStructStructCtor_1); - if (err != CHIP_NO_ERROR || ratingNameStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ContentControlClusterRatingNameStruct constructor"); - return nullptr; - } + jmethodID zoneTriggeringTimeControlStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneTriggeringTimeControlStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V", + &zoneTriggeringTimeControlStructStructCtor_1); + if (err != CHIP_NO_ERROR || zoneTriggeringTimeControlStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ZoneManagementClusterZoneTriggeringTimeControlStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ratingNameStructStructClass_1, ratingNameStructStructCtor_1, newElement_0_ratingName, - newElement_0_ratingNameDesc); + newElement_0 = + env->NewObject(zoneTriggeringTimeControlStructStructClass_1, zoneTriggeringTimeControlStructStructCtor_1, + newElement_0_initialDuration, newElement_0_augmentationDuration, newElement_0_maxDuration, + newElement_0_blindDuration); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::ScheduledContentRatingThreshold::Id: { - using TypeInfo = Attributes::ScheduledContentRatingThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::ScreenDailyTime::Id: { - using TypeInfo = Attributes::ScreenDailyTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::RemainingScreenTime::Id: { - using TypeInfo = Attributes::RemainingScreenTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::BlockUnrated::Id: { - using TypeInfo = Attributes::BlockUnrated::TypeInfo; + case Attributes::Sensitivity::Id: { + using TypeInfo = Attributes::Sensitivity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -41933,11 +42777,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Boolean"; - std::string valueCtorSignature = "(Z)V"; - jboolean jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); return value; } case Attributes::GeneratedCommandList::Id: { @@ -42078,10 +42922,1804 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::ContentAppObserver::Id: { - using namespace app::Clusters::ContentAppObserver; + case app::Clusters::CameraAvStreamManagement::Id: { + using namespace app::Clusters::CameraAvStreamManagement; switch (aPath.mAttributeId) { + case Attributes::MaxConcurrentVideoEncoders::Id: { + using TypeInfo = Attributes::MaxConcurrentVideoEncoders::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MaxEncodedPixelRate::Id: { + using TypeInfo = Attributes::MaxEncodedPixelRate::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::VideoSensorParams::Id: { + using TypeInfo = Attributes::VideoSensorParams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_sensorWidth; + std::string value_sensorWidthClassName = "java/lang/Integer"; + std::string value_sensorWidthCtorSignature = "(I)V"; + jint jnivalue_sensorWidth = static_cast(cppValue.sensorWidth); + chip::JniReferences::GetInstance().CreateBoxedObject(value_sensorWidthClassName.c_str(), + value_sensorWidthCtorSignature.c_str(), jnivalue_sensorWidth, + value_sensorWidth); + jobject value_sensorHeight; + std::string value_sensorHeightClassName = "java/lang/Integer"; + std::string value_sensorHeightCtorSignature = "(I)V"; + jint jnivalue_sensorHeight = static_cast(cppValue.sensorHeight); + chip::JniReferences::GetInstance().CreateBoxedObject(value_sensorHeightClassName.c_str(), + value_sensorHeightCtorSignature.c_str(), + jnivalue_sensorHeight, value_sensorHeight); + jobject value_HDRCapable; + std::string value_HDRCapableClassName = "java/lang/Boolean"; + std::string value_HDRCapableCtorSignature = "(Z)V"; + jboolean jnivalue_HDRCapable = static_cast(cppValue.HDRCapable); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_HDRCapableClassName.c_str(), value_HDRCapableCtorSignature.c_str(), jnivalue_HDRCapable, value_HDRCapable); + jobject value_maxFPS; + std::string value_maxFPSClassName = "java/lang/Integer"; + std::string value_maxFPSCtorSignature = "(I)V"; + jint jnivalue_maxFPS = static_cast(cppValue.maxFPS); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFPSClassName.c_str(), value_maxFPSCtorSignature.c_str(), jnivalue_maxFPS, value_maxFPS); + jobject value_maxHDRFPS; + std::string value_maxHDRFPSClassName = "java/lang/Integer"; + std::string value_maxHDRFPSCtorSignature = "(I)V"; + jint jnivalue_maxHDRFPS = static_cast(cppValue.maxHDRFPS); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxHDRFPSClassName.c_str(), value_maxHDRFPSCtorSignature.c_str(), jnivalue_maxHDRFPS, value_maxHDRFPS); + + { + jclass videoSensorParamsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct", + videoSensorParamsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct"); + return nullptr; + } + + jmethodID videoSensorParamsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoSensorParamsStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoSensorParamsStructStructCtor_0); + if (err != CHIP_NO_ERROR || videoSensorParamsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoSensorParamsStruct constructor"); + return nullptr; + } + + value = env->NewObject(videoSensorParamsStructStructClass_0, videoSensorParamsStructStructCtor_0, value_sensorWidth, + value_sensorHeight, value_HDRCapable, value_maxFPS, value_maxHDRFPS); + } + return value; + } + case Attributes::NightVisionCapable::Id: { + using TypeInfo = Attributes::NightVisionCapable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MinViewport::Id: { + using TypeInfo = Attributes::MinViewport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_width; + std::string value_widthClassName = "java/lang/Integer"; + std::string value_widthCtorSignature = "(I)V"; + jint jnivalue_width = static_cast(cppValue.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_widthClassName.c_str(), value_widthCtorSignature.c_str(), jnivalue_width, value_width); + jobject value_height; + std::string value_heightClassName = "java/lang/Integer"; + std::string value_heightCtorSignature = "(I)V"; + jint jnivalue_height = static_cast(cppValue.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_heightClassName.c_str(), value_heightCtorSignature.c_str(), jnivalue_height, value_height); + + { + jclass videoResolutionStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_0); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value = env->NewObject(videoResolutionStructStructClass_0, videoResolutionStructStructCtor_0, value_width, + value_height); + } + return value; + } + case Attributes::RateDistortionTradeOffPoints::Id: { + using TypeInfo = Attributes::RateDistortionTradeOffPoints::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_codec; + std::string newElement_0_codecClassName = "java/lang/Integer"; + std::string newElement_0_codecCtorSignature = "(I)V"; + jint jninewElement_0_codec = static_cast(entry_0.codec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_codecClassName.c_str(), + newElement_0_codecCtorSignature.c_str(), + jninewElement_0_codec, newElement_0_codec); + jobject newElement_0_resolution; + jobject newElement_0_resolution_width; + std::string newElement_0_resolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_resolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_resolution_width = static_cast(entry_0.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_widthClassName.c_str(), newElement_0_resolution_widthCtorSignature.c_str(), + jninewElement_0_resolution_width, newElement_0_resolution_width); + jobject newElement_0_resolution_height; + std::string newElement_0_resolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_resolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_resolution_height = static_cast(entry_0.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_heightClassName.c_str(), newElement_0_resolution_heightCtorSignature.c_str(), + jninewElement_0_resolution_height, newElement_0_resolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_resolution = env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_resolution_width, newElement_0_resolution_height); + } + jobject newElement_0_minBitRate; + std::string newElement_0_minBitRateClassName = "java/lang/Long"; + std::string newElement_0_minBitRateCtorSignature = "(J)V"; + jlong jninewElement_0_minBitRate = static_cast(entry_0.minBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minBitRateClassName.c_str(), + newElement_0_minBitRateCtorSignature.c_str(), + jninewElement_0_minBitRate, newElement_0_minBitRate); + + { + jclass rateDistortionTradeOffPointsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct", + rateDistortionTradeOffPointsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, + "Could not find class ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct"); + return nullptr; + } + + jmethodID rateDistortionTradeOffPointsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, rateDistortionTradeOffPointsStructStructClass_1, "", + "(Ljava/lang/Integer;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Long;)V", + &rateDistortionTradeOffPointsStructStructCtor_1); + if (err != CHIP_NO_ERROR || rateDistortionTradeOffPointsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterRateDistortionTradeOffPointsStruct " + "constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(rateDistortionTradeOffPointsStructStructClass_1, + rateDistortionTradeOffPointsStructStructCtor_1, newElement_0_codec, + newElement_0_resolution, newElement_0_minBitRate); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::MaxPreRollBufferSize::Id: { + using TypeInfo = Attributes::MaxPreRollBufferSize::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MicrophoneCapabilities::Id: { + using TypeInfo = Attributes::MicrophoneCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_maxNumberOfChannels; + std::string value_maxNumberOfChannelsClassName = "java/lang/Integer"; + std::string value_maxNumberOfChannelsCtorSignature = "(I)V"; + jint jnivalue_maxNumberOfChannels = static_cast(cppValue.maxNumberOfChannels); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxNumberOfChannelsClassName.c_str(), + value_maxNumberOfChannelsCtorSignature.c_str(), + jnivalue_maxNumberOfChannels, value_maxNumberOfChannels); + jobject value_supportedCodecs; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedCodecs); + + auto iter_value_supportedCodecs_1 = cppValue.supportedCodecs.begin(); + while (iter_value_supportedCodecs_1.Next()) + { + auto & entry_1 = iter_value_supportedCodecs_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + jint jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedCodecs, newElement_1); + } + jobject value_supportedSampleRates; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedSampleRates); + + auto iter_value_supportedSampleRates_1 = cppValue.supportedSampleRates.begin(); + while (iter_value_supportedSampleRates_1.Next()) + { + auto & entry_1 = iter_value_supportedSampleRates_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Long"; + std::string newElement_1CtorSignature = "(J)V"; + jlong jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedSampleRates, newElement_1); + } + jobject value_supportedBitDepths; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedBitDepths); + + auto iter_value_supportedBitDepths_1 = cppValue.supportedBitDepths.begin(); + while (iter_value_supportedBitDepths_1.Next()) + { + auto & entry_1 = iter_value_supportedBitDepths_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + jint jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedBitDepths, newElement_1); + } + + { + jclass audioCapabilitiesStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct", + audioCapabilitiesStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + return nullptr; + } + + jmethodID audioCapabilitiesStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioCapabilitiesStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", + &audioCapabilitiesStructStructCtor_0); + if (err != CHIP_NO_ERROR || audioCapabilitiesStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct constructor"); + return nullptr; + } + + value = env->NewObject(audioCapabilitiesStructStructClass_0, audioCapabilitiesStructStructCtor_0, + value_maxNumberOfChannels, value_supportedCodecs, value_supportedSampleRates, + value_supportedBitDepths); + } + return value; + } + case Attributes::SpeakerCapabilities::Id: { + using TypeInfo = Attributes::SpeakerCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_maxNumberOfChannels; + std::string value_maxNumberOfChannelsClassName = "java/lang/Integer"; + std::string value_maxNumberOfChannelsCtorSignature = "(I)V"; + jint jnivalue_maxNumberOfChannels = static_cast(cppValue.maxNumberOfChannels); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxNumberOfChannelsClassName.c_str(), + value_maxNumberOfChannelsCtorSignature.c_str(), + jnivalue_maxNumberOfChannels, value_maxNumberOfChannels); + jobject value_supportedCodecs; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedCodecs); + + auto iter_value_supportedCodecs_1 = cppValue.supportedCodecs.begin(); + while (iter_value_supportedCodecs_1.Next()) + { + auto & entry_1 = iter_value_supportedCodecs_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + jint jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedCodecs, newElement_1); + } + jobject value_supportedSampleRates; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedSampleRates); + + auto iter_value_supportedSampleRates_1 = cppValue.supportedSampleRates.begin(); + while (iter_value_supportedSampleRates_1.Next()) + { + auto & entry_1 = iter_value_supportedSampleRates_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Long"; + std::string newElement_1CtorSignature = "(J)V"; + jlong jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedSampleRates, newElement_1); + } + jobject value_supportedBitDepths; + chip::JniReferences::GetInstance().CreateArrayList(value_supportedBitDepths); + + auto iter_value_supportedBitDepths_1 = cppValue.supportedBitDepths.begin(); + while (iter_value_supportedBitDepths_1.Next()) + { + auto & entry_1 = iter_value_supportedBitDepths_1.GetValue(); + jobject newElement_1; + std::string newElement_1ClassName = "java/lang/Integer"; + std::string newElement_1CtorSignature = "(I)V"; + jint jninewElement_1 = static_cast(entry_1); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1ClassName.c_str(), newElement_1CtorSignature.c_str(), jninewElement_1, newElement_1); + chip::JniReferences::GetInstance().AddToList(value_supportedBitDepths, newElement_1); + } + + { + jclass audioCapabilitiesStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct", + audioCapabilitiesStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct"); + return nullptr; + } + + jmethodID audioCapabilitiesStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioCapabilitiesStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", + &audioCapabilitiesStructStructCtor_0); + if (err != CHIP_NO_ERROR || audioCapabilitiesStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterAudioCapabilitiesStruct constructor"); + return nullptr; + } + + value = env->NewObject(audioCapabilitiesStructStructClass_0, audioCapabilitiesStructStructCtor_0, + value_maxNumberOfChannels, value_supportedCodecs, value_supportedSampleRates, + value_supportedBitDepths); + } + return value; + } + case Attributes::TwoWayTalkSupport::Id: { + using TypeInfo = Attributes::TwoWayTalkSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::SupportedSnapshotParams::Id: { + using TypeInfo = Attributes::SupportedSnapshotParams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_resolution; + jobject newElement_0_resolution_width; + std::string newElement_0_resolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_resolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_resolution_width = static_cast(entry_0.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_widthClassName.c_str(), newElement_0_resolution_widthCtorSignature.c_str(), + jninewElement_0_resolution_width, newElement_0_resolution_width); + jobject newElement_0_resolution_height; + std::string newElement_0_resolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_resolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_resolution_height = static_cast(entry_0.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_resolution_heightClassName.c_str(), newElement_0_resolution_heightCtorSignature.c_str(), + jninewElement_0_resolution_height, newElement_0_resolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_resolution = env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_resolution_width, newElement_0_resolution_height); + } + jobject newElement_0_maxFrameRate; + std::string newElement_0_maxFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_maxFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_maxFrameRate = static_cast(entry_0.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxFrameRateClassName.c_str(), + newElement_0_maxFrameRateCtorSignature.c_str(), + jninewElement_0_maxFrameRate, newElement_0_maxFrameRate); + jobject newElement_0_imageCodec; + std::string newElement_0_imageCodecClassName = "java/lang/Integer"; + std::string newElement_0_imageCodecCtorSignature = "(I)V"; + jint jninewElement_0_imageCodec = static_cast(entry_0.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_imageCodecClassName.c_str(), + newElement_0_imageCodecCtorSignature.c_str(), + jninewElement_0_imageCodec, newElement_0_imageCodec); + + { + jclass snapshotParamsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct", + snapshotParamsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct"); + return nullptr; + } + + jmethodID snapshotParamsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotParamsStructStructClass_1, "", + "(Lchip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &snapshotParamsStructStructCtor_1); + if (err != CHIP_NO_ERROR || snapshotParamsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(snapshotParamsStructStructClass_1, snapshotParamsStructStructCtor_1, + newElement_0_resolution, newElement_0_maxFrameRate, newElement_0_imageCodec); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::MaxNetworkBandwidth::Id: { + using TypeInfo = Attributes::MaxNetworkBandwidth::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::CurrentFrameRate::Id: { + using TypeInfo = Attributes::CurrentFrameRate::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::HDRModeEnabled::Id: { + using TypeInfo = Attributes::HDRModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::CurrentVideoCodecs::Id: { + using TypeInfo = Attributes::CurrentVideoCodecs::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::CurrentSnapshotConfig::Id: { + using TypeInfo = Attributes::CurrentSnapshotConfig::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_resolution; + jobject value_resolution_width; + std::string value_resolution_widthClassName = "java/lang/Integer"; + std::string value_resolution_widthCtorSignature = "(I)V"; + jint jnivalue_resolution_width = static_cast(cppValue.resolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject(value_resolution_widthClassName.c_str(), + value_resolution_widthCtorSignature.c_str(), + jnivalue_resolution_width, value_resolution_width); + jobject value_resolution_height; + std::string value_resolution_heightClassName = "java/lang/Integer"; + std::string value_resolution_heightCtorSignature = "(I)V"; + jint jnivalue_resolution_height = static_cast(cppValue.resolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject(value_resolution_heightClassName.c_str(), + value_resolution_heightCtorSignature.c_str(), + jnivalue_resolution_height, value_resolution_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_resolution = env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_resolution_width, value_resolution_height); + } + jobject value_maxFrameRate; + std::string value_maxFrameRateClassName = "java/lang/Integer"; + std::string value_maxFrameRateCtorSignature = "(I)V"; + jint jnivalue_maxFrameRate = static_cast(cppValue.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(value_maxFrameRateClassName.c_str(), + value_maxFrameRateCtorSignature.c_str(), + jnivalue_maxFrameRate, value_maxFrameRate); + jobject value_imageCodec; + std::string value_imageCodecClassName = "java/lang/Integer"; + std::string value_imageCodecCtorSignature = "(I)V"; + jint jnivalue_imageCodec = static_cast(cppValue.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_imageCodecClassName.c_str(), value_imageCodecCtorSignature.c_str(), jnivalue_imageCodec, value_imageCodec); + + { + jclass snapshotParamsStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct", + snapshotParamsStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct"); + return nullptr; + } + + jmethodID snapshotParamsStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotParamsStructStructClass_0, "", + "(Lchip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &snapshotParamsStructStructCtor_0); + if (err != CHIP_NO_ERROR || snapshotParamsStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotParamsStruct constructor"); + return nullptr; + } + + value = env->NewObject(snapshotParamsStructStructClass_0, snapshotParamsStructStructCtor_0, value_resolution, + value_maxFrameRate, value_imageCodec); + } + return value; + } + case Attributes::FabricsUsingCamera::Id: { + using TypeInfo = Attributes::FabricsUsingCamera::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AllocatedVideoStreams::Id: { + using TypeInfo = Attributes::AllocatedVideoStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_videoStreamID; + std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), + jninewElement_0_videoStreamID, newElement_0_videoStreamID); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_videoCodec; + std::string newElement_0_videoCodecClassName = "java/lang/Integer"; + std::string newElement_0_videoCodecCtorSignature = "(I)V"; + jint jninewElement_0_videoCodec = static_cast(entry_0.videoCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_videoCodecClassName.c_str(), + newElement_0_videoCodecCtorSignature.c_str(), + jninewElement_0_videoCodec, newElement_0_videoCodec); + jobject newElement_0_minFrameRate; + std::string newElement_0_minFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_minFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_minFrameRate = static_cast(entry_0.minFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minFrameRateClassName.c_str(), + newElement_0_minFrameRateCtorSignature.c_str(), + jninewElement_0_minFrameRate, newElement_0_minFrameRate); + jobject newElement_0_maxFrameRate; + std::string newElement_0_maxFrameRateClassName = "java/lang/Integer"; + std::string newElement_0_maxFrameRateCtorSignature = "(I)V"; + jint jninewElement_0_maxFrameRate = static_cast(entry_0.maxFrameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxFrameRateClassName.c_str(), + newElement_0_maxFrameRateCtorSignature.c_str(), + jninewElement_0_maxFrameRate, newElement_0_maxFrameRate); + jobject newElement_0_minResolution; + jobject newElement_0_minResolution_width; + std::string newElement_0_minResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_width = static_cast(entry_0.minResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_widthClassName.c_str(), newElement_0_minResolution_widthCtorSignature.c_str(), + jninewElement_0_minResolution_width, newElement_0_minResolution_width); + jobject newElement_0_minResolution_height; + std::string newElement_0_minResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_height = static_cast(entry_0.minResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_heightClassName.c_str(), newElement_0_minResolution_heightCtorSignature.c_str(), + jninewElement_0_minResolution_height, newElement_0_minResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_minResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_minResolution_width, newElement_0_minResolution_height); + } + jobject newElement_0_maxResolution; + jobject newElement_0_maxResolution_width; + std::string newElement_0_maxResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_width = static_cast(entry_0.maxResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_widthClassName.c_str(), newElement_0_maxResolution_widthCtorSignature.c_str(), + jninewElement_0_maxResolution_width, newElement_0_maxResolution_width); + jobject newElement_0_maxResolution_height; + std::string newElement_0_maxResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_height = static_cast(entry_0.maxResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_heightClassName.c_str(), newElement_0_maxResolution_heightCtorSignature.c_str(), + jninewElement_0_maxResolution_height, newElement_0_maxResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_maxResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_maxResolution_width, newElement_0_maxResolution_height); + } + jobject newElement_0_minBitRate; + std::string newElement_0_minBitRateClassName = "java/lang/Long"; + std::string newElement_0_minBitRateCtorSignature = "(J)V"; + jlong jninewElement_0_minBitRate = static_cast(entry_0.minBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_minBitRateClassName.c_str(), + newElement_0_minBitRateCtorSignature.c_str(), + jninewElement_0_minBitRate, newElement_0_minBitRate); + jobject newElement_0_maxBitRate; + std::string newElement_0_maxBitRateClassName = "java/lang/Long"; + std::string newElement_0_maxBitRateCtorSignature = "(J)V"; + jlong jninewElement_0_maxBitRate = static_cast(entry_0.maxBitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_maxBitRateClassName.c_str(), + newElement_0_maxBitRateCtorSignature.c_str(), + jninewElement_0_maxBitRate, newElement_0_maxBitRate); + jobject newElement_0_minFragmentLen; + std::string newElement_0_minFragmentLenClassName = "java/lang/Integer"; + std::string newElement_0_minFragmentLenCtorSignature = "(I)V"; + jint jninewElement_0_minFragmentLen = static_cast(entry_0.minFragmentLen); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minFragmentLenClassName.c_str(), newElement_0_minFragmentLenCtorSignature.c_str(), + jninewElement_0_minFragmentLen, newElement_0_minFragmentLen); + jobject newElement_0_maxFragmentLen; + std::string newElement_0_maxFragmentLenClassName = "java/lang/Integer"; + std::string newElement_0_maxFragmentLenCtorSignature = "(I)V"; + jint jninewElement_0_maxFragmentLen = static_cast(entry_0.maxFragmentLen); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxFragmentLenClassName.c_str(), newElement_0_maxFragmentLenCtorSignature.c_str(), + jninewElement_0_maxFragmentLen, newElement_0_maxFragmentLen); + jobject newElement_0_watermarkEnabled; + if (!entry_0.watermarkEnabled.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_watermarkEnabled); + } + else + { + jobject newElement_0_watermarkEnabledInsideOptional; + std::string newElement_0_watermarkEnabledInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_0_watermarkEnabledInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_0_watermarkEnabledInsideOptional = + static_cast(entry_0.watermarkEnabled.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_watermarkEnabledInsideOptionalClassName.c_str(), + newElement_0_watermarkEnabledInsideOptionalCtorSignature.c_str(), + jninewElement_0_watermarkEnabledInsideOptional, newElement_0_watermarkEnabledInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_watermarkEnabledInsideOptional, + newElement_0_watermarkEnabled); + } + jobject newElement_0_OSDEnabled; + if (!entry_0.OSDEnabled.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_OSDEnabled); + } + else + { + jobject newElement_0_OSDEnabledInsideOptional; + std::string newElement_0_OSDEnabledInsideOptionalClassName = "java/lang/Boolean"; + std::string newElement_0_OSDEnabledInsideOptionalCtorSignature = "(Z)V"; + jboolean jninewElement_0_OSDEnabledInsideOptional = static_cast(entry_0.OSDEnabled.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_OSDEnabledInsideOptionalClassName.c_str(), + newElement_0_OSDEnabledInsideOptionalCtorSignature.c_str(), jninewElement_0_OSDEnabledInsideOptional, + newElement_0_OSDEnabledInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_OSDEnabledInsideOptional, + newElement_0_OSDEnabled); + } + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass videoStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct", + videoStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct"); + return nullptr; + } + + jmethodID videoStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Lchip/" + "devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Long;Ljava/lang/Long;Ljava/" + "lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;)V", + &videoStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject( + videoStreamStructStructClass_1, videoStreamStructStructCtor_1, newElement_0_videoStreamID, + newElement_0_streamType, newElement_0_videoCodec, newElement_0_minFrameRate, newElement_0_maxFrameRate, + newElement_0_minResolution, newElement_0_maxResolution, newElement_0_minBitRate, newElement_0_maxBitRate, + newElement_0_minFragmentLen, newElement_0_maxFragmentLen, newElement_0_watermarkEnabled, + newElement_0_OSDEnabled, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AllocatedAudioStreams::Id: { + using TypeInfo = Attributes::AllocatedAudioStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_audioStreamID; + std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), + jninewElement_0_audioStreamID, newElement_0_audioStreamID); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_audioCodec; + std::string newElement_0_audioCodecClassName = "java/lang/Integer"; + std::string newElement_0_audioCodecCtorSignature = "(I)V"; + jint jninewElement_0_audioCodec = static_cast(entry_0.audioCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_audioCodecClassName.c_str(), + newElement_0_audioCodecCtorSignature.c_str(), + jninewElement_0_audioCodec, newElement_0_audioCodec); + jobject newElement_0_channelCount; + std::string newElement_0_channelCountClassName = "java/lang/Integer"; + std::string newElement_0_channelCountCtorSignature = "(I)V"; + jint jninewElement_0_channelCount = static_cast(entry_0.channelCount); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_channelCountClassName.c_str(), + newElement_0_channelCountCtorSignature.c_str(), + jninewElement_0_channelCount, newElement_0_channelCount); + jobject newElement_0_sampleRate; + std::string newElement_0_sampleRateClassName = "java/lang/Long"; + std::string newElement_0_sampleRateCtorSignature = "(J)V"; + jlong jninewElement_0_sampleRate = static_cast(entry_0.sampleRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_sampleRateClassName.c_str(), + newElement_0_sampleRateCtorSignature.c_str(), + jninewElement_0_sampleRate, newElement_0_sampleRate); + jobject newElement_0_bitRate; + std::string newElement_0_bitRateClassName = "java/lang/Long"; + std::string newElement_0_bitRateCtorSignature = "(J)V"; + jlong jninewElement_0_bitRate = static_cast(entry_0.bitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitRateClassName.c_str(), + newElement_0_bitRateCtorSignature.c_str(), + jninewElement_0_bitRate, newElement_0_bitRate); + jobject newElement_0_bitDepth; + std::string newElement_0_bitDepthClassName = "java/lang/Integer"; + std::string newElement_0_bitDepthCtorSignature = "(I)V"; + jint jninewElement_0_bitDepth = static_cast(entry_0.bitDepth); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitDepthClassName.c_str(), + newElement_0_bitDepthCtorSignature.c_str(), + jninewElement_0_bitDepth, newElement_0_bitDepth); + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass audioStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct", + audioStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct"); + return nullptr; + } + + jmethodID audioStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/" + "Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &audioStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || audioStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterAudioStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(audioStreamStructStructClass_1, audioStreamStructStructCtor_1, + newElement_0_audioStreamID, newElement_0_streamType, newElement_0_audioCodec, + newElement_0_channelCount, newElement_0_sampleRate, newElement_0_bitRate, + newElement_0_bitDepth, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AllocatedSnapshotStreams::Id: { + using TypeInfo = Attributes::AllocatedSnapshotStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_snapshotStreamID; + std::string newElement_0_snapshotStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_snapshotStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_snapshotStreamID = static_cast(entry_0.snapshotStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_snapshotStreamIDClassName.c_str(), newElement_0_snapshotStreamIDCtorSignature.c_str(), + jninewElement_0_snapshotStreamID, newElement_0_snapshotStreamID); + jobject newElement_0_imageCodec; + std::string newElement_0_imageCodecClassName = "java/lang/Integer"; + std::string newElement_0_imageCodecCtorSignature = "(I)V"; + jint jninewElement_0_imageCodec = static_cast(entry_0.imageCodec); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_imageCodecClassName.c_str(), + newElement_0_imageCodecCtorSignature.c_str(), + jninewElement_0_imageCodec, newElement_0_imageCodec); + jobject newElement_0_frameRate; + std::string newElement_0_frameRateClassName = "java/lang/Integer"; + std::string newElement_0_frameRateCtorSignature = "(I)V"; + jint jninewElement_0_frameRate = static_cast(entry_0.frameRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_frameRateClassName.c_str(), + newElement_0_frameRateCtorSignature.c_str(), + jninewElement_0_frameRate, newElement_0_frameRate); + jobject newElement_0_bitRate; + std::string newElement_0_bitRateClassName = "java/lang/Long"; + std::string newElement_0_bitRateCtorSignature = "(J)V"; + jlong jninewElement_0_bitRate = static_cast(entry_0.bitRate); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_bitRateClassName.c_str(), + newElement_0_bitRateCtorSignature.c_str(), + jninewElement_0_bitRate, newElement_0_bitRate); + jobject newElement_0_minResolution; + jobject newElement_0_minResolution_width; + std::string newElement_0_minResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_width = static_cast(entry_0.minResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_widthClassName.c_str(), newElement_0_minResolution_widthCtorSignature.c_str(), + jninewElement_0_minResolution_width, newElement_0_minResolution_width); + jobject newElement_0_minResolution_height; + std::string newElement_0_minResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_minResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_minResolution_height = static_cast(entry_0.minResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_minResolution_heightClassName.c_str(), newElement_0_minResolution_heightCtorSignature.c_str(), + jninewElement_0_minResolution_height, newElement_0_minResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_minResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_minResolution_width, newElement_0_minResolution_height); + } + jobject newElement_0_maxResolution; + jobject newElement_0_maxResolution_width; + std::string newElement_0_maxResolution_widthClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_widthCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_width = static_cast(entry_0.maxResolution.width); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_widthClassName.c_str(), newElement_0_maxResolution_widthCtorSignature.c_str(), + jninewElement_0_maxResolution_width, newElement_0_maxResolution_width); + jobject newElement_0_maxResolution_height; + std::string newElement_0_maxResolution_heightClassName = "java/lang/Integer"; + std::string newElement_0_maxResolution_heightCtorSignature = "(I)V"; + jint jninewElement_0_maxResolution_height = static_cast(entry_0.maxResolution.height); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_maxResolution_heightClassName.c_str(), newElement_0_maxResolution_heightCtorSignature.c_str(), + jninewElement_0_maxResolution_height, newElement_0_maxResolution_height); + + { + jclass videoResolutionStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_2); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + newElement_0_maxResolution = + env->NewObject(videoResolutionStructStructClass_2, videoResolutionStructStructCtor_2, + newElement_0_maxResolution_width, newElement_0_maxResolution_height); + } + jobject newElement_0_quality; + std::string newElement_0_qualityClassName = "java/lang/Integer"; + std::string newElement_0_qualityCtorSignature = "(I)V"; + jint jninewElement_0_quality = static_cast(entry_0.quality); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_qualityClassName.c_str(), + newElement_0_qualityCtorSignature.c_str(), + jninewElement_0_quality, newElement_0_quality); + jobject newElement_0_referenceCount; + std::string newElement_0_referenceCountClassName = "java/lang/Integer"; + std::string newElement_0_referenceCountCtorSignature = "(I)V"; + jint jninewElement_0_referenceCount = static_cast(entry_0.referenceCount); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_referenceCountClassName.c_str(), newElement_0_referenceCountCtorSignature.c_str(), + jninewElement_0_referenceCount, newElement_0_referenceCount); + + { + jclass snapshotStreamStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct", + snapshotStreamStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct"); + return nullptr; + } + + jmethodID snapshotStreamStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotStreamStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Lchip/devicecontroller/" + "ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct;Ljava/lang/Integer;Ljava/lang/Integer;)V", + &snapshotStreamStructStructCtor_1); + if (err != CHIP_NO_ERROR || snapshotStreamStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterSnapshotStreamStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(snapshotStreamStructStructClass_1, snapshotStreamStructStructCtor_1, + newElement_0_snapshotStreamID, newElement_0_imageCodec, newElement_0_frameRate, + newElement_0_bitRate, newElement_0_minResolution, newElement_0_maxResolution, + newElement_0_quality, newElement_0_referenceCount); + } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + using TypeInfo = Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::SoftRecordingPrivacyModeEnabled::Id: { + using TypeInfo = Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SoftLivestreamPrivacyModeEnabled::Id: { + using TypeInfo = Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::HardPrivacyModeOn::Id: { + using TypeInfo = Attributes::HardPrivacyModeOn::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::NightVision::Id: { + using TypeInfo = Attributes::NightVision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::NightVisionIllum::Id: { + using TypeInfo = Attributes::NightVisionIllum::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::AWBEnabled::Id: { + using TypeInfo = Attributes::AWBEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::AutoShutterSpeedEnabled::Id: { + using TypeInfo = Attributes::AutoShutterSpeedEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::AutoISOEnabled::Id: { + using TypeInfo = Attributes::AutoISOEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::Viewport::Id: { + using TypeInfo = Attributes::Viewport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_x1; + std::string value_x1ClassName = "java/lang/Integer"; + std::string value_x1CtorSignature = "(I)V"; + jint jnivalue_x1 = static_cast(cppValue.x1); + chip::JniReferences::GetInstance().CreateBoxedObject(value_x1ClassName.c_str(), value_x1CtorSignature.c_str(), + jnivalue_x1, value_x1); + jobject value_y1; + std::string value_y1ClassName = "java/lang/Integer"; + std::string value_y1CtorSignature = "(I)V"; + jint jnivalue_y1 = static_cast(cppValue.y1); + chip::JniReferences::GetInstance().CreateBoxedObject(value_y1ClassName.c_str(), value_y1CtorSignature.c_str(), + jnivalue_y1, value_y1); + jobject value_x2; + std::string value_x2ClassName = "java/lang/Integer"; + std::string value_x2CtorSignature = "(I)V"; + jint jnivalue_x2 = static_cast(cppValue.x2); + chip::JniReferences::GetInstance().CreateBoxedObject(value_x2ClassName.c_str(), value_x2CtorSignature.c_str(), + jnivalue_x2, value_x2); + jobject value_y2; + std::string value_y2ClassName = "java/lang/Integer"; + std::string value_y2CtorSignature = "(I)V"; + jint jnivalue_y2 = static_cast(cppValue.y2); + chip::JniReferences::GetInstance().CreateBoxedObject(value_y2ClassName.c_str(), value_y2CtorSignature.c_str(), + jnivalue_y2, value_y2); + + { + jclass viewportStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterViewportStruct", + viewportStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterViewportStruct"); + return nullptr; + } + + jmethodID viewportStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, viewportStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V", &viewportStructStructCtor_0); + if (err != CHIP_NO_ERROR || viewportStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$CameraAvStreamManagementClusterViewportStruct constructor"); + return nullptr; + } + + value = + env->NewObject(viewportStructStructClass_0, viewportStructStructCtor_0, value_x1, value_y1, value_x2, value_y2); + } + return value; + } + case Attributes::SpeakerMuted::Id: { + using TypeInfo = Attributes::SpeakerMuted::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::SpeakerVolumeLevel::Id: { + using TypeInfo = Attributes::SpeakerVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::SpeakerMaxLevel::Id: { + using TypeInfo = Attributes::SpeakerMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::SpeakerMinLevel::Id: { + using TypeInfo = Attributes::SpeakerMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MicrophoneMuted::Id: { + using TypeInfo = Attributes::MicrophoneMuted::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::MicrophoneVolumeLevel::Id: { + using TypeInfo = Attributes::MicrophoneVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MicrophoneMaxLevel::Id: { + using TypeInfo = Attributes::MicrophoneMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MicrophoneMinLevel::Id: { + using TypeInfo = Attributes::MicrophoneMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::MicrophoneAGCEnabled::Id: { + using TypeInfo = Attributes::MicrophoneAGCEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ImageRotation::Id: { + using TypeInfo = Attributes::ImageRotation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::ImageFlipHorizontal::Id: { + using TypeInfo = Attributes::ImageFlipHorizontal::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ImageFlipVertical::Id: { + using TypeInfo = Attributes::ImageFlipVertical::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::StatusLightEnabled::Id: { + using TypeInfo = Attributes::StatusLightEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::StatusLightBrightness::Id: { + using TypeInfo = Attributes::StatusLightBrightness::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::DepthSensorStatus::Id: { + using TypeInfo = Attributes::DepthSensorStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -42303,31 +44941,289 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), jninewElement_0_metadataOptions, newElement_0_metadataOptions); - jclass webRTCSessionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct", - webRTCSessionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct"); - return nullptr; + jclass webRTCSessionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct", + webRTCSessionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct"); + return nullptr; + } + + jmethodID webRTCSessionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, webRTCSessionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &webRTCSessionStructStructCtor_1); + if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, + newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, + newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); } + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - jmethodID webRTCSessionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, webRTCSessionStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" - "Integer;Ljava/lang/Integer;)V", - &webRTCSessionStructStructCtor_1); - if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::WebRTCTransportRequestor::Id: { + using namespace app::Clusters::WebRTCTransportRequestor; + switch (aPath.mAttributeId) + { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_id; + std::string newElement_0_idClassName = "java/lang/Integer"; + std::string newElement_0_idCtorSignature = "(I)V"; + jint jninewElement_0_id = static_cast(entry_0.id); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_idClassName.c_str(), newElement_0_idCtorSignature.c_str(), jninewElement_0_id, newElement_0_id); + jobject newElement_0_peerNodeID; + std::string newElement_0_peerNodeIDClassName = "java/lang/Long"; + std::string newElement_0_peerNodeIDCtorSignature = "(J)V"; + jlong jninewElement_0_peerNodeID = static_cast(entry_0.peerNodeID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_peerNodeIDClassName.c_str(), + newElement_0_peerNodeIDCtorSignature.c_str(), + jninewElement_0_peerNodeID, newElement_0_peerNodeID); + jobject newElement_0_peerFabricIndex; + std::string newElement_0_peerFabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_peerFabricIndexCtorSignature = "(I)V"; + jint jninewElement_0_peerFabricIndex = static_cast(entry_0.peerFabricIndex); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_peerFabricIndexClassName.c_str(), newElement_0_peerFabricIndexCtorSignature.c_str(), + jninewElement_0_peerFabricIndex, newElement_0_peerFabricIndex); + jobject newElement_0_streamType; + std::string newElement_0_streamTypeClassName = "java/lang/Integer"; + std::string newElement_0_streamTypeCtorSignature = "(I)V"; + jint jninewElement_0_streamType = static_cast(entry_0.streamType); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_streamTypeClassName.c_str(), + newElement_0_streamTypeCtorSignature.c_str(), + jninewElement_0_streamType, newElement_0_streamType); + jobject newElement_0_videoStreamID; + if (entry_0.videoStreamID.IsNull()) { - ChipLogError(Zcl, "Could not find ChipStructs$WebRTCTransportProviderClusterWebRTCSessionStruct constructor"); - return nullptr; + newElement_0_videoStreamID = nullptr; + } + else + { + std::string newElement_0_videoStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_videoStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_videoStreamID = static_cast(entry_0.videoStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_videoStreamIDClassName.c_str(), newElement_0_videoStreamIDCtorSignature.c_str(), + jninewElement_0_videoStreamID, newElement_0_videoStreamID); + } + jobject newElement_0_audioStreamID; + if (entry_0.audioStreamID.IsNull()) + { + newElement_0_audioStreamID = nullptr; + } + else + { + std::string newElement_0_audioStreamIDClassName = "java/lang/Integer"; + std::string newElement_0_audioStreamIDCtorSignature = "(I)V"; + jint jninewElement_0_audioStreamID = static_cast(entry_0.audioStreamID.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_audioStreamIDClassName.c_str(), newElement_0_audioStreamIDCtorSignature.c_str(), + jninewElement_0_audioStreamID, newElement_0_audioStreamID); } + jobject newElement_0_metadataOptions; + std::string newElement_0_metadataOptionsClassName = "java/lang/Integer"; + std::string newElement_0_metadataOptionsCtorSignature = "(I)V"; + jint jninewElement_0_metadataOptions = static_cast(entry_0.metadataOptions.Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_metadataOptionsClassName.c_str(), newElement_0_metadataOptionsCtorSignature.c_str(), + jninewElement_0_metadataOptions, newElement_0_metadataOptions); + + { + jclass webRTCSessionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct", + webRTCSessionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct"); + return nullptr; + } + + jmethodID webRTCSessionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, webRTCSessionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/" + "Integer;Ljava/lang/Integer;)V", + &webRTCSessionStructStructCtor_1); + if (err != CHIP_NO_ERROR || webRTCSessionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WebRTCTransportRequestorClusterWebRTCSessionStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, - newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, - newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + newElement_0 = + env->NewObject(webRTCSessionStructStructClass_1, webRTCSessionStructStructCtor_1, newElement_0_id, + newElement_0_peerNodeID, newElement_0_peerFabricIndex, newElement_0_streamType, + newElement_0_videoStreamID, newElement_0_audioStreamID, newElement_0_metadataOptions); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42500,27 +45396,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass chimeSoundStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct"); - return nullptr; - } + jclass chimeSoundStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct"); + return nullptr; + } - jmethodID chimeSoundStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &chimeSoundStructStructCtor_1); - if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor"); - return nullptr; - } + jmethodID chimeSoundStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &chimeSoundStructStructCtor_1); + if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeID, - newElement_0_name); + newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeID, + newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42783,28 +45681,30 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_2_revisionCtorSignature.c_str(), jninewElement_2_revision, newElement_2_revision); - jclass deviceTypeStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterDeviceTypeStruct", - deviceTypeStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterDeviceTypeStruct"); - return nullptr; - } + jclass deviceTypeStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterDeviceTypeStruct", + deviceTypeStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterDeviceTypeStruct"); + return nullptr; + } - jmethodID deviceTypeStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_3, "", - "(Ljava/lang/Long;Ljava/lang/Integer;)V", - &deviceTypeStructStructCtor_3); - if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterDeviceTypeStruct constructor"); - return nullptr; - } + jmethodID deviceTypeStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, deviceTypeStructStructClass_3, "", + "(Ljava/lang/Long;Ljava/lang/Integer;)V", + &deviceTypeStructStructCtor_3); + if (err != CHIP_NO_ERROR || deviceTypeStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterDeviceTypeStruct constructor"); + return nullptr; + } - newElement_2 = env->NewObject(deviceTypeStructStructClass_3, deviceTypeStructStructCtor_3, - newElement_2_deviceType, newElement_2_revision); + newElement_2 = env->NewObject(deviceTypeStructStructClass_3, deviceTypeStructStructCtor_3, + newElement_2_deviceType, newElement_2_revision); + } chip::JniReferences::GetInstance().AddToList(newElement_0_deviceTypes, newElement_2); } jobject newElement_0_uniqueLocationIDs; @@ -42834,33 +45734,36 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass ecosystemDeviceStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct", - ecosystemDeviceStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct"); - return nullptr; - } + jclass ecosystemDeviceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct", + ecosystemDeviceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct"); + return nullptr; + } - jmethodID ecosystemDeviceStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, ecosystemDeviceStructStructClass_1, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/" - "util/ArrayList;Ljava/lang/Long;Ljava/lang/Integer;)V", - &ecosystemDeviceStructStructCtor_1); - if (err != CHIP_NO_ERROR || ecosystemDeviceStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct constructor"); - return nullptr; - } + jmethodID ecosystemDeviceStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, ecosystemDeviceStructStructClass_1, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/" + "util/ArrayList;Ljava/lang/Long;Ljava/lang/Integer;)V", + &ecosystemDeviceStructStructCtor_1); + if (err != CHIP_NO_ERROR || ecosystemDeviceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterEcosystemDeviceStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(ecosystemDeviceStructStructClass_1, ecosystemDeviceStructStructCtor_1, newElement_0_deviceName, - newElement_0_deviceNameLastEdit, newElement_0_bridgedEndpoint, newElement_0_originalEndpoint, - newElement_0_deviceTypes, newElement_0_uniqueLocationIDs, newElement_0_uniqueLocationIDsLastEdit, - newElement_0_fabricIndex); + newElement_0 = + env->NewObject(ecosystemDeviceStructStructClass_1, ecosystemDeviceStructStructCtor_1, + newElement_0_deviceName, newElement_0_deviceNameLastEdit, newElement_0_bridgedEndpoint, + newElement_0_originalEndpoint, newElement_0_deviceTypes, newElement_0_uniqueLocationIDs, + newElement_0_uniqueLocationIDsLastEdit, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -42921,30 +45824,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_locationDescriptor_areaType); } - jclass locationDescriptorStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterLocationDescriptorStruct", - locationDescriptorStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterLocationDescriptorStruct"); - return nullptr; - } + jclass locationDescriptorStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterLocationDescriptorStruct", + locationDescriptorStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterLocationDescriptorStruct"); + return nullptr; + } - jmethodID locationDescriptorStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, locationDescriptorStructStructClass_2, "", - "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", - &locationDescriptorStructStructCtor_2); - if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterLocationDescriptorStruct constructor"); - return nullptr; - } + jmethodID locationDescriptorStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, locationDescriptorStructStructClass_2, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_2); + if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterLocationDescriptorStruct constructor"); + return nullptr; + } - newElement_0_locationDescriptor = - env->NewObject(locationDescriptorStructStructClass_2, locationDescriptorStructStructCtor_2, - newElement_0_locationDescriptor_locationName, newElement_0_locationDescriptor_floorNumber, - newElement_0_locationDescriptor_areaType); + newElement_0_locationDescriptor = + env->NewObject(locationDescriptorStructStructClass_2, locationDescriptorStructStructCtor_2, + newElement_0_locationDescriptor_locationName, newElement_0_locationDescriptor_floorNumber, + newElement_0_locationDescriptor_areaType); + } jobject newElement_0_locationDescriptorLastEdit; std::string newElement_0_locationDescriptorLastEditClassName = "java/lang/Long"; std::string newElement_0_locationDescriptorLastEditCtorSignature = "(J)V"; @@ -42961,31 +45867,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass ecosystemLocationStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemLocationStruct", - ecosystemLocationStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemLocationStruct"); - return nullptr; - } + jclass ecosystemLocationStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$EcosystemInformationClusterEcosystemLocationStruct", + ecosystemLocationStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$EcosystemInformationClusterEcosystemLocationStruct"); + return nullptr; + } - jmethodID ecosystemLocationStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, ecosystemLocationStructStructClass_1, "", - "(Ljava/lang/String;Lchip/devicecontroller/" - "ChipStructs$EcosystemInformationClusterLocationDescriptorStruct;Ljava/lang/Long;Ljava/lang/Integer;)V", - &ecosystemLocationStructStructCtor_1); - if (err != CHIP_NO_ERROR || ecosystemLocationStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$EcosystemInformationClusterEcosystemLocationStruct constructor"); - return nullptr; - } + jmethodID ecosystemLocationStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, ecosystemLocationStructStructClass_1, "", + "(Ljava/lang/String;Lchip/devicecontroller/" + "ChipStructs$EcosystemInformationClusterLocationDescriptorStruct;Ljava/lang/Long;Ljava/lang/Integer;)V", + &ecosystemLocationStructStructCtor_1); + if (err != CHIP_NO_ERROR || ecosystemLocationStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$EcosystemInformationClusterEcosystemLocationStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(ecosystemLocationStructStructClass_1, ecosystemLocationStructStructCtor_1, - newElement_0_uniqueLocationID, newElement_0_locationDescriptor, - newElement_0_locationDescriptorLastEdit, newElement_0_fabricIndex); + newElement_0 = env->NewObject(ecosystemLocationStructStructClass_1, ecosystemLocationStructStructCtor_1, + newElement_0_uniqueLocationID, newElement_0_locationDescriptor, + newElement_0_locationDescriptorLastEdit, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -43783,27 +46692,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR reinterpret_cast(entry_0.member2.data())); newElement_0_member2 = newElement_0_member2ByteArray; - jclass testListStructOctetStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestListStructOctet", - testListStructOctetStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestListStructOctet"); - return nullptr; - } + jclass testListStructOctetStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestListStructOctet", + testListStructOctetStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestListStructOctet"); + return nullptr; + } - jmethodID testListStructOctetStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, testListStructOctetStructClass_1, "", - "(Ljava/lang/Long;[B)V", &testListStructOctetStructCtor_1); - if (err != CHIP_NO_ERROR || testListStructOctetStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestListStructOctet constructor"); - return nullptr; - } + jmethodID testListStructOctetStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, testListStructOctetStructClass_1, "", + "(Ljava/lang/Long;[B)V", &testListStructOctetStructCtor_1); + if (err != CHIP_NO_ERROR || testListStructOctetStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestListStructOctet constructor"); + return nullptr; + } - newElement_0 = env->NewObject(testListStructOctetStructClass_1, testListStructOctetStructCtor_1, - newElement_0_member1, newElement_0_member2); + newElement_0 = env->NewObject(testListStructOctetStructClass_1, testListStructOctetStructCtor_1, + newElement_0_member1, newElement_0_member2); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -44091,32 +47002,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableStruct_i); } - jclass simpleStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_3); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_3); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_nullableStruct = - env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a, - newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d, - newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g, - newElement_0_nullableStruct_h, newElement_0_nullableStruct_i); + newElement_0_nullableStruct = env->NewObject( + simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a, + newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d, + newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g, + newElement_0_nullableStruct_h, newElement_0_nullableStruct_i); + } } jobject newElement_0_optionalStruct; if (!entry_0.optionalStruct.HasValue()) @@ -44206,33 +47119,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_optionalStructInsideOptional_i); } - jclass simpleStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_3); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_3); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_optionalStructInsideOptional = env->NewObject( - simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a, - newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c, - newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e, - newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g, - newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i); + newElement_0_optionalStructInsideOptional = env->NewObject( + simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a, + newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c, + newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e, + newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g, + newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i); + } chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional, newElement_0_optionalStruct); } @@ -44346,38 +47261,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalStructInsideOptional_i); } - jclass simpleStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_4); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_4, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" - "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_4); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_4, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_4); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_nullableOptionalStructInsideOptional = - env->NewObject(simpleStructStructClass_4, simpleStructStructCtor_4, - newElement_0_nullableOptionalStructInsideOptional_a, - newElement_0_nullableOptionalStructInsideOptional_b, - newElement_0_nullableOptionalStructInsideOptional_c, - newElement_0_nullableOptionalStructInsideOptional_d, - newElement_0_nullableOptionalStructInsideOptional_e, - newElement_0_nullableOptionalStructInsideOptional_f, - newElement_0_nullableOptionalStructInsideOptional_g, - newElement_0_nullableOptionalStructInsideOptional_h, - newElement_0_nullableOptionalStructInsideOptional_i); + newElement_0_nullableOptionalStructInsideOptional = + env->NewObject(simpleStructStructClass_4, simpleStructStructCtor_4, + newElement_0_nullableOptionalStructInsideOptional_a, + newElement_0_nullableOptionalStructInsideOptional_b, + newElement_0_nullableOptionalStructInsideOptional_c, + newElement_0_nullableOptionalStructInsideOptional_d, + newElement_0_nullableOptionalStructInsideOptional_e, + newElement_0_nullableOptionalStructInsideOptional_f, + newElement_0_nullableOptionalStructInsideOptional_g, + newElement_0_nullableOptionalStructInsideOptional_h, + newElement_0_nullableOptionalStructInsideOptional_i); + } } chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStructInsideOptional, newElement_0_nullableOptionalStruct); @@ -44464,35 +47381,37 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalList); } - jclass nullablesAndOptionalsStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct", - nullablesAndOptionalsStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct"); - return nullptr; - } + jclass nullablesAndOptionalsStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct", + nullablesAndOptionalsStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct"); + return nullptr; + } - jmethodID nullablesAndOptionalsStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, nullablesAndOptionalsStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/util/" - "Optional;Lchip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/util/Optional;)V", - &nullablesAndOptionalsStructStructCtor_1); - if (err != CHIP_NO_ERROR || nullablesAndOptionalsStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct constructor"); - return nullptr; - } + jmethodID nullablesAndOptionalsStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, nullablesAndOptionalsStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/lang/String;Ljava/util/Optional;Ljava/" + "util/Optional;Lchip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/util/Optional;)V", + &nullablesAndOptionalsStructStructCtor_1); + if (err != CHIP_NO_ERROR || nullablesAndOptionalsStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterNullablesAndOptionalsStruct constructor"); + return nullptr; + } - newElement_0 = - env->NewObject(nullablesAndOptionalsStructStructClass_1, nullablesAndOptionalsStructStructCtor_1, - newElement_0_nullableInt, newElement_0_optionalInt, newElement_0_nullableOptionalInt, - newElement_0_nullableString, newElement_0_optionalString, newElement_0_nullableOptionalString, - newElement_0_nullableStruct, newElement_0_optionalStruct, newElement_0_nullableOptionalStruct, - newElement_0_nullableList, newElement_0_optionalList, newElement_0_nullableOptionalList); + newElement_0 = env->NewObject( + nullablesAndOptionalsStructStructClass_1, nullablesAndOptionalsStructStructCtor_1, newElement_0_nullableInt, + newElement_0_optionalInt, newElement_0_nullableOptionalInt, newElement_0_nullableString, + newElement_0_optionalString, newElement_0_nullableOptionalString, newElement_0_nullableStruct, + newElement_0_optionalStruct, newElement_0_nullableOptionalStruct, newElement_0_nullableList, + newElement_0_optionalList, newElement_0_nullableOptionalList); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -44582,29 +47501,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); } - jclass simpleStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_0); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_0); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, value_e, - value_f, value_g, value_h, value_i); + value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, + value_e, value_f, value_g, value_h, value_i); + } return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -44864,33 +47785,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricSensitiveStruct_i); } - jclass simpleStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_2, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_2); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_2, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_2); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0_fabricSensitiveStruct = - env->NewObject(simpleStructStructClass_2, simpleStructStructCtor_2, newElement_0_fabricSensitiveStruct_a, - newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c, - newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e, - newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g, - newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i); + newElement_0_fabricSensitiveStruct = + env->NewObject(simpleStructStructClass_2, simpleStructStructCtor_2, newElement_0_fabricSensitiveStruct_a, + newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c, + newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e, + newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g, + newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i); + } jobject newElement_0_fabricSensitiveInt8uList; chip::JniReferences::GetInstance().CreateArrayList(newElement_0_fabricSensitiveInt8uList); @@ -44914,32 +47837,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), jninewElement_0_fabricIndex, newElement_0_fabricIndex); - jclass testFabricScopedStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestFabricScoped", testFabricScopedStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestFabricScoped"); - return nullptr; - } + jclass testFabricScopedStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestFabricScoped", testFabricScopedStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestFabricScoped"); + return nullptr; + } - jmethodID testFabricScopedStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, testFabricScopedStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/String;Lchip/" - "devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &testFabricScopedStructCtor_1); - if (err != CHIP_NO_ERROR || testFabricScopedStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestFabricScoped constructor"); - return nullptr; - } + jmethodID testFabricScopedStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, testFabricScopedStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/Integer;Ljava/util/Optional;Ljava/lang/String;Lchip/" + "devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &testFabricScopedStructCtor_1); + if (err != CHIP_NO_ERROR || testFabricScopedStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestFabricScoped constructor"); + return nullptr; + } - newElement_0 = env->NewObject( - testFabricScopedStructClass_1, testFabricScopedStructCtor_1, newElement_0_fabricSensitiveInt8u, - newElement_0_optionalFabricSensitiveInt8u, newElement_0_nullableFabricSensitiveInt8u, - newElement_0_nullableOptionalFabricSensitiveInt8u, newElement_0_fabricSensitiveCharString, - newElement_0_fabricSensitiveStruct, newElement_0_fabricSensitiveInt8uList, newElement_0_fabricIndex); + newElement_0 = env->NewObject( + testFabricScopedStructClass_1, testFabricScopedStructCtor_1, newElement_0_fabricSensitiveInt8u, + newElement_0_optionalFabricSensitiveInt8u, newElement_0_nullableFabricSensitiveInt8u, + newElement_0_nullableOptionalFabricSensitiveInt8u, newElement_0_fabricSensitiveCharString, + newElement_0_fabricSensitiveStruct, newElement_0_fabricSensitiveInt8uList, newElement_0_fabricIndex); + } chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; @@ -45056,27 +47981,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); } - jclass testGlobalStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); - return nullptr; - } + jclass testGlobalStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } - jmethodID testGlobalStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "", - "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", - &testGlobalStructStructCtor_0); - if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); - return nullptr; - } + jmethodID testGlobalStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_0); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } - value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap, - value_myEnum); + value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap, + value_myEnum); + } return value; } case Attributes::Unsupported::Id: { @@ -45841,29 +48768,31 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); } - jclass simpleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_1); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_1); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d, - value_e, value_f, value_g, value_h, value_i); + value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d, + value_e, value_f, value_g, value_h, value_i); + } } return value; } @@ -46052,27 +48981,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); } - jclass testGlobalStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); - return nullptr; - } + jclass testGlobalStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } - jmethodID testGlobalStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "", - "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", - &testGlobalStructStructCtor_1); - if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); - return nullptr; - } + jmethodID testGlobalStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_1); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } - value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap, - value_myEnum); + value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap, + value_myEnum); + } } return value; } diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 9da4b9690e..fdb5c9fb65 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -255,29 +255,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jninewElement_3_deviceType, newElement_3_deviceType); } - jclass accessControlTargetStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", - accessControlTargetStructStructClass_4); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); - return nullptr; - } - - jmethodID accessControlTargetStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlTargetStructStructClass_4, "", - "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); - if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) { - ChipLogError(Zcl, - "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); - return nullptr; + jclass accessControlTargetStructStructClass_4; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlTargetStruct", + accessControlTargetStructStructClass_4); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlTargetStruct"); + return nullptr; + } + + jmethodID accessControlTargetStructStructCtor_4; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlTargetStructStructClass_4, "", + "(Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Long;)V", &accessControlTargetStructStructCtor_4); + if (err != CHIP_NO_ERROR || accessControlTargetStructStructCtor_4 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlTargetStruct constructor"); + return nullptr; + } + + newElement_3 = + env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, + newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); } - - newElement_3 = env->NewObject(accessControlTargetStructStructClass_4, accessControlTargetStructStructCtor_4, - newElement_3_cluster, newElement_3_endpoint, newElement_3_deviceType); chip::JniReferences::GetInstance().AddToList(value_latestValue_targets, newElement_3); } } @@ -289,31 +292,33 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_latestValue_fabricIndexClassName.c_str(), value_latestValue_fabricIndexCtorSignature.c_str(), jnivalue_latestValue_fabricIndex, value_latestValue_fabricIndex); - jclass accessControlEntryStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", - accessControlEntryStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); - return nullptr; - } + jclass accessControlEntryStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlEntryStruct", + accessControlEntryStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlEntryStruct"); + return nullptr; + } - jmethodID accessControlEntryStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, accessControlEntryStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", - &accessControlEntryStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); - return nullptr; - } + jmethodID accessControlEntryStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, accessControlEntryStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/lang/Integer;)V", + &accessControlEntryStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlEntryStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlEntryStruct constructor"); + return nullptr; + } - value_latestValue = - env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, - value_latestValue_privilege, value_latestValue_authMode, value_latestValue_subjects, - value_latestValue_targets, value_latestValue_fabricIndex); + value_latestValue = + env->NewObject(accessControlEntryStructStructClass_1, accessControlEntryStructStructCtor_1, + value_latestValue_privilege, value_latestValue_authMode, value_latestValue_subjects, + value_latestValue_targets, value_latestValue_fabricIndex); + } } jobject value_fabricIndex; @@ -418,29 +423,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_latestValue_fabricIndexClassName.c_str(), value_latestValue_fabricIndexCtorSignature.c_str(), jnivalue_latestValue_fabricIndex, value_latestValue_fabricIndex); - jclass accessControlExtensionStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", - accessControlExtensionStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); - return nullptr; - } + jclass accessControlExtensionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AccessControlClusterAccessControlExtensionStruct", + accessControlExtensionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AccessControlClusterAccessControlExtensionStruct"); + return nullptr; + } - jmethodID accessControlExtensionStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", - "([BLjava/lang/Integer;)V", - &accessControlExtensionStructStructCtor_1); - if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); - return nullptr; - } + jmethodID accessControlExtensionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, accessControlExtensionStructStructClass_1, "", + "([BLjava/lang/Integer;)V", + &accessControlExtensionStructStructCtor_1); + if (err != CHIP_NO_ERROR || accessControlExtensionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AccessControlClusterAccessControlExtensionStruct constructor"); + return nullptr; + } - value_latestValue = - env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, - value_latestValue_data, value_latestValue_fabricIndex); + value_latestValue = + env->NewObject(accessControlExtensionStructStructClass_1, accessControlExtensionStructStructCtor_1, + value_latestValue_data, value_latestValue_fabricIndex); + } } jobject value_fabricIndex; @@ -2740,29 +2748,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", - errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OvenCavityOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -3573,28 +3583,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -3763,28 +3776,31 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_errorState_errorStateDetails); } - jclass errorStateStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", errorStateStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); - return nullptr; - } + jclass errorStateStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$RvcOperationalStateClusterErrorStateStruct", + errorStateStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$RvcOperationalStateClusterErrorStateStruct"); + return nullptr; + } - jmethodID errorStateStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, errorStateStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", - &errorStateStructStructCtor_0); - if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); - return nullptr; - } + jmethodID errorStateStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, errorStateStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;)V", + &errorStateStructStructCtor_0); + if (err != CHIP_NO_ERROR || errorStateStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$RvcOperationalStateClusterErrorStateStruct constructor"); + return nullptr; + } - value_errorState = - env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, - value_errorState_errorStateLabel, value_errorState_errorStateDetails); + value_errorState = + env->NewObject(errorStateStructStructClass_0, errorStateStructStructCtor_0, value_errorState_errorStateID, + value_errorState_errorStateLabel, value_errorState_errorStateDetails); + } jclass operationalErrorStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -4334,35 +4350,38 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_0_maxSystime); } - jclass measurementRangeStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", - measurementRangeStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); - return nullptr; - } + jclass measurementRangeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct", + measurementRangeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct"); + return nullptr; + } - jmethodID measurementRangeStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, measurementRangeStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" - "Optional;)V", - &measurementRangeStructStructCtor_1); - if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, - "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); - return nullptr; - } + jmethodID measurementRangeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, measurementRangeStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;)V", + &measurementRangeStructStructCtor_1); + if (err != CHIP_NO_ERROR || measurementRangeStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$ElectricalPowerMeasurementClusterMeasurementRangeStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, - newElement_0_measurementType, newElement_0_min, newElement_0_max, - newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, - newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, - newElement_0_minSystime, newElement_0_maxSystime); + newElement_0 = env->NewObject(measurementRangeStructStructClass_1, measurementRangeStructStructCtor_1, + newElement_0_measurementType, newElement_0_min, newElement_0_max, + newElement_0_startTimestamp, newElement_0_endTimestamp, newElement_0_minTimestamp, + newElement_0_maxTimestamp, newElement_0_startSystime, newElement_0_endSystime, + newElement_0_minSystime, newElement_0_maxSystime); + } chip::JniReferences::GetInstance().AddToList(value_ranges, newElement_0); } @@ -4507,33 +4526,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyImportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyImportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, - value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, - value_energyImportedInsideOptional_endSystime); + value_energyImportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, + value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, + value_energyImportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyImportedInsideOptional, value_energyImported); } @@ -4635,33 +4658,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyExportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyExportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, - value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, - value_energyExportedInsideOptional_endSystime); + value_energyExportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, + value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, + value_energyExportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyExportedInsideOptional, value_energyExported); } @@ -4798,33 +4825,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyImportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyImportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, - value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, - value_energyImportedInsideOptional_endSystime); + value_energyImportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyImportedInsideOptional_energy, value_energyImportedInsideOptional_startTimestamp, + value_energyImportedInsideOptional_endTimestamp, value_energyImportedInsideOptional_startSystime, + value_energyImportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyImportedInsideOptional, value_energyImported); } @@ -4926,33 +4957,37 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_energyExportedInsideOptional_endSystime); } - jclass energyMeasurementStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", - energyMeasurementStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); - return nullptr; - } + jclass energyMeasurementStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct", + energyMeasurementStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct"); + return nullptr; + } - jmethodID energyMeasurementStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, energyMeasurementStructStructClass_1, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &energyMeasurementStructStructCtor_1); - if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); - return nullptr; - } + jmethodID energyMeasurementStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, energyMeasurementStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &energyMeasurementStructStructCtor_1); + if (err != CHIP_NO_ERROR || energyMeasurementStructStructCtor_1 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$ElectricalEnergyMeasurementClusterEnergyMeasurementStruct constructor"); + return nullptr; + } - value_energyExportedInsideOptional = - env->NewObject(energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, - value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, - value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, - value_energyExportedInsideOptional_endSystime); + value_energyExportedInsideOptional = env->NewObject( + energyMeasurementStructStructClass_1, energyMeasurementStructStructCtor_1, + value_energyExportedInsideOptional_energy, value_energyExportedInsideOptional_startTimestamp, + value_energyExportedInsideOptional_endTimestamp, value_energyExportedInsideOptional_startSystime, + value_energyExportedInsideOptional_endSystime); + } chip::JniReferences::GetInstance().CreateOptional(value_energyExportedInsideOptional, value_energyExported); } @@ -5102,31 +5137,35 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_boostInfo_targetReheat); } - jclass waterHeaterBoostInfoStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct", - waterHeaterBoostInfoStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct"); - return nullptr; - } + jclass waterHeaterBoostInfoStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct", + waterHeaterBoostInfoStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct"); + return nullptr; + } - jmethodID waterHeaterBoostInfoStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, waterHeaterBoostInfoStructStructClass_0, "", - "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/" - "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &waterHeaterBoostInfoStructStructCtor_0); - if (err != CHIP_NO_ERROR || waterHeaterBoostInfoStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct constructor"); - return nullptr; - } + jmethodID waterHeaterBoostInfoStructStructCtor_0; + err = + chip::JniReferences::GetInstance().FindMethod(env, waterHeaterBoostInfoStructStructClass_0, "", + "(Ljava/lang/Long;Ljava/util/Optional;Ljava/util/Optional;Ljava/" + "util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &waterHeaterBoostInfoStructStructCtor_0); + if (err != CHIP_NO_ERROR || waterHeaterBoostInfoStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$WaterHeaterManagementClusterWaterHeaterBoostInfoStruct constructor"); + return nullptr; + } - value_boostInfo = - env->NewObject(waterHeaterBoostInfoStructStructClass_0, waterHeaterBoostInfoStructStructCtor_0, - value_boostInfo_duration, value_boostInfo_oneShot, value_boostInfo_emergencyBoost, - value_boostInfo_temporarySetpoint, value_boostInfo_targetPercentage, value_boostInfo_targetReheat); + value_boostInfo = env->NewObject(waterHeaterBoostInfoStructStructClass_0, waterHeaterBoostInfoStructStructCtor_0, + value_boostInfo_duration, value_boostInfo_oneShot, value_boostInfo_emergencyBoost, + value_boostInfo_temporarySetpoint, value_boostInfo_targetPercentage, + value_boostInfo_targetReheat); + } jclass boostStartedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -5380,35 +5419,38 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_temperatureControlInsideOptional_heatingTempSetpoint); } - jclass temperatureControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", - temperatureControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); - return nullptr; - } + jclass temperatureControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct", + temperatureControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct"); + return nullptr; + } - jmethodID temperatureControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod( - env, temperatureControlStructStructClass_2, "", - "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", - &temperatureControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); - return nullptr; - } + jmethodID temperatureControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod( + env, temperatureControlStructStructClass_2, "", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &temperatureControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || temperatureControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterTemperatureControlStruct constructor"); + return nullptr; + } - value_temperatureControlInsideOptional = - env->NewObject(temperatureControlStructStructClass_2, temperatureControlStructStructCtor_2, - value_temperatureControlInsideOptional_coolingTempOffset, - value_temperatureControlInsideOptional_heatingtTempOffset, - value_temperatureControlInsideOptional_coolingTempSetpoint, - value_temperatureControlInsideOptional_heatingTempSetpoint); + value_temperatureControlInsideOptional = + env->NewObject(temperatureControlStructStructClass_2, temperatureControlStructStructCtor_2, + value_temperatureControlInsideOptional_coolingTempOffset, + value_temperatureControlInsideOptional_heatingtTempOffset, + value_temperatureControlInsideOptional_coolingTempSetpoint, + value_temperatureControlInsideOptional_heatingTempSetpoint); + } } chip::JniReferences::GetInstance().CreateOptional(value_temperatureControlInsideOptional, value_temperatureControl); } @@ -5438,31 +5480,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_averageLoadControlInsideOptional_loadAdjustment, value_averageLoadControlInsideOptional_loadAdjustment); - jclass averageLoadControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", - averageLoadControlStructStructClass_2); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); - return nullptr; - } - - jmethodID averageLoadControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &averageLoadControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_2 == nullptr) { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); - return nullptr; - } + jclass averageLoadControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct", + averageLoadControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct"); + return nullptr; + } - value_averageLoadControlInsideOptional = - env->NewObject(averageLoadControlStructStructClass_2, averageLoadControlStructStructCtor_2, - value_averageLoadControlInsideOptional_loadAdjustment); + jmethodID averageLoadControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, averageLoadControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &averageLoadControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || averageLoadControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterAverageLoadControlStruct constructor"); + return nullptr; + } + + value_averageLoadControlInsideOptional = + env->NewObject(averageLoadControlStructStructClass_2, averageLoadControlStructStructCtor_2, + value_averageLoadControlInsideOptional_loadAdjustment); + } } chip::JniReferences::GetInstance().CreateOptional(value_averageLoadControlInsideOptional, value_averageLoadControl); } @@ -5491,31 +5536,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & value_dutyCycleControlInsideOptional_dutyCycleCtorSignature.c_str(), jnivalue_dutyCycleControlInsideOptional_dutyCycle, value_dutyCycleControlInsideOptional_dutyCycle); - jclass dutyCycleControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", - dutyCycleControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); - return nullptr; - } + jclass dutyCycleControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct", + dutyCycleControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct"); + return nullptr; + } - jmethodID dutyCycleControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &dutyCycleControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); - return nullptr; - } + jmethodID dutyCycleControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, dutyCycleControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &dutyCycleControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || dutyCycleControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterDutyCycleControlStruct constructor"); + return nullptr; + } - value_dutyCycleControlInsideOptional = - env->NewObject(dutyCycleControlStructStructClass_2, dutyCycleControlStructStructCtor_2, - value_dutyCycleControlInsideOptional_dutyCycle); + value_dutyCycleControlInsideOptional = + env->NewObject(dutyCycleControlStructStructClass_2, dutyCycleControlStructStructCtor_2, + value_dutyCycleControlInsideOptional_dutyCycle); + } } chip::JniReferences::GetInstance().CreateOptional(value_dutyCycleControlInsideOptional, value_dutyCycleControl); } @@ -5545,32 +5593,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_powerSavingsControlInsideOptional_powerSavings, value_powerSavingsControlInsideOptional_powerSavings); - jclass powerSavingsControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", - powerSavingsControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); - return nullptr; - } + jclass powerSavingsControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct", + powerSavingsControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct"); + return nullptr; + } - jmethodID powerSavingsControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &powerSavingsControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); - return nullptr; - } + jmethodID powerSavingsControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, powerSavingsControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &powerSavingsControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || powerSavingsControlStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterPowerSavingsControlStruct constructor"); + return nullptr; + } - value_powerSavingsControlInsideOptional = - env->NewObject(powerSavingsControlStructStructClass_2, powerSavingsControlStructStructCtor_2, - value_powerSavingsControlInsideOptional_powerSavings); + value_powerSavingsControlInsideOptional = + env->NewObject(powerSavingsControlStructStructClass_2, powerSavingsControlStructStructCtor_2, + value_powerSavingsControlInsideOptional_powerSavings); + } } chip::JniReferences::GetInstance().CreateOptional(value_powerSavingsControlInsideOptional, value_powerSavingsControl); @@ -5601,32 +5651,34 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_heatingSourceControlInsideOptional_heatingSource, value_heatingSourceControlInsideOptional_heatingSource); - jclass heatingSourceControlStructStructClass_2; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", - heatingSourceControlStructStructClass_2); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); - return nullptr; - } + jclass heatingSourceControlStructStructClass_2; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct", + heatingSourceControlStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct"); + return nullptr; + } - jmethodID heatingSourceControlStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_2, "", - "(Ljava/lang/Integer;)V", - &heatingSourceControlStructStructCtor_2); - if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_2 == nullptr) - { - ChipLogError( - Zcl, - "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct constructor"); - return nullptr; - } + jmethodID heatingSourceControlStructStructCtor_2; + err = chip::JniReferences::GetInstance().FindMethod(env, heatingSourceControlStructStructClass_2, "", + "(Ljava/lang/Integer;)V", + &heatingSourceControlStructStructCtor_2); + if (err != CHIP_NO_ERROR || heatingSourceControlStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$DemandResponseLoadControlClusterHeatingSourceControlStruct " + "constructor"); + return nullptr; + } - value_heatingSourceControlInsideOptional = - env->NewObject(heatingSourceControlStructStructClass_2, heatingSourceControlStructStructCtor_2, - value_heatingSourceControlInsideOptional_heatingSource); + value_heatingSourceControlInsideOptional = + env->NewObject(heatingSourceControlStructStructClass_2, heatingSourceControlStructStructCtor_2, + value_heatingSourceControlInsideOptional_heatingSource); + } } chip::JniReferences::GetInstance().CreateOptional(value_heatingSourceControlInsideOptional, value_heatingSourceControl); @@ -6614,28 +6666,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_2_credentialIndexClassName.c_str(), newElement_2_credentialIndexCtorSignature.c_str(), jninewElement_2_credentialIndex, newElement_2_credentialIndex); - jclass credentialStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", - credentialStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); - return nullptr; - } - - jmethodID credentialStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &credentialStructStructCtor_3); - if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); - return nullptr; + jclass credentialStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", + credentialStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); + return nullptr; + } + + jmethodID credentialStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &credentialStructStructCtor_3); + if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, + newElement_2_credentialType, newElement_2_credentialIndex); } - - newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, - newElement_2_credentialType, newElement_2_credentialIndex); chip::JniReferences::GetInstance().AddToList(value_credentialsInsideOptional, newElement_2); } } @@ -6779,28 +6833,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & newElement_2_credentialIndexClassName.c_str(), newElement_2_credentialIndexCtorSignature.c_str(), jninewElement_2_credentialIndex, newElement_2_credentialIndex); - jclass credentialStructStructClass_3; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", - credentialStructStructClass_3); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); - return nullptr; - } - - jmethodID credentialStructStructCtor_3; - err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;)V", - &credentialStructStructCtor_3); - if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); - return nullptr; + jclass credentialStructStructClass_3; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$DoorLockClusterCredentialStruct", + credentialStructStructClass_3); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$DoorLockClusterCredentialStruct"); + return nullptr; + } + + jmethodID credentialStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod(env, credentialStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &credentialStructStructCtor_3); + if (err != CHIP_NO_ERROR || credentialStructStructCtor_3 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$DoorLockClusterCredentialStruct constructor"); + return nullptr; + } + + newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, + newElement_2_credentialType, newElement_2_credentialIndex); } - - newElement_2 = env->NewObject(credentialStructStructClass_3, credentialStructStructCtor_3, - newElement_2_credentialType, newElement_2_credentialIndex); chip::JniReferences::GetInstance().AddToList(value_credentialsInsideOptional, newElement_2); } } @@ -7844,27 +7900,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); - jclass targetInfoStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", targetInfoStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); - return nullptr; - } + jclass targetInfoStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$TargetNavigatorClusterTargetInfoStruct", + targetInfoStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TargetNavigatorClusterTargetInfoStruct"); + return nullptr; + } - jmethodID targetInfoStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/String;)V", - &targetInfoStructStructCtor_1); - if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); - return nullptr; - } + jmethodID targetInfoStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, targetInfoStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &targetInfoStructStructCtor_1); + if (err != CHIP_NO_ERROR || targetInfoStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TargetNavigatorClusterTargetInfoStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, newElement_0_identifier, - newElement_0_name); + newElement_0 = env->NewObject(targetInfoStructStructClass_1, targetInfoStructStructCtor_1, + newElement_0_identifier, newElement_0_name); + } chip::JniReferences::GetInstance().AddToList(value_targetList, newElement_0); } @@ -7967,28 +8026,30 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jnivalue_sampledPosition_position, value_sampledPosition_position); } - jclass playbackPositionStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", - playbackPositionStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); - return nullptr; - } + jclass playbackPositionStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$MediaPlaybackClusterPlaybackPositionStruct", + playbackPositionStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$MediaPlaybackClusterPlaybackPositionStruct"); + return nullptr; + } - jmethodID playbackPositionStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_0, "", - "(Ljava/lang/Long;Ljava/lang/Long;)V", - &playbackPositionStructStructCtor_0); - if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); - return nullptr; - } + jmethodID playbackPositionStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, playbackPositionStructStructClass_0, "", + "(Ljava/lang/Long;Ljava/lang/Long;)V", + &playbackPositionStructStructCtor_0); + if (err != CHIP_NO_ERROR || playbackPositionStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$MediaPlaybackClusterPlaybackPositionStruct constructor"); + return nullptr; + } - value_sampledPosition = env->NewObject(playbackPositionStructStructClass_0, playbackPositionStructStructCtor_0, - value_sampledPosition_updatedAt, value_sampledPosition_position); + value_sampledPosition = env->NewObject(playbackPositionStructStructClass_0, playbackPositionStructStructCtor_0, + value_sampledPosition_updatedAt, value_sampledPosition_position); + } jobject value_playbackSpeed; std::string value_playbackSpeedClassName = "java/lang/Float"; @@ -8248,101 +8309,111 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::WebRTCTransportProvider::Id: { - using namespace app::Clusters::WebRTCTransportProvider; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } - case app::Clusters::Chime::Id: { - using namespace app::Clusters::Chime; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } - case app::Clusters::EcosystemInformation::Id: { - using namespace app::Clusters::EcosystemInformation; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } - case app::Clusters::CommissionerControl::Id: { - using namespace app::Clusters::CommissionerControl; + case app::Clusters::ZoneManagement::Id: { + using namespace app::Clusters::ZoneManagement; switch (aPath.mEventId) { - case Events::CommissioningRequestResult::Id: { - Events::CommissioningRequestResult::DecodableType cppValue; + case Events::ZoneTriggered::Id: { + Events::ZoneTriggered::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nullptr; } - jobject value_requestID; - std::string value_requestIDClassName = "java/lang/Long"; - std::string value_requestIDCtorSignature = "(J)V"; - jlong jnivalue_requestID = static_cast(cppValue.requestID); - chip::JniReferences::GetInstance().CreateBoxedObject( - value_requestIDClassName.c_str(), value_requestIDCtorSignature.c_str(), jnivalue_requestID, value_requestID); + jobject value_zones; + chip::JniReferences::GetInstance().CreateArrayList(value_zones); - jobject value_clientNodeID; - std::string value_clientNodeIDClassName = "java/lang/Long"; - std::string value_clientNodeIDCtorSignature = "(J)V"; - jlong jnivalue_clientNodeID = static_cast(cppValue.clientNodeID); - chip::JniReferences::GetInstance().CreateBoxedObject(value_clientNodeIDClassName.c_str(), - value_clientNodeIDCtorSignature.c_str(), - jnivalue_clientNodeID, value_clientNodeID); + auto iter_value_zones_0 = cppValue.zones.begin(); + while (iter_value_zones_0.Next()) + { + auto & entry_0 = iter_value_zones_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value_zones, newElement_0); + } - jobject value_statusCode; - std::string value_statusCodeClassName = "java/lang/Integer"; - std::string value_statusCodeCtorSignature = "(I)V"; - jint jnivalue_statusCode = static_cast(cppValue.statusCode); + jobject value_reason; + std::string value_reasonClassName = "java/lang/Integer"; + std::string value_reasonCtorSignature = "(I)V"; + jint jnivalue_reason = static_cast(cppValue.reason); chip::JniReferences::GetInstance().CreateBoxedObject( - value_statusCodeClassName.c_str(), value_statusCodeCtorSignature.c_str(), jnivalue_statusCode, value_statusCode); + value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason); - jobject value_fabricIndex; - std::string value_fabricIndexClassName = "java/lang/Integer"; - std::string value_fabricIndexCtorSignature = "(I)V"; - jint jnivalue_fabricIndex = static_cast(cppValue.fabricIndex); - chip::JniReferences::GetInstance().CreateBoxedObject(value_fabricIndexClassName.c_str(), - value_fabricIndexCtorSignature.c_str(), jnivalue_fabricIndex, - value_fabricIndex); + jclass zoneTriggeredStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent", zoneTriggeredStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent"); + return nullptr; + } - jclass commissioningRequestResultStructClass; + jmethodID zoneTriggeredStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, zoneTriggeredStructClass, "", "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", &zoneTriggeredStructCtor); + if (err != CHIP_NO_ERROR || zoneTriggeredStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$ZoneManagementClusterZoneTriggeredEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(zoneTriggeredStructClass, zoneTriggeredStructCtor, value_zones, value_reason); + + return value; + } + case Events::ZoneStopped::Id: { + Events::ZoneStopped::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_zones; + chip::JniReferences::GetInstance().CreateArrayList(value_zones); + + auto iter_value_zones_0 = cppValue.zones.begin(); + while (iter_value_zones_0.Next()) + { + auto & entry_0 = iter_value_zones_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Integer"; + std::string newElement_0CtorSignature = "(I)V"; + jint jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value_zones, newElement_0); + } + + jobject value_reason; + std::string value_reasonClassName = "java/lang/Integer"; + std::string value_reasonCtorSignature = "(I)V"; + jint jnivalue_reason = static_cast(cppValue.reason); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_reasonClassName.c_str(), value_reasonCtorSignature.c_str(), jnivalue_reason, value_reason); + + jclass zoneStoppedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent", - commissioningRequestResultStructClass); + env, "chip/devicecontroller/ChipEventStructs$ZoneManagementClusterZoneStoppedEvent", zoneStoppedStructClass); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent"); + ChipLogError(Zcl, "Could not find class ChipEventStructs$ZoneManagementClusterZoneStoppedEvent"); return nullptr; } - jmethodID commissioningRequestResultStructCtor; + jmethodID zoneStoppedStructCtor; err = chip::JniReferences::GetInstance().FindMethod( - env, commissioningRequestResultStructClass, "", - "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", &commissioningRequestResultStructCtor); - if (err != CHIP_NO_ERROR || commissioningRequestResultStructCtor == nullptr) + env, zoneStoppedStructClass, "", "(Ljava/util/ArrayList;Ljava/lang/Integer;)V", &zoneStoppedStructCtor); + if (err != CHIP_NO_ERROR || zoneStoppedStructCtor == nullptr) { - ChipLogError( - Zcl, "Could not find ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent constructor"); + ChipLogError(Zcl, "Could not find ChipEventStructs$ZoneManagementClusterZoneStoppedEvent constructor"); return nullptr; } - jobject value = env->NewObject(commissioningRequestResultStructClass, commissioningRequestResultStructCtor, - value_requestID, value_clientNodeID, value_statusCode, value_fabricIndex); + jobject value = env->NewObject(zoneStoppedStructClass, zoneStoppedStructCtor, value_zones, value_reason); return value; } @@ -8352,34 +8423,814 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::UnitTesting::Id: { - using namespace app::Clusters::UnitTesting; + case app::Clusters::CameraAvStreamManagement::Id: { + using namespace app::Clusters::CameraAvStreamManagement; switch (aPath.mEventId) { - case Events::TestEvent::Id: { - Events::TestEvent::DecodableType cppValue; + case Events::VideoStreamChanged::Id: { + Events::VideoStreamChanged::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nullptr; } - jobject value_arg1; - std::string value_arg1ClassName = "java/lang/Integer"; - std::string value_arg1CtorSignature = "(I)V"; - jint jnivalue_arg1 = static_cast(cppValue.arg1); - chip::JniReferences::GetInstance().CreateBoxedObject(value_arg1ClassName.c_str(), value_arg1CtorSignature.c_str(), - jnivalue_arg1, value_arg1); + jobject value_videoStreamID; + std::string value_videoStreamIDClassName = "java/lang/Integer"; + std::string value_videoStreamIDCtorSignature = "(I)V"; + jint jnivalue_videoStreamID = static_cast(cppValue.videoStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_videoStreamIDClassName.c_str(), + value_videoStreamIDCtorSignature.c_str(), + jnivalue_videoStreamID, value_videoStreamID); - jobject value_arg2; - std::string value_arg2ClassName = "java/lang/Integer"; - std::string value_arg2CtorSignature = "(I)V"; - jint jnivalue_arg2 = static_cast(cppValue.arg2); - chip::JniReferences::GetInstance().CreateBoxedObject(value_arg2ClassName.c_str(), value_arg2CtorSignature.c_str(), - jnivalue_arg2, value_arg2); + jobject value_streamType; + if (!cppValue.streamType.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_streamType); + } + else + { + jobject value_streamTypeInsideOptional; + std::string value_streamTypeInsideOptionalClassName = "java/lang/Integer"; + std::string value_streamTypeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_streamTypeInsideOptional = static_cast(cppValue.streamType.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_streamTypeInsideOptionalClassName.c_str(), value_streamTypeInsideOptionalCtorSignature.c_str(), + jnivalue_streamTypeInsideOptional, value_streamTypeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_streamTypeInsideOptional, value_streamType); + } - jobject value_arg3; - std::string value_arg3ClassName = "java/lang/Boolean"; - std::string value_arg3CtorSignature = "(Z)V"; + jobject value_videoCodec; + if (!cppValue.videoCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_videoCodec); + } + else + { + jobject value_videoCodecInsideOptional; + std::string value_videoCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_videoCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_videoCodecInsideOptional = static_cast(cppValue.videoCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_videoCodecInsideOptionalClassName.c_str(), value_videoCodecInsideOptionalCtorSignature.c_str(), + jnivalue_videoCodecInsideOptional, value_videoCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_videoCodecInsideOptional, value_videoCodec); + } + + jobject value_minFrameRate; + if (!cppValue.minFrameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minFrameRate); + } + else + { + jobject value_minFrameRateInsideOptional; + std::string value_minFrameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_minFrameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_minFrameRateInsideOptional = static_cast(cppValue.minFrameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minFrameRateInsideOptionalClassName.c_str(), value_minFrameRateInsideOptionalCtorSignature.c_str(), + jnivalue_minFrameRateInsideOptional, value_minFrameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minFrameRateInsideOptional, value_minFrameRate); + } + + jobject value_maxFrameRate; + if (!cppValue.maxFrameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxFrameRate); + } + else + { + jobject value_maxFrameRateInsideOptional; + std::string value_maxFrameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_maxFrameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_maxFrameRateInsideOptional = static_cast(cppValue.maxFrameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFrameRateInsideOptionalClassName.c_str(), value_maxFrameRateInsideOptionalCtorSignature.c_str(), + jnivalue_maxFrameRateInsideOptional, value_maxFrameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxFrameRateInsideOptional, value_maxFrameRate); + } + + jobject value_minResolution; + if (!cppValue.minResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minResolution); + } + else + { + jobject value_minResolutionInsideOptional; + jobject value_minResolutionInsideOptional_width; + std::string value_minResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_width = static_cast(cppValue.minResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_widthClassName.c_str(), + value_minResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_width, + value_minResolutionInsideOptional_width); + jobject value_minResolutionInsideOptional_height; + std::string value_minResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_height = static_cast(cppValue.minResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_heightClassName.c_str(), + value_minResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_height, + value_minResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_minResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_minResolutionInsideOptional_width, value_minResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_minResolutionInsideOptional, value_minResolution); + } + + jobject value_maxResolution; + if (!cppValue.maxResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxResolution); + } + else + { + jobject value_maxResolutionInsideOptional; + jobject value_maxResolutionInsideOptional_width; + std::string value_maxResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_width = static_cast(cppValue.maxResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_widthClassName.c_str(), + value_maxResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_width, + value_maxResolutionInsideOptional_width); + jobject value_maxResolutionInsideOptional_height; + std::string value_maxResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_height = static_cast(cppValue.maxResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_heightClassName.c_str(), + value_maxResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_height, + value_maxResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_maxResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_maxResolutionInsideOptional_width, value_maxResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_maxResolutionInsideOptional, value_maxResolution); + } + + jobject value_minBitRate; + if (!cppValue.minBitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minBitRate); + } + else + { + jobject value_minBitRateInsideOptional; + std::string value_minBitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_minBitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_minBitRateInsideOptional = static_cast(cppValue.minBitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minBitRateInsideOptionalClassName.c_str(), value_minBitRateInsideOptionalCtorSignature.c_str(), + jnivalue_minBitRateInsideOptional, value_minBitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minBitRateInsideOptional, value_minBitRate); + } + + jobject value_maxBitRate; + if (!cppValue.maxBitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxBitRate); + } + else + { + jobject value_maxBitRateInsideOptional; + std::string value_maxBitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_maxBitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_maxBitRateInsideOptional = static_cast(cppValue.maxBitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxBitRateInsideOptionalClassName.c_str(), value_maxBitRateInsideOptionalCtorSignature.c_str(), + jnivalue_maxBitRateInsideOptional, value_maxBitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxBitRateInsideOptional, value_maxBitRate); + } + + jobject value_minFragmentLen; + if (!cppValue.minFragmentLen.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minFragmentLen); + } + else + { + jobject value_minFragmentLenInsideOptional; + std::string value_minFragmentLenInsideOptionalClassName = "java/lang/Integer"; + std::string value_minFragmentLenInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_minFragmentLenInsideOptional = static_cast(cppValue.minFragmentLen.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minFragmentLenInsideOptionalClassName.c_str(), value_minFragmentLenInsideOptionalCtorSignature.c_str(), + jnivalue_minFragmentLenInsideOptional, value_minFragmentLenInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_minFragmentLenInsideOptional, value_minFragmentLen); + } + + jobject value_maxFragmentLen; + if (!cppValue.maxFragmentLen.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxFragmentLen); + } + else + { + jobject value_maxFragmentLenInsideOptional; + std::string value_maxFragmentLenInsideOptionalClassName = "java/lang/Integer"; + std::string value_maxFragmentLenInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_maxFragmentLenInsideOptional = static_cast(cppValue.maxFragmentLen.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxFragmentLenInsideOptionalClassName.c_str(), value_maxFragmentLenInsideOptionalCtorSignature.c_str(), + jnivalue_maxFragmentLenInsideOptional, value_maxFragmentLenInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_maxFragmentLenInsideOptional, value_maxFragmentLen); + } + + jclass videoStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent", + videoStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent"); + return nullptr; + } + + jmethodID videoStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, videoStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", + &videoStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || videoStreamChangedStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$CameraAvStreamManagementClusterVideoStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(videoStreamChangedStructClass, videoStreamChangedStructCtor, value_videoStreamID, value_streamType, + value_videoCodec, value_minFrameRate, value_maxFrameRate, value_minResolution, value_maxResolution, + value_minBitRate, value_maxBitRate, value_minFragmentLen, value_maxFragmentLen); + + return value; + } + case Events::AudioStreamChanged::Id: { + Events::AudioStreamChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_audioStreamID; + std::string value_audioStreamIDClassName = "java/lang/Integer"; + std::string value_audioStreamIDCtorSignature = "(I)V"; + jint jnivalue_audioStreamID = static_cast(cppValue.audioStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_audioStreamIDClassName.c_str(), + value_audioStreamIDCtorSignature.c_str(), + jnivalue_audioStreamID, value_audioStreamID); + + jobject value_streamType; + if (!cppValue.streamType.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_streamType); + } + else + { + jobject value_streamTypeInsideOptional; + std::string value_streamTypeInsideOptionalClassName = "java/lang/Integer"; + std::string value_streamTypeInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_streamTypeInsideOptional = static_cast(cppValue.streamType.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_streamTypeInsideOptionalClassName.c_str(), value_streamTypeInsideOptionalCtorSignature.c_str(), + jnivalue_streamTypeInsideOptional, value_streamTypeInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_streamTypeInsideOptional, value_streamType); + } + + jobject value_audioCodec; + if (!cppValue.audioCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_audioCodec); + } + else + { + jobject value_audioCodecInsideOptional; + std::string value_audioCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_audioCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_audioCodecInsideOptional = static_cast(cppValue.audioCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_audioCodecInsideOptionalClassName.c_str(), value_audioCodecInsideOptionalCtorSignature.c_str(), + jnivalue_audioCodecInsideOptional, value_audioCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_audioCodecInsideOptional, value_audioCodec); + } + + jobject value_channelCount; + if (!cppValue.channelCount.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_channelCount); + } + else + { + jobject value_channelCountInsideOptional; + std::string value_channelCountInsideOptionalClassName = "java/lang/Integer"; + std::string value_channelCountInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_channelCountInsideOptional = static_cast(cppValue.channelCount.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_channelCountInsideOptionalClassName.c_str(), value_channelCountInsideOptionalCtorSignature.c_str(), + jnivalue_channelCountInsideOptional, value_channelCountInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_channelCountInsideOptional, value_channelCount); + } + + jobject value_sampleRate; + if (!cppValue.sampleRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_sampleRate); + } + else + { + jobject value_sampleRateInsideOptional; + std::string value_sampleRateInsideOptionalClassName = "java/lang/Long"; + std::string value_sampleRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_sampleRateInsideOptional = static_cast(cppValue.sampleRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_sampleRateInsideOptionalClassName.c_str(), value_sampleRateInsideOptionalCtorSignature.c_str(), + jnivalue_sampleRateInsideOptional, value_sampleRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_sampleRateInsideOptional, value_sampleRate); + } + + jobject value_bitRate; + if (!cppValue.bitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitRate); + } + else + { + jobject value_bitRateInsideOptional; + std::string value_bitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_bitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_bitRateInsideOptional = static_cast(cppValue.bitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitRateInsideOptionalClassName.c_str(), value_bitRateInsideOptionalCtorSignature.c_str(), + jnivalue_bitRateInsideOptional, value_bitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitRateInsideOptional, value_bitRate); + } + + jobject value_bitDepth; + if (!cppValue.bitDepth.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitDepth); + } + else + { + jobject value_bitDepthInsideOptional; + std::string value_bitDepthInsideOptionalClassName = "java/lang/Integer"; + std::string value_bitDepthInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_bitDepthInsideOptional = static_cast(cppValue.bitDepth.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitDepthInsideOptionalClassName.c_str(), value_bitDepthInsideOptionalCtorSignature.c_str(), + jnivalue_bitDepthInsideOptional, value_bitDepthInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitDepthInsideOptional, value_bitDepth); + } + + jclass audioStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent", + audioStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent"); + return nullptr; + } + + jmethodID audioStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, audioStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &audioStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || audioStreamChangedStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$CameraAvStreamManagementClusterAudioStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = + env->NewObject(audioStreamChangedStructClass, audioStreamChangedStructCtor, value_audioStreamID, value_streamType, + value_audioCodec, value_channelCount, value_sampleRate, value_bitRate, value_bitDepth); + + return value; + } + case Events::SnapshotStreamChanged::Id: { + Events::SnapshotStreamChanged::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_snapshotStreamID; + std::string value_snapshotStreamIDClassName = "java/lang/Integer"; + std::string value_snapshotStreamIDCtorSignature = "(I)V"; + jint jnivalue_snapshotStreamID = static_cast(cppValue.snapshotStreamID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_snapshotStreamIDClassName.c_str(), + value_snapshotStreamIDCtorSignature.c_str(), + jnivalue_snapshotStreamID, value_snapshotStreamID); + + jobject value_imageCodec; + if (!cppValue.imageCodec.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_imageCodec); + } + else + { + jobject value_imageCodecInsideOptional; + std::string value_imageCodecInsideOptionalClassName = "java/lang/Integer"; + std::string value_imageCodecInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_imageCodecInsideOptional = static_cast(cppValue.imageCodec.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_imageCodecInsideOptionalClassName.c_str(), value_imageCodecInsideOptionalCtorSignature.c_str(), + jnivalue_imageCodecInsideOptional, value_imageCodecInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_imageCodecInsideOptional, value_imageCodec); + } + + jobject value_frameRate; + if (!cppValue.frameRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_frameRate); + } + else + { + jobject value_frameRateInsideOptional; + std::string value_frameRateInsideOptionalClassName = "java/lang/Integer"; + std::string value_frameRateInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_frameRateInsideOptional = static_cast(cppValue.frameRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_frameRateInsideOptionalClassName.c_str(), value_frameRateInsideOptionalCtorSignature.c_str(), + jnivalue_frameRateInsideOptional, value_frameRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_frameRateInsideOptional, value_frameRate); + } + + jobject value_bitRate; + if (!cppValue.bitRate.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_bitRate); + } + else + { + jobject value_bitRateInsideOptional; + std::string value_bitRateInsideOptionalClassName = "java/lang/Long"; + std::string value_bitRateInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_bitRateInsideOptional = static_cast(cppValue.bitRate.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_bitRateInsideOptionalClassName.c_str(), value_bitRateInsideOptionalCtorSignature.c_str(), + jnivalue_bitRateInsideOptional, value_bitRateInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_bitRateInsideOptional, value_bitRate); + } + + jobject value_minResolution; + if (!cppValue.minResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_minResolution); + } + else + { + jobject value_minResolutionInsideOptional; + jobject value_minResolutionInsideOptional_width; + std::string value_minResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_width = static_cast(cppValue.minResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_widthClassName.c_str(), + value_minResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_width, + value_minResolutionInsideOptional_width); + jobject value_minResolutionInsideOptional_height; + std::string value_minResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_minResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_minResolutionInsideOptional_height = static_cast(cppValue.minResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_minResolutionInsideOptional_heightClassName.c_str(), + value_minResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_minResolutionInsideOptional_height, + value_minResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_minResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_minResolutionInsideOptional_width, value_minResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_minResolutionInsideOptional, value_minResolution); + } + + jobject value_maxResolution; + if (!cppValue.maxResolution.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_maxResolution); + } + else + { + jobject value_maxResolutionInsideOptional; + jobject value_maxResolutionInsideOptional_width; + std::string value_maxResolutionInsideOptional_widthClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_widthCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_width = static_cast(cppValue.maxResolution.Value().width); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_widthClassName.c_str(), + value_maxResolutionInsideOptional_widthCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_width, + value_maxResolutionInsideOptional_width); + jobject value_maxResolutionInsideOptional_height; + std::string value_maxResolutionInsideOptional_heightClassName = "java/lang/Integer"; + std::string value_maxResolutionInsideOptional_heightCtorSignature = "(I)V"; + jint jnivalue_maxResolutionInsideOptional_height = static_cast(cppValue.maxResolution.Value().height); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_maxResolutionInsideOptional_heightClassName.c_str(), + value_maxResolutionInsideOptional_heightCtorSignature.c_str(), jnivalue_maxResolutionInsideOptional_height, + value_maxResolutionInsideOptional_height); + + { + jclass videoResolutionStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct", + videoResolutionStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct"); + return nullptr; + } + + jmethodID videoResolutionStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, videoResolutionStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;)V", + &videoResolutionStructStructCtor_1); + if (err != CHIP_NO_ERROR || videoResolutionStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$CameraAvStreamManagementClusterVideoResolutionStruct constructor"); + return nullptr; + } + + value_maxResolutionInsideOptional = + env->NewObject(videoResolutionStructStructClass_1, videoResolutionStructStructCtor_1, + value_maxResolutionInsideOptional_width, value_maxResolutionInsideOptional_height); + } + chip::JniReferences::GetInstance().CreateOptional(value_maxResolutionInsideOptional, value_maxResolution); + } + + jobject value_quality; + if (!cppValue.quality.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_quality); + } + else + { + jobject value_qualityInsideOptional; + std::string value_qualityInsideOptionalClassName = "java/lang/Integer"; + std::string value_qualityInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_qualityInsideOptional = static_cast(cppValue.quality.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_qualityInsideOptionalClassName.c_str(), value_qualityInsideOptionalCtorSignature.c_str(), + jnivalue_qualityInsideOptional, value_qualityInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_qualityInsideOptional, value_quality); + } + + jclass snapshotStreamChangedStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent", + snapshotStreamChangedStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent"); + return nullptr; + } + + jmethodID snapshotStreamChangedStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, snapshotStreamChangedStructClass, "", + "(Ljava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/" + "Optional;Ljava/util/Optional;)V", + &snapshotStreamChangedStructCtor); + if (err != CHIP_NO_ERROR || snapshotStreamChangedStructCtor == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipEventStructs$CameraAvStreamManagementClusterSnapshotStreamChangedEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(snapshotStreamChangedStructClass, snapshotStreamChangedStructCtor, + value_snapshotStreamID, value_imageCodec, value_frameRate, value_bitRate, + value_minResolution, value_maxResolution, value_quality); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::WebRTCTransportProvider::Id: { + using namespace app::Clusters::WebRTCTransportProvider; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::WebRTCTransportRequestor::Id: { + using namespace app::Clusters::WebRTCTransportRequestor; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::Chime::Id: { + using namespace app::Clusters::Chime; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::EcosystemInformation::Id: { + using namespace app::Clusters::EcosystemInformation; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::CommissionerControl::Id: { + using namespace app::Clusters::CommissionerControl; + switch (aPath.mEventId) + { + case Events::CommissioningRequestResult::Id: { + Events::CommissioningRequestResult::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_requestID; + std::string value_requestIDClassName = "java/lang/Long"; + std::string value_requestIDCtorSignature = "(J)V"; + jlong jnivalue_requestID = static_cast(cppValue.requestID); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_requestIDClassName.c_str(), value_requestIDCtorSignature.c_str(), jnivalue_requestID, value_requestID); + + jobject value_clientNodeID; + std::string value_clientNodeIDClassName = "java/lang/Long"; + std::string value_clientNodeIDCtorSignature = "(J)V"; + jlong jnivalue_clientNodeID = static_cast(cppValue.clientNodeID); + chip::JniReferences::GetInstance().CreateBoxedObject(value_clientNodeIDClassName.c_str(), + value_clientNodeIDCtorSignature.c_str(), + jnivalue_clientNodeID, value_clientNodeID); + + jobject value_statusCode; + std::string value_statusCodeClassName = "java/lang/Integer"; + std::string value_statusCodeCtorSignature = "(I)V"; + jint jnivalue_statusCode = static_cast(cppValue.statusCode); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_statusCodeClassName.c_str(), value_statusCodeCtorSignature.c_str(), jnivalue_statusCode, value_statusCode); + + jobject value_fabricIndex; + std::string value_fabricIndexClassName = "java/lang/Integer"; + std::string value_fabricIndexCtorSignature = "(I)V"; + jint jnivalue_fabricIndex = static_cast(cppValue.fabricIndex); + chip::JniReferences::GetInstance().CreateBoxedObject(value_fabricIndexClassName.c_str(), + value_fabricIndexCtorSignature.c_str(), jnivalue_fabricIndex, + value_fabricIndex); + + jclass commissioningRequestResultStructClass; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent", + commissioningRequestResultStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent"); + return nullptr; + } + + jmethodID commissioningRequestResultStructCtor; + err = chip::JniReferences::GetInstance().FindMethod( + env, commissioningRequestResultStructClass, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;)V", &commissioningRequestResultStructCtor); + if (err != CHIP_NO_ERROR || commissioningRequestResultStructCtor == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipEventStructs$CommissionerControlClusterCommissioningRequestResultEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(commissioningRequestResultStructClass, commissioningRequestResultStructCtor, + value_requestID, value_clientNodeID, value_statusCode, value_fabricIndex); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::UnitTesting::Id: { + using namespace app::Clusters::UnitTesting; + switch (aPath.mEventId) + { + case Events::TestEvent::Id: { + Events::TestEvent::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_arg1; + std::string value_arg1ClassName = "java/lang/Integer"; + std::string value_arg1CtorSignature = "(I)V"; + jint jnivalue_arg1 = static_cast(cppValue.arg1); + chip::JniReferences::GetInstance().CreateBoxedObject(value_arg1ClassName.c_str(), value_arg1CtorSignature.c_str(), + jnivalue_arg1, value_arg1); + + jobject value_arg2; + std::string value_arg2ClassName = "java/lang/Integer"; + std::string value_arg2CtorSignature = "(I)V"; + jint jnivalue_arg2 = static_cast(cppValue.arg2); + chip::JniReferences::GetInstance().CreateBoxedObject(value_arg2ClassName.c_str(), value_arg2CtorSignature.c_str(), + jnivalue_arg2, value_arg2); + + jobject value_arg3; + std::string value_arg3ClassName = "java/lang/Boolean"; + std::string value_arg3CtorSignature = "(Z)V"; jboolean jnivalue_arg3 = static_cast(cppValue.arg3); chip::JniReferences::GetInstance().CreateBoxedObject( value_arg3ClassName.c_str(), value_arg3CtorSignature.c_str(), jnivalue_arg3, value_arg3); @@ -8445,30 +9296,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & chip::JniReferences::GetInstance().CreateOptional(value_arg4_iInsideOptional, value_arg4_i); } - jclass simpleStructStructClass_0; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_0; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_0, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_0); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_0, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_0); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - value_arg4 = - env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c, - value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i); + value_arg4 = + env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c, + value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i); + } jobject value_arg5; chip::JniReferences::GetInstance().CreateArrayList(value_arg5); @@ -8538,30 +9391,32 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & chip::JniReferences::GetInstance().CreateOptional(newElement_0_iInsideOptional, newElement_0_i); } - jclass simpleStructStructClass_1; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); - if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); - return nullptr; - } + jclass simpleStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterSimpleStruct", simpleStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterSimpleStruct"); + return nullptr; + } - jmethodID simpleStructStructCtor_1; - err = chip::JniReferences::GetInstance().FindMethod( - env, simpleStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;Ljava/util/Optional;)V", - &simpleStructStructCtor_1); - if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); - return nullptr; - } + jmethodID simpleStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, simpleStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", + &simpleStructStructCtor_1); + if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterSimpleStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b, - newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, - newElement_0_h, newElement_0_i); + newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, + newElement_0_b, newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, + newElement_0_g, newElement_0_h, newElement_0_i); + } chip::JniReferences::GetInstance().AddToList(value_arg5, newElement_0); } diff --git a/src/controller/python/chip/clusters/Attribute.py b/src/controller/python/chip/clusters/Attribute.py index 4d5bc1d17a..0b51ce4bfc 100644 --- a/src/controller/python/chip/clusters/Attribute.py +++ b/src/controller/python/chip/clusters/Attribute.py @@ -110,9 +110,11 @@ def __post_init__(self): '''Only one of either ClusterType and AttributeType OR Path may be provided.''' if (self.ClusterType is not None and self.AttributeType is not None) and self.Path is not None: - raise ValueError("Only one of either ClusterType and AttributeType OR Path may be provided.") + raise ValueError( + "Only one of either ClusterType and AttributeType OR Path may be provided.") if (self.ClusterType is None or self.AttributeType is None) and self.Path is None: - raise ValueError("Either ClusterType and AttributeType OR Path must be provided.") + raise ValueError( + "Either ClusterType and AttributeType OR Path must be provided.") # if ClusterType and AttributeType were provided we can continue onwards to deriving the label. # Otherwise, we'll need to walk the attribute index to find the right type information. @@ -373,7 +375,8 @@ def handle_cluster_view(endpointId, clusterId, clusterType): try: decodedData = clusterType.FromDict( data=clusterType.descriptor.TagDictToLabelDict([], self.attributeTLVCache[endpointId][clusterId])) - decodedData.SetDataVersion(self.versionList.get(endpointId, {}).get(clusterId)) + decodedData.SetDataVersion( + self.versionList.get(endpointId, {}).get(clusterId)) return decodedData except Exception as ex: return ValueDecodeFailure(self.attributeTLVCache[endpointId][clusterId], ex) @@ -404,12 +407,14 @@ def handle_attribute_view(endpointId, clusterId, attributeId, attributeType): clusterType = _ClusterIndex[clusterId] if self.returnClusterObject: - endpointCache[clusterType] = handle_cluster_view(endpointId, clusterId, clusterType) + endpointCache[clusterType] = handle_cluster_view( + endpointId, clusterId, clusterType) else: if clusterType not in endpointCache: endpointCache[clusterType] = {} clusterCache = endpointCache[clusterType] - clusterCache[DataVersion] = self.versionList.get(endpointId, {}).get(clusterId) + clusterCache[DataVersion] = self.versionList.get( + endpointId, {}).get(clusterId) if (clusterId, attributeId) not in _AttributeIndex: # @@ -419,7 +424,8 @@ def handle_attribute_view(endpointId, clusterId, attributeId, attributeType): continue attributeType = _AttributeIndex[(clusterId, attributeId)][0] - clusterCache[attributeType] = handle_attribute_view(endpointId, clusterId, attributeId, attributeType) + clusterCache[attributeType] = handle_attribute_view( + endpointId, clusterId, attributeId, attributeType) self._attributeCacheUpdateNeeded.clear() return self._attributeCache @@ -428,14 +434,18 @@ class SubscriptionTransaction: def __init__(self, transaction: AsyncReadTransaction, subscriptionId, devCtrl): self._onResubscriptionAttemptedCb: Callable[[SubscriptionTransaction, int, int], None] = DefaultResubscriptionAttemptedCallback - self._onAttributeChangeCb: Callable[[TypedAttributePath, SubscriptionTransaction], None] = DefaultAttributeChangeCallback - self._onEventChangeCb: Callable[[EventReadResult, SubscriptionTransaction], None] = DefaultEventChangeCallback - self._onErrorCb: Callable[[int, SubscriptionTransaction], None] = DefaultErrorCallback + self._onAttributeChangeCb: Callable[[ + TypedAttributePath, SubscriptionTransaction], None] = DefaultAttributeChangeCallback + self._onEventChangeCb: Callable[[ + EventReadResult, SubscriptionTransaction], None] = DefaultEventChangeCallback + self._onErrorCb: Callable[[ + int, SubscriptionTransaction], None] = DefaultErrorCallback self._readTransaction = transaction self._subscriptionId = subscriptionId self._devCtrl = devCtrl self._isDone = False - self._onResubscriptionSucceededCb: Optional[Callable[[SubscriptionTransaction], None]] = None + self._onResubscriptionSucceededCb: Optional[Callable[[ + SubscriptionTransaction], None]] = None self._onResubscriptionSucceededCb_isAsync = False self._onResubscriptionAttemptedCb_isAsync = False @@ -460,7 +470,8 @@ def GetEvents(self): def OverrideLivenessTimeoutMs(self, timeoutMs: int): handle = chip.native.GetLibraryHandle() builtins.chipStack.Call( - lambda: handle.pychip_ReadClient_OverrideLivenessTimeout(self._readTransaction._pReadClient, timeoutMs) + lambda: handle.pychip_ReadClient_OverrideLivenessTimeout( + self._readTransaction._pReadClient, timeoutMs) ) async def TriggerResubscribeIfScheduled(self, reason: str): @@ -501,7 +512,8 @@ def GetSubscriptionTimeoutMs(self) -> int: timeoutMs = ctypes.c_uint32(0) handle = chip.native.GetLibraryHandle() builtins.chipStack.Call( - lambda: handle.pychip_ReadClient_GetSubscriptionTimeoutMs(self._readTransaction._pReadClient, ctypes.pointer(timeoutMs)) + lambda: handle.pychip_ReadClient_GetSubscriptionTimeoutMs( + self._readTransaction._pReadClient, ctypes.pointer(timeoutMs)) ) return timeoutMs.value @@ -567,13 +579,14 @@ def subscriptionId(self) -> int: def Shutdown(self): if (self._isDone): - LOGGER.warning("Subscription 0x%08x was already terminated previously!", self.subscriptionId) + LOGGER.warning( + "Subscription 0x%08x was already terminated previously!", self.subscriptionId) return handle = chip.native.GetLibraryHandle() builtins.chipStack.Call( - lambda: handle.pychip_ReadClient_Abort( - self._readTransaction._pReadClient, self._readTransaction._pReadCallback)) + lambda: handle.pychip_ReadClient_ShutdownSubscription( + self._readTransaction._pReadClient)) self._isDone = True def __del__(self): @@ -585,7 +598,8 @@ def __repr__(self): def DefaultResubscriptionAttemptedCallback(transaction: SubscriptionTransaction, terminationError, nextResubscribeIntervalMsec): - print(f"Previous subscription failed with Error: {terminationError} - re-subscribing in {nextResubscribeIntervalMsec}ms...") + print( + f"Previous subscription failed with Error: {terminationError} - re-subscribing in {nextResubscribeIntervalMsec}ms...") def DefaultAttributeChangeCallback(path: TypedAttributePath, transaction: SubscriptionTransaction): @@ -648,12 +662,10 @@ def __init__(self, future: Future, eventLoop, devCtrl, returnClusterObject: bool self._cache = AttributeCache(returnClusterObject=returnClusterObject) self._changedPathSet: Set[AttributePath] = set() self._pReadClient = None - self._pReadCallback = None self._resultError: Optional[PyChipError] = None - def SetClientObjPointers(self, pReadClient, pReadCallback): + def SetClientObjPointers(self, pReadClient): self._pReadClient = pReadClient - self._pReadCallback = pReadCallback def GetAllEventValues(self): return self._events @@ -729,7 +741,8 @@ def handleEventData(self, header: EventHeader, path: EventPath, data: bytes, sta def handleError(self, chipError: PyChipError): if self._subscription_handler: - self._subscription_handler.OnErrorCb(chipError.code, self._subscription_handler) + self._subscription_handler.OnErrorCb( + chipError.code, self._subscription_handler) self._resultError = chipError def _handleSubscriptionEstablished(self, subscriptionId): @@ -744,7 +757,8 @@ def _handleSubscriptionEstablished(self, subscriptionId): self._event_loop.create_task( self._subscription_handler._onResubscriptionSucceededCb(self._subscription_handler)) else: - self._subscription_handler._onResubscriptionSucceededCb(self._subscription_handler) + self._subscription_handler._onResubscriptionSucceededCb( + self._subscription_handler) def handleSubscriptionEstablished(self, subscriptionId): self._event_loop.call_soon_threadsafe( @@ -820,7 +834,8 @@ def __init__(self, future: Future, eventLoop): def handleResponse(self, path: AttributePath, status: int): try: imStatus = chip.interaction_model.Status(status) - self._resultData.append(AttributeWriteResult(Path=path, Status=imStatus)) + self._resultData.append( + AttributeWriteResult(Path=path, Status=imStatus)) except ValueError as ex: LOGGER.exception(ex) @@ -835,8 +850,10 @@ def _handleDone(self): # if self._resultError is not None: if self._resultError.sdk_part is ErrorSDKPart.IM_GLOBAL_STATUS: - im_status = chip.interaction_model.Status(self._resultError.sdk_code) - self._future.set_exception(chip.interaction_model.InteractionModelError(im_status)) + im_status = chip.interaction_model.Status( + self._resultError.sdk_code) + self._future.set_exception( + chip.interaction_model.InteractionModelError(im_status)) else: self._future.set_exception(self._resultError.to_exception()) else: @@ -856,7 +873,8 @@ def handleDone(self): _OnReadAttributeDataCallbackFunct = CFUNCTYPE( None, py_object, c_uint32, c_uint16, c_uint32, c_uint32, c_uint8, c_void_p, c_size_t) _OnSubscriptionEstablishedCallbackFunct = CFUNCTYPE(None, py_object, c_uint32) -_OnResubscriptionAttemptedCallbackFunct = CFUNCTYPE(None, py_object, PyChipError, c_uint32) +_OnResubscriptionAttemptedCallbackFunct = CFUNCTYPE( + None, py_object, PyChipError, c_uint32) _OnReadEventDataCallbackFunct = CFUNCTYPE( None, py_object, c_uint16, c_uint32, c_uint32, c_uint64, c_uint8, c_uint64, c_uint8, c_void_p, c_size_t, c_uint8) _OnReadErrorCallbackFunct = CFUNCTYPE( @@ -897,7 +915,8 @@ def _OnSubscriptionEstablishedCallback(closure, subscriptionId): @_OnResubscriptionAttemptedCallbackFunct def _OnResubscriptionAttemptedCallback(closure, terminationCause: PyChipError, nextResubscribeIntervalMsec: int): - closure.handleResubscriptionAttempted(terminationCause, nextResubscribeIntervalMsec) + closure.handleResubscriptionAttempted( + terminationCause, nextResubscribeIntervalMsec) @_OnReadErrorCallbackFunct @@ -954,16 +973,23 @@ def WriteAttributes(future: Future, eventLoop, device, pyWriteAttributes = pyWriteAttributesArrayType() for idx, attr in enumerate(attributes): if attr.Attribute.must_use_timed_write and timedRequestTimeoutMs is None or timedRequestTimeoutMs == 0: - raise chip.interaction_model.InteractionModelError(chip.interaction_model.Status.NeedsTimedInteraction) + raise chip.interaction_model.InteractionModelError( + chip.interaction_model.Status.NeedsTimedInteraction) tlv = attr.Attribute.ToTLV(None, attr.Data) - pyWriteAttributes[idx].attributePath.endpointId = c_uint16(attr.EndpointId) - pyWriteAttributes[idx].attributePath.clusterId = c_uint32(attr.Attribute.cluster_id) - pyWriteAttributes[idx].attributePath.attributeId = c_uint32(attr.Attribute.attribute_id) - pyWriteAttributes[idx].attributePath.dataVersion = c_uint32(attr.DataVersion) - pyWriteAttributes[idx].attributePath.hasDataVersion = c_uint8(attr.HasDataVersion) - pyWriteAttributes[idx].tlvData = cast(ctypes.c_char_p(bytes(tlv)), c_void_p) + pyWriteAttributes[idx].attributePath.endpointId = c_uint16( + attr.EndpointId) + pyWriteAttributes[idx].attributePath.clusterId = c_uint32( + attr.Attribute.cluster_id) + pyWriteAttributes[idx].attributePath.attributeId = c_uint32( + attr.Attribute.attribute_id) + pyWriteAttributes[idx].attributePath.dataVersion = c_uint32( + attr.DataVersion) + pyWriteAttributes[idx].attributePath.hasDataVersion = c_uint8( + attr.HasDataVersion) + pyWriteAttributes[idx].tlvData = cast( + ctypes.c_char_p(bytes(tlv)), c_void_p) pyWriteAttributes[idx].tlvLength = c_size_t(len(tlv)) transaction = AsyncWriteTransaction(future, eventLoop) @@ -971,8 +997,10 @@ def WriteAttributes(future: Future, eventLoop, device, res = builtins.chipStack.Call( lambda: handle.pychip_WriteClient_WriteAttributes( ctypes.py_object(transaction), device, - ctypes.c_size_t(0 if timedRequestTimeoutMs is None else timedRequestTimeoutMs), - ctypes.c_size_t(0 if interactionTimeoutMs is None else interactionTimeoutMs), + ctypes.c_size_t( + 0 if timedRequestTimeoutMs is None else timedRequestTimeoutMs), + ctypes.c_size_t( + 0 if interactionTimeoutMs is None else interactionTimeoutMs), ctypes.c_size_t(0 if busyWaitMs is None else busyWaitMs), pyWriteAttributes, ctypes.c_size_t(numberOfAttributes)) ) @@ -991,12 +1019,18 @@ def WriteGroupAttributes(groupId: int, devCtrl: c_void_p, attributes: List[Attri tlv = attr.Attribute.ToTLV(None, attr.Data) - pyWriteAttributes[idx].attributePath.endpointId = c_uint16(attr.EndpointId) - pyWriteAttributes[idx].attributePath.clusterId = c_uint32(attr.Attribute.cluster_id) - pyWriteAttributes[idx].attributePath.attributeId = c_uint32(attr.Attribute.attribute_id) - pyWriteAttributes[idx].attributePath.dataVersion = c_uint32(attr.DataVersion) - pyWriteAttributes[idx].attributePath.hasDataVersion = c_uint8(attr.HasDataVersion) - pyWriteAttributes[idx].tlvData = cast(ctypes.c_char_p(bytes(tlv)), c_void_p) + pyWriteAttributes[idx].attributePath.endpointId = c_uint16( + attr.EndpointId) + pyWriteAttributes[idx].attributePath.clusterId = c_uint32( + attr.Attribute.cluster_id) + pyWriteAttributes[idx].attributePath.attributeId = c_uint32( + attr.Attribute.attribute_id) + pyWriteAttributes[idx].attributePath.dataVersion = c_uint32( + attr.DataVersion) + pyWriteAttributes[idx].attributePath.hasDataVersion = c_uint8( + attr.HasDataVersion) + pyWriteAttributes[idx].tlvData = cast( + ctypes.c_char_p(bytes(tlv)), c_void_p) pyWriteAttributes[idx].tlvLength = c_size_t(len(tlv)) return builtins.chipStack.Call( @@ -1071,7 +1105,8 @@ def Read(transaction: AsyncReadTransaction, device, "DataVersionFilter must provide DataVersion.") filter = chip.interaction_model.DataVersionFilterIBstruct.build( filter) - dataVersionFiltersForCffi[idx] = cast(ctypes.c_char_p(filter), c_void_p) + dataVersionFiltersForCffi[idx] = cast( + ctypes.c_char_p(filter), c_void_p) eventPathsForCffi = None if events is not None: @@ -1095,7 +1130,6 @@ def Read(transaction: AsyncReadTransaction, device, eventPathsForCffi[idx] = cast(ctypes.c_char_p(path), c_void_p) readClientObj = ctypes.POINTER(c_void_p)() - readCallbackObj = ctypes.POINTER(c_void_p)() ctypes.pythonapi.Py_IncRef(ctypes.py_object(transaction)) params = _ReadParams.parse(b'\x00' * _ReadParams.sizeof()) @@ -1109,13 +1143,13 @@ def Read(transaction: AsyncReadTransaction, device, params = _ReadParams.build(params) eventNumberFilterPtr = ctypes.POINTER(ctypes.c_ulonglong)() if eventNumberFilter is not None: - eventNumberFilterPtr = ctypes.POINTER(ctypes.c_ulonglong)(ctypes.c_ulonglong(eventNumberFilter)) + eventNumberFilterPtr = ctypes.POINTER(ctypes.c_ulonglong)( + ctypes.c_ulonglong(eventNumberFilter)) res = builtins.chipStack.Call( lambda: handle.pychip_ReadClient_Read( ctypes.py_object(transaction), ctypes.byref(readClientObj), - ctypes.byref(readCallbackObj), device, ctypes.c_char_p(params), attributePathsForCffi, @@ -1127,7 +1161,7 @@ def Read(transaction: AsyncReadTransaction, device, ctypes.c_size_t(0 if events is None else len(events)), eventNumberFilterPtr)) - transaction.SetClientObjPointers(readClientObj, readCallbackObj) + transaction.SetClientObjPointers(readClientObj) if not res.is_success: ctypes.pythonapi.Py_DecRef(ctypes.py_object(transaction)) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 1df4d9c9f6..a3b2a05cb6 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -1855,6 +1855,12 @@ class ChipClusters: "type": "bool", "reportable": True, }, + 0x00000009: { + "attributeName": "TCUpdateDeadline", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, @@ -13029,55 +13035,703 @@ class ChipClusters: }, }, } - _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO = { - "clusterName": "WebRTCTransportProvider", - "clusterId": 0x00000553, + _ZONE_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "ZoneManagement", + "clusterId": 0x00000550, "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "CreateTwoDCartesianZone", + "args": { + "zone": "TwoDCartesianZoneStruct", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "UpdateTwoDCartesianZone", + "args": { + "zoneID": "int", + "zone": "TwoDCartesianZoneStruct", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "GetTwoDCartesianZone", + "args": { + "zoneID": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "RemoveZone", + "args": { + "zoneID": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "SupportedZoneSources", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, 0x00000001: { - "commandId": 0x00000001, - "commandName": "SolicitOffer", + "attributeName": "Zones", + "attributeId": 0x00000001, + "type": "", + "reportable": True, + }, + 0x00000002: { + "attributeName": "TimeControl", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + "writable": True, + }, + 0x00000003: { + "attributeName": "Sensitivity", + "attributeId": 0x00000003, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO = { + "clusterName": "CameraAvStreamManagement", + "clusterId": 0x00000551, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "AudioStreamAllocate", "args": { "streamType": "int", - "videoStreamID": "int", + "audioCodec": "int", + "channelCount": "int", + "sampleRate": "int", + "bitRate": "int", + "bitDepth": "int", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "AudioStreamDeallocate", + "args": { "audioStreamID": "int", - "ICEServers": "ICEServerStruct", - "ICETransportPolicy": "str", - "metadataOptions": "int", }, }, 0x00000003: { "commandId": 0x00000003, - "commandName": "ProvideOffer", + "commandName": "VideoStreamAllocate", "args": { - "webRTCSessionID": "int", - "sdp": "str", "streamType": "int", - "videoStreamID": "int", - "audioStreamID": "int", - "ICEServers": "ICEServerStruct", - "ICETransportPolicy": "str", - "metadataOptions": "int", + "videoCodec": "int", + "minFrameRate": "int", + "maxFrameRate": "int", + "minResolution": "VideoResolutionStruct", + "maxResolution": "VideoResolutionStruct", + "minBitRate": "int", + "maxBitRate": "int", + "minFragmentLen": "int", + "maxFragmentLen": "int", + "watermarkEnabled": "bool", + "OSDEnabled": "bool", }, }, 0x00000005: { "commandId": 0x00000005, - "commandName": "ProvideAnswer", + "commandName": "VideoStreamModify", "args": { - "webRTCSessionID": "int", - "sdp": "str", + "videoStreamID": "int", + "resolution": "VideoResolutionStruct", + "watermarkEnabled": "bool", + "OSDEnabled": "bool", }, }, 0x00000006: { "commandId": 0x00000006, - "commandName": "ProvideICECandidate", + "commandName": "VideoStreamDeallocate", "args": { - "webRTCSessionID": "int", - "ICECandidate": "str", + "videoStreamID": "int", }, }, 0x00000007: { "commandId": 0x00000007, - "commandName": "EndSession", + "commandName": "SnapshotStreamAllocate", + "args": { + "imageCodec": "int", + "frameRate": "int", + "bitRate": "int", + "minResolution": "VideoResolutionStruct", + "maxResolution": "VideoResolutionStruct", + "quality": "int", + }, + }, + 0x00000009: { + "commandId": 0x00000009, + "commandName": "SnapshotStreamDeallocate", + "args": { + "snapshotStreamID": "int", + }, + }, + 0x0000000A: { + "commandId": 0x0000000A, + "commandName": "SetStreamPriorities", + "args": { + "streamPriorities": "int", + }, + }, + 0x0000000B: { + "commandId": 0x0000000B, + "commandName": "CaptureSnapshot", + "args": { + "snapshotStreamID": "int", + "requestedResolution": "VideoResolutionStruct", + }, + }, + 0x0000000D: { + "commandId": 0x0000000D, + "commandName": "SetViewport", + "args": { + "viewport": "ViewportStruct", + }, + }, + 0x0000000E: { + "commandId": 0x0000000E, + "commandName": "SetImageRotation", + "args": { + "angle": "int", + }, + }, + 0x0000000F: { + "commandId": 0x0000000F, + "commandName": "SetImageFlipHorizontal", + "args": { + "enabled": "bool", + }, + }, + 0x00000010: { + "commandId": 0x00000010, + "commandName": "SetImageFlipVertical", + "args": { + "enabled": "bool", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "MaxConcurrentVideoEncoders", + "attributeId": 0x00000000, + "type": "int", + "reportable": True, + }, + 0x00000001: { + "attributeName": "MaxEncodedPixelRate", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + }, + 0x00000002: { + "attributeName": "VideoSensorParams", + "attributeId": 0x00000002, + "type": "", + "reportable": True, + }, + 0x00000003: { + "attributeName": "NightVisionCapable", + "attributeId": 0x00000003, + "type": "bool", + "reportable": True, + }, + 0x00000004: { + "attributeName": "MinViewport", + "attributeId": 0x00000004, + "type": "", + "reportable": True, + }, + 0x00000005: { + "attributeName": "RateDistortionTradeOffPoints", + "attributeId": 0x00000005, + "type": "", + "reportable": True, + }, + 0x00000006: { + "attributeName": "MaxPreRollBufferSize", + "attributeId": 0x00000006, + "type": "int", + "reportable": True, + }, + 0x00000007: { + "attributeName": "MicrophoneCapabilities", + "attributeId": 0x00000007, + "type": "", + "reportable": True, + }, + 0x00000008: { + "attributeName": "SpeakerCapabilities", + "attributeId": 0x00000008, + "type": "", + "reportable": True, + }, + 0x00000009: { + "attributeName": "TwoWayTalkSupport", + "attributeId": 0x00000009, + "type": "int", + "reportable": True, + }, + 0x0000000A: { + "attributeName": "SupportedSnapshotParams", + "attributeId": 0x0000000A, + "type": "", + "reportable": True, + }, + 0x0000000B: { + "attributeName": "MaxNetworkBandwidth", + "attributeId": 0x0000000B, + "type": "int", + "reportable": True, + }, + 0x0000000C: { + "attributeName": "CurrentFrameRate", + "attributeId": 0x0000000C, + "type": "int", + "reportable": True, + }, + 0x0000000D: { + "attributeName": "HDRModeEnabled", + "attributeId": 0x0000000D, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000000E: { + "attributeName": "CurrentVideoCodecs", + "attributeId": 0x0000000E, + "type": "int", + "reportable": True, + }, + 0x0000000F: { + "attributeName": "CurrentSnapshotConfig", + "attributeId": 0x0000000F, + "type": "", + "reportable": True, + }, + 0x00000010: { + "attributeName": "FabricsUsingCamera", + "attributeId": 0x00000010, + "type": "int", + "reportable": True, + }, + 0x00000011: { + "attributeName": "AllocatedVideoStreams", + "attributeId": 0x00000011, + "type": "", + "reportable": True, + }, + 0x00000012: { + "attributeName": "AllocatedAudioStreams", + "attributeId": 0x00000012, + "type": "", + "reportable": True, + }, + 0x00000013: { + "attributeName": "AllocatedSnapshotStreams", + "attributeId": 0x00000013, + "type": "", + "reportable": True, + }, + 0x00000014: { + "attributeName": "RankedVideoStreamPrioritiesList", + "attributeId": 0x00000014, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000015: { + "attributeName": "SoftRecordingPrivacyModeEnabled", + "attributeId": 0x00000015, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000016: { + "attributeName": "SoftLivestreamPrivacyModeEnabled", + "attributeId": 0x00000016, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000017: { + "attributeName": "HardPrivacyModeOn", + "attributeId": 0x00000017, + "type": "bool", + "reportable": True, + }, + 0x00000018: { + "attributeName": "NightVision", + "attributeId": 0x00000018, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000019: { + "attributeName": "NightVisionIllum", + "attributeId": 0x00000019, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000001A: { + "attributeName": "AWBEnabled", + "attributeId": 0x0000001A, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001B: { + "attributeName": "AutoShutterSpeedEnabled", + "attributeId": 0x0000001B, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001C: { + "attributeName": "AutoISOEnabled", + "attributeId": 0x0000001C, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001D: { + "attributeName": "Viewport", + "attributeId": 0x0000001D, + "type": "", + "reportable": True, + }, + 0x0000001E: { + "attributeName": "SpeakerMuted", + "attributeId": 0x0000001E, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000001F: { + "attributeName": "SpeakerVolumeLevel", + "attributeId": 0x0000001F, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000020: { + "attributeName": "SpeakerMaxLevel", + "attributeId": 0x00000020, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000021: { + "attributeName": "SpeakerMinLevel", + "attributeId": 0x00000021, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000022: { + "attributeName": "MicrophoneMuted", + "attributeId": 0x00000022, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000023: { + "attributeName": "MicrophoneVolumeLevel", + "attributeId": 0x00000023, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000024: { + "attributeName": "MicrophoneMaxLevel", + "attributeId": 0x00000024, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000025: { + "attributeName": "MicrophoneMinLevel", + "attributeId": 0x00000025, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000026: { + "attributeName": "MicrophoneAGCEnabled", + "attributeId": 0x00000026, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x00000027: { + "attributeName": "ImageRotation", + "attributeId": 0x00000027, + "type": "int", + "reportable": True, + }, + 0x00000028: { + "attributeName": "ImageFlipHorizontal", + "attributeId": 0x00000028, + "type": "bool", + "reportable": True, + }, + 0x00000029: { + "attributeName": "ImageFlipVertical", + "attributeId": 0x00000029, + "type": "bool", + "reportable": True, + }, + 0x0000002A: { + "attributeName": "LocalVideoRecordingEnabled", + "attributeId": 0x0000002A, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002B: { + "attributeName": "LocalSnapshotRecordingEnabled", + "attributeId": 0x0000002B, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002C: { + "attributeName": "StatusLightEnabled", + "attributeId": 0x0000002C, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000002D: { + "attributeName": "StatusLightBrightness", + "attributeId": 0x0000002D, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000002E: { + "attributeName": "DepthSensorStatus", + "attributeId": 0x0000002E, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO = { + "clusterName": "WebRTCTransportProvider", + "clusterId": 0x00000553, + "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "SolicitOffer", + "args": { + "streamType": "int", + "videoStreamID": "int", + "audioStreamID": "int", + "ICEServers": "ICEServerStruct", + "ICETransportPolicy": "str", + "metadataOptions": "int", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "ProvideOffer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + "streamType": "int", + "videoStreamID": "int", + "audioStreamID": "int", + "ICEServers": "ICEServerStruct", + "ICETransportPolicy": "str", + "metadataOptions": "int", + }, + }, + 0x00000005: { + "commandId": 0x00000005, + "commandName": "ProvideAnswer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + }, + }, + 0x00000006: { + "commandId": 0x00000006, + "commandName": "ProvideICECandidate", + "args": { + "webRTCSessionID": "int", + "ICECandidate": "str", + }, + }, + 0x00000007: { + "commandId": 0x00000007, + "commandName": "EndSession", + "args": { + "webRTCSessionID": "int", + "reason": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "CurrentSessions", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } + _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO = { + "clusterName": "WebRTCTransportRequestor", + "clusterId": 0x00000554, + "commands": { + 0x00000001: { + "commandId": 0x00000001, + "commandName": "Offer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + "ICEServers": "ICEServerStruct", + "ICETransportPolicy": "str", + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "Answer", + "args": { + "webRTCSessionID": "int", + "sdp": "str", + }, + }, + 0x00000003: { + "commandId": 0x00000003, + "commandName": "ICECandidate", + "args": { + "webRTCSessionID": "int", + "ICECandidate": "str", + }, + }, + 0x00000004: { + "commandId": 0x00000004, + "commandName": "End", "args": { "webRTCSessionID": "int", "reason": "int", @@ -14447,7 +15101,10 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, + 0x00000550: _ZONE_MANAGEMENT_CLUSTER_INFO, + 0x00000551: _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, 0x00000553: _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, + 0x00000554: _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, 0x00000556: _CHIME_CLUSTER_INFO, 0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO, 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, @@ -14574,7 +15231,10 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, + "ZoneManagement": _ZONE_MANAGEMENT_CLUSTER_INFO, + "CameraAvStreamManagement": _CAMERA_AV_STREAM_MANAGEMENT_CLUSTER_INFO, "WebRTCTransportProvider": _WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_INFO, + "WebRTCTransportRequestor": _WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_INFO, "Chime": _CHIME_CLUSTER_INFO, "EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO, "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index b11ad8e725..1167412468 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -156,7 +156,10 @@ "AccountLogin", "ContentControl", "ContentAppObserver", + "ZoneManagement", + "CameraAvStreamManagement", "WebRTCTransportProvider", + "WebRTCTransportRequestor", "Chime", "EcosystemInformation", "CommissionerControl", @@ -268,7 +271,7 @@ class AreaTypeTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 95, + kUnknownEnumValue = 95 class AtomicRequestTypeEnum(MatterIntEnum): kBeginWrite = 0x00 @@ -278,7 +281,7 @@ class AtomicRequestTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class FloorSurfaceTag(MatterIntEnum): kCarpet = 0x00 @@ -309,7 +312,7 @@ class FloorSurfaceTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 24, + kUnknownEnumValue = 24 class LandmarkTag(MatterIntEnum): kAirConditioner = 0x00 @@ -367,7 +370,7 @@ class LandmarkTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 51, + kUnknownEnumValue = 51 class PositionTag(MatterIntEnum): kLeft = 0x00 @@ -381,7 +384,7 @@ class PositionTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class RelativePositionTag(MatterIntEnum): kUnder = 0x00 @@ -395,7 +398,7 @@ class RelativePositionTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class TestGlobalEnum(MatterIntEnum): kSomeValue = 0x00 @@ -405,7 +408,7 @@ class TestGlobalEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class ThreeLevelAutoEnum(MatterIntEnum): kLow = 0x00 @@ -416,7 +419,7 @@ class ThreeLevelAutoEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class TestGlobalBitmap(IntFlag): @@ -508,7 +511,7 @@ class EffectIdentifierEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class EffectVariantEnum(MatterIntEnum): kDefault = 0x00 @@ -516,7 +519,7 @@ class EffectVariantEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 1, + kUnknownEnumValue = 1 class IdentifyTypeEnum(MatterIntEnum): kNone = 0x00 @@ -529,7 +532,7 @@ class IdentifyTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Commands: @dataclass @@ -1056,7 +1059,7 @@ class DelayedAllOffEffectVariantEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DyingLightEffectVariantEnum(MatterIntEnum): kDyingLightFadeOff = 0x00 @@ -1064,7 +1067,7 @@ class DyingLightEffectVariantEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 1, + kUnknownEnumValue = 1 class EffectIdentifierEnum(MatterIntEnum): kDelayedAllOff = 0x00 @@ -1073,7 +1076,7 @@ class EffectIdentifierEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class StartUpOnOffEnum(MatterIntEnum): kOff = 0x00 @@ -1083,7 +1086,7 @@ class StartUpOnOffEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -1422,7 +1425,7 @@ class MoveModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class StepModeEnum(MatterIntEnum): kUp = 0x00 @@ -1431,7 +1434,7 @@ class StepModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -2526,7 +2529,7 @@ class AccessControlEntryAuthModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class AccessControlEntryPrivilegeEnum(MatterIntEnum): kView = 0x01 @@ -2538,7 +2541,7 @@ class AccessControlEntryPrivilegeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class AccessRestrictionTypeEnum(MatterIntEnum): kAttributeAccessForbidden = 0x00 @@ -2549,7 +2552,7 @@ class AccessRestrictionTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ChangeTypeEnum(MatterIntEnum): kChanged = 0x00 @@ -2559,7 +2562,7 @@ class ChangeTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -3019,7 +3022,7 @@ class ActionErrorEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ActionStateEnum(MatterIntEnum): kInactive = 0x00 @@ -3030,7 +3033,7 @@ class ActionStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ActionTypeEnum(MatterIntEnum): kOther = 0x00 @@ -3044,7 +3047,7 @@ class ActionTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class EndpointListTypeEnum(MatterIntEnum): kOther = 0x00 @@ -3054,7 +3057,7 @@ class EndpointListTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class CommandBits(IntFlag): @@ -3628,7 +3631,7 @@ class ColorEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 21, + kUnknownEnumValue = 21 class ProductFinishEnum(MatterIntEnum): kOther = 0x00 @@ -3641,7 +3644,7 @@ class ProductFinishEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Structs: @dataclass @@ -4256,7 +4259,7 @@ class ApplyUpdateActionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DownloadProtocolEnum(MatterIntEnum): kBDXSynchronous = 0x00 @@ -4267,7 +4270,7 @@ class DownloadProtocolEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class StatusEnum(MatterIntEnum): kUpdateAvailable = 0x00 @@ -4278,7 +4281,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Commands: @dataclass @@ -4533,7 +4536,7 @@ class AnnouncementReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class ChangeReasonEnum(MatterIntEnum): kUnknown = 0x00 @@ -4545,7 +4548,7 @@ class ChangeReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class UpdateStateEnum(MatterIntEnum): kUnknown = 0x00 @@ -4561,7 +4564,7 @@ class UpdateStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 9, + kUnknownEnumValue = 9 class Structs: @dataclass @@ -5043,7 +5046,7 @@ class CalendarTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 12, + kUnknownEnumValue = 12 class HourFormatEnum(MatterIntEnum): k12hr = 0x00 @@ -5053,7 +5056,7 @@ class HourFormatEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -5239,7 +5242,7 @@ class TempUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -5624,7 +5627,7 @@ class BatApprovedChemistryEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 33, + kUnknownEnumValue = 33 class BatChargeFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5642,7 +5645,7 @@ class BatChargeFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 11, + kUnknownEnumValue = 11 class BatChargeLevelEnum(MatterIntEnum): kOk = 0x00 @@ -5652,7 +5655,7 @@ class BatChargeLevelEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class BatChargeStateEnum(MatterIntEnum): kUnknown = 0x00 @@ -5663,7 +5666,7 @@ class BatChargeStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class BatCommonDesignationEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5751,7 +5754,7 @@ class BatCommonDesignationEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 81, + kUnknownEnumValue = 81 class BatFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5761,7 +5764,7 @@ class BatFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class BatReplaceabilityEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5772,7 +5775,7 @@ class BatReplaceabilityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class PowerSourceStatusEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5783,7 +5786,7 @@ class PowerSourceStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class WiredCurrentTypeEnum(MatterIntEnum): kAc = 0x00 @@ -5792,7 +5795,7 @@ class WiredCurrentTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class WiredFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -5802,7 +5805,7 @@ class WiredFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -6542,6 +6545,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="TCMinRequiredVersion", Tag=0x00000006, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="TCAcknowledgements", Tag=0x00000007, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="TCAcknowledgementsRequired", Tag=0x00000008, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="TCUpdateDeadline", Tag=0x00000009, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -6559,6 +6563,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: TCMinRequiredVersion: 'typing.Optional[uint]' = None TCAcknowledgements: 'typing.Optional[uint]' = None TCAcknowledgementsRequired: 'typing.Optional[bool]' = None + TCUpdateDeadline: 'typing.Optional[uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -6580,7 +6585,7 @@ class CommissioningErrorEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class RegulatoryLocationTypeEnum(MatterIntEnum): kIndoor = 0x00 @@ -6590,7 +6595,7 @@ class RegulatoryLocationTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -6895,6 +6900,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[bool]' = None + @dataclass + class TCUpdateDeadline(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000030 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -7056,7 +7077,7 @@ class NetworkCommissioningStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 13, + kUnknownEnumValue = 13 class WiFiBandEnum(MatterIntEnum): k2g4 = 0x00 @@ -7069,7 +7090,7 @@ class WiFiBandEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -7684,7 +7705,7 @@ class IntentEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -7696,7 +7717,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class TransferProtocolEnum(MatterIntEnum): kResponsePayload = 0x00 @@ -7705,7 +7726,7 @@ class TransferProtocolEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Commands: @dataclass @@ -7902,7 +7923,7 @@ class BootReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class HardwareFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7920,7 +7941,7 @@ class HardwareFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 11, + kUnknownEnumValue = 11 class InterfaceTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7932,7 +7953,7 @@ class InterfaceTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class NetworkFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7943,7 +7964,7 @@ class NetworkFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class RadioFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -7957,7 +7978,7 @@ class RadioFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -8812,7 +8833,7 @@ class ConnectionStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class NetworkFaultEnum(MatterIntEnum): kUnspecified = 0x00 @@ -8823,7 +8844,7 @@ class NetworkFaultEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class RoutingRoleEnum(MatterIntEnum): kUnspecified = 0x00 @@ -8837,7 +8858,7 @@ class RoutingRoleEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -10179,7 +10200,7 @@ class AssociationFailureCauseEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ConnectionStatusEnum(MatterIntEnum): kConnected = 0x00 @@ -10188,7 +10209,7 @@ class ConnectionStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class SecurityTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -10201,7 +10222,7 @@ class SecurityTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class WiFiVersionEnum(MatterIntEnum): kA = 0x00 @@ -10215,7 +10236,7 @@ class WiFiVersionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -10659,7 +10680,7 @@ class PHYRateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -10982,7 +11003,7 @@ class GranularityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class StatusCode(MatterIntEnum): kTimeNotAccepted = 0x02 @@ -10990,7 +11011,7 @@ class StatusCode(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class TimeSourceEnum(MatterIntEnum): kNone = 0x00 @@ -11014,7 +11035,7 @@ class TimeSourceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 17, + kUnknownEnumValue = 17 class TimeZoneDatabaseEnum(MatterIntEnum): kFull = 0x00 @@ -11024,7 +11045,7 @@ class TimeZoneDatabaseEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -11672,7 +11693,7 @@ class ColorEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 21, + kUnknownEnumValue = 21 class ProductFinishEnum(MatterIntEnum): kOther = 0x00 @@ -11685,7 +11706,7 @@ class ProductFinishEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -12544,7 +12565,7 @@ class CommissioningWindowStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class StatusCode(MatterIntEnum): kBusy = 0x02 @@ -12554,7 +12575,7 @@ class StatusCode(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class Bitmaps: class Feature(IntFlag): @@ -12815,7 +12836,7 @@ class CertificateChainTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class NodeOperationalCertStatusEnum(MatterIntEnum): kOk = 0x00 @@ -12832,7 +12853,7 @@ class NodeOperationalCertStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class Structs: @dataclass @@ -13317,7 +13338,7 @@ class GroupKeySecurityPolicyEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -14516,7 +14537,7 @@ class ClientTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class OperatingModeEnum(MatterIntEnum): kSit = 0x00 @@ -14525,7 +14546,7 @@ class OperatingModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -14959,7 +14980,7 @@ class TimerStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -15218,7 +15239,7 @@ class ErrorStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class OperationalStateEnum(MatterIntEnum): kStopped = 0x00 @@ -15229,7 +15250,7 @@ class OperationalStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -15622,7 +15643,7 @@ class ModeTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -15891,7 +15912,7 @@ class DrynessLevelEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Attributes: @dataclass @@ -16907,7 +16928,7 @@ class NumberOfRinsesEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -18370,7 +18391,7 @@ class AirQualityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class Bitmaps: class Feature(IntFlag): @@ -18551,7 +18572,7 @@ class AlarmStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class ContaminationStateEnum(MatterIntEnum): kNormal = 0x00 @@ -18562,7 +18583,7 @@ class ContaminationStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class EndOfServiceEnum(MatterIntEnum): kNormal = 0x00 @@ -18571,7 +18592,7 @@ class EndOfServiceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ExpressedStateEnum(MatterIntEnum): kNormal = 0x00 @@ -18587,7 +18608,7 @@ class ExpressedStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 9, + kUnknownEnumValue = 9 class MuteStateEnum(MatterIntEnum): kNotMuted = 0x00 @@ -18596,7 +18617,7 @@ class MuteStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class SensitivityEnum(MatterIntEnum): kHigh = 0x00 @@ -18606,7 +18627,7 @@ class SensitivityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -19434,7 +19455,7 @@ class ModeTag(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class Bitmaps: class Feature(IntFlag): @@ -19974,7 +19995,7 @@ class ErrorStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class OperationalStateEnum(MatterIntEnum): kStopped = 0x00 @@ -19985,7 +20006,7 @@ class OperationalStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -21302,7 +21323,7 @@ class ChangeIndicationEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DegradationDirectionEnum(MatterIntEnum): kUp = 0x00 @@ -21311,7 +21332,7 @@ class DegradationDirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ProductIdentifierTypeEnum(MatterIntEnum): kUpc = 0x00 @@ -21323,7 +21344,7 @@ class ProductIdentifierTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -21597,7 +21618,7 @@ class ChangeIndicationEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DegradationDirectionEnum(MatterIntEnum): kUp = 0x00 @@ -21606,7 +21627,7 @@ class DegradationDirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ProductIdentifierTypeEnum(MatterIntEnum): kUpc = 0x00 @@ -21618,7 +21639,7 @@ class ProductIdentifierTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -22253,7 +22274,7 @@ class StatusCodeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class ValveStateEnum(MatterIntEnum): kClosed = 0x00 @@ -22263,7 +22284,7 @@ class ValveStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -22707,7 +22728,7 @@ class MeasurementTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 15, + kUnknownEnumValue = 15 class PowerModeEnum(MatterIntEnum): kUnknown = 0x00 @@ -22717,7 +22738,7 @@ class PowerModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -23294,7 +23315,7 @@ class MeasurementTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 15, + kUnknownEnumValue = 15 class Bitmaps: class Feature(IntFlag): @@ -23664,7 +23685,7 @@ class BoostStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -24015,7 +24036,7 @@ class CriticalityLevelEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class HeatingSourceEnum(MatterIntEnum): kAny = 0x00 @@ -24025,7 +24046,7 @@ class HeatingSourceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class LoadControlEventChangeSourceEnum(MatterIntEnum): kAutomatic = 0x00 @@ -24034,7 +24055,7 @@ class LoadControlEventChangeSourceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class LoadControlEventStatusEnum(MatterIntEnum): kUnknown = 0x00 @@ -24054,7 +24075,7 @@ class LoadControlEventStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 13, + kUnknownEnumValue = 13 class Bitmaps: class CancelControlBitmap(IntFlag): @@ -24606,7 +24627,7 @@ class FutureMessagePreferenceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MessagePriorityEnum(MatterIntEnum): kLow = 0x00 @@ -24617,7 +24638,7 @@ class MessagePriorityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -24956,7 +24977,7 @@ class AdjustmentCauseEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class CauseEnum(MatterIntEnum): kNormalCompletion = 0x00 @@ -24968,7 +24989,7 @@ class CauseEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class CostTypeEnum(MatterIntEnum): kFinancial = 0x00 @@ -24979,7 +25000,7 @@ class CostTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ESAStateEnum(MatterIntEnum): kOffline = 0x00 @@ -24991,7 +25012,7 @@ class ESAStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class ESATypeEnum(MatterIntEnum): kEvse = 0x00 @@ -25013,7 +25034,7 @@ class ESATypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 14, + kUnknownEnumValue = 14 class ForecastUpdateReasonEnum(MatterIntEnum): kInternalOptimization = 0x00 @@ -25023,7 +25044,7 @@ class ForecastUpdateReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class OptOutStateEnum(MatterIntEnum): kNoOptOut = 0x00 @@ -25034,7 +25055,7 @@ class OptOutStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class PowerAdjustReasonEnum(MatterIntEnum): kNoAdjustment = 0x00 @@ -25044,7 +25065,7 @@ class PowerAdjustReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -25723,7 +25744,7 @@ class EnergyTransferStoppedReasonEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class FaultStateEnum(MatterIntEnum): kNoError = 0x00 @@ -25747,7 +25768,7 @@ class FaultStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 16, + kUnknownEnumValue = 16 class StateEnum(MatterIntEnum): kNotPluggedIn = 0x00 @@ -25761,7 +25782,7 @@ class StateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class SupplyStateEnum(MatterIntEnum): kDisabled = 0x00 @@ -25774,7 +25795,7 @@ class SupplyStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -26625,7 +26646,7 @@ class EnergyPriorityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -27962,7 +27983,7 @@ class AlarmCodeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class CredentialRuleEnum(MatterIntEnum): kSingle = 0x00 @@ -27972,7 +27993,7 @@ class CredentialRuleEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class CredentialTypeEnum(MatterIntEnum): kProgrammingPIN = 0x00 @@ -27988,7 +28009,7 @@ class CredentialTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 9, + kUnknownEnumValue = 9 class DataOperationTypeEnum(MatterIntEnum): kAdd = 0x00 @@ -27998,7 +28019,7 @@ class DataOperationTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DlLockState(MatterIntEnum): kNotFullyLocked = 0x00 @@ -28009,7 +28030,7 @@ class DlLockState(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class DlLockType(MatterIntEnum): kDeadBolt = 0x00 @@ -28028,7 +28049,7 @@ class DlLockType(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 12, + kUnknownEnumValue = 12 class DlStatus(MatterIntEnum): kSuccess = 0x00 @@ -28042,7 +28063,7 @@ class DlStatus(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class DoorLockOperationEventCode(MatterIntEnum): kUnknownOrMfgSpecific = 0x00 @@ -28064,7 +28085,7 @@ class DoorLockOperationEventCode(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 15, + kUnknownEnumValue = 15 class DoorLockProgrammingEventCode(MatterIntEnum): kUnknownOrMfgSpecific = 0x00 @@ -28078,7 +28099,7 @@ class DoorLockProgrammingEventCode(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class DoorLockSetPinOrIdStatus(MatterIntEnum): kSuccess = 0x00 @@ -28089,7 +28110,7 @@ class DoorLockSetPinOrIdStatus(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class DoorLockUserStatus(MatterIntEnum): kAvailable = 0x00 @@ -28100,7 +28121,7 @@ class DoorLockUserStatus(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class DoorLockUserType(MatterIntEnum): kUnrestricted = 0x00 @@ -28113,7 +28134,7 @@ class DoorLockUserType(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class DoorStateEnum(MatterIntEnum): kDoorOpen = 0x00 @@ -28126,7 +28147,7 @@ class DoorStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class LockDataTypeEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28147,7 +28168,7 @@ class LockDataTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 14, + kUnknownEnumValue = 14 class LockOperationTypeEnum(MatterIntEnum): kLock = 0x00 @@ -28159,7 +28180,7 @@ class LockOperationTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class OperatingModeEnum(MatterIntEnum): kNormal = 0x00 @@ -28171,7 +28192,7 @@ class OperatingModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class OperationErrorEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28183,7 +28204,7 @@ class OperationErrorEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class OperationSourceEnum(MatterIntEnum): kUnspecified = 0x00 @@ -28201,7 +28222,7 @@ class OperationSourceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 11, + kUnknownEnumValue = 11 class UserStatusEnum(MatterIntEnum): kAvailable = 0x00 @@ -28211,7 +28232,7 @@ class UserStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class UserTypeEnum(MatterIntEnum): kUnrestrictedUser = 0x00 @@ -28228,7 +28249,7 @@ class UserTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class Bitmaps: class DaysMaskMap(IntFlag): @@ -30013,7 +30034,7 @@ class EndProductType(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 24, + kUnknownEnumValue = 24 class Type(MatterIntEnum): kRollerShade = 0x00 @@ -30031,7 +30052,7 @@ class Type(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 10, + kUnknownEnumValue = 10 class Bitmaps: class ConfigStatus(IntFlag): @@ -30674,7 +30695,7 @@ class OperationalStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class SelectAreasStatus(MatterIntEnum): kSuccess = 0x00 @@ -30685,7 +30706,7 @@ class SelectAreasStatus(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class SkipAreaStatus(MatterIntEnum): kSuccess = 0x00 @@ -30696,7 +30717,7 @@ class SkipAreaStatus(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -31120,7 +31141,7 @@ class ControlModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class OperationModeEnum(MatterIntEnum): kNormal = 0x00 @@ -31131,7 +31152,7 @@ class OperationModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -32043,7 +32064,7 @@ class ACCapacityFormatEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 1, + kUnknownEnumValue = 1 class ACCompressorTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32054,7 +32075,7 @@ class ACCompressorTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ACLouverPositionEnum(MatterIntEnum): kClosed = 0x01 @@ -32066,7 +32087,7 @@ class ACLouverPositionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class ACRefrigerantTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32077,7 +32098,7 @@ class ACRefrigerantTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class ACTypeEnum(MatterIntEnum): kUnknown = 0x00 @@ -32089,7 +32110,7 @@ class ACTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class ControlSequenceOfOperationEnum(MatterIntEnum): kCoolingOnly = 0x00 @@ -32102,7 +32123,7 @@ class ControlSequenceOfOperationEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class PresetScenarioEnum(MatterIntEnum): kOccupied = 0x01 @@ -32116,7 +32137,7 @@ class PresetScenarioEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class SetpointChangeSourceEnum(MatterIntEnum): kManual = 0x00 @@ -32126,7 +32147,7 @@ class SetpointChangeSourceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class SetpointRaiseLowerModeEnum(MatterIntEnum): kHeat = 0x00 @@ -32136,7 +32157,7 @@ class SetpointRaiseLowerModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class StartOfWeekEnum(MatterIntEnum): kSunday = 0x00 @@ -32150,7 +32171,7 @@ class StartOfWeekEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class SystemModeEnum(MatterIntEnum): kOff = 0x00 @@ -32166,7 +32187,7 @@ class SystemModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class TemperatureSetpointHoldEnum(MatterIntEnum): kSetpointHoldOff = 0x00 @@ -32175,7 +32196,7 @@ class TemperatureSetpointHoldEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ThermostatRunningModeEnum(MatterIntEnum): kOff = 0x00 @@ -32185,7 +32206,7 @@ class ThermostatRunningModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 1, + kUnknownEnumValue = 1 class Bitmaps: class ACErrorCodeBitmap(IntFlag): @@ -33646,7 +33667,7 @@ class AirflowDirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class FanModeEnum(MatterIntEnum): kOff = 0x00 @@ -33660,7 +33681,7 @@ class FanModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 7 class FanModeSequenceEnum(MatterIntEnum): kOffLowMedHigh = 0x00 @@ -33673,7 +33694,7 @@ class FanModeSequenceEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class StepDirectionEnum(MatterIntEnum): kIncrease = 0x00 @@ -33682,7 +33703,7 @@ class StepDirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Bitmaps: class Feature(IntFlag): @@ -34054,7 +34075,7 @@ class KeypadLockoutEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class ScheduleProgrammingVisibilityEnum(MatterIntEnum): kScheduleProgrammingPermitted = 0x00 @@ -34063,7 +34084,7 @@ class ScheduleProgrammingVisibilityEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class TemperatureDisplayModeEnum(MatterIntEnum): kCelsius = 0x00 @@ -34072,7 +34093,7 @@ class TemperatureDisplayModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Attributes: @dataclass @@ -34356,7 +34377,7 @@ class ColorLoopActionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class ColorLoopDirectionEnum(MatterIntEnum): kDecrement = 0x00 @@ -34365,7 +34386,7 @@ class ColorLoopDirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ColorModeEnum(MatterIntEnum): kCurrentHueAndCurrentSaturation = 0x00 @@ -34375,7 +34396,7 @@ class ColorModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class DirectionEnum(MatterIntEnum): kShortest = 0x00 @@ -34386,7 +34407,7 @@ class DirectionEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class DriftCompensationEnum(MatterIntEnum): kNone = 0x00 @@ -34398,7 +34419,7 @@ class DriftCompensationEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class EnhancedColorModeEnum(MatterIntEnum): kCurrentHueAndCurrentSaturation = 0x00 @@ -34409,7 +34430,7 @@ class EnhancedColorModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class MoveModeEnum(MatterIntEnum): kStop = 0x00 @@ -34419,7 +34440,7 @@ class MoveModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class StepModeEnum(MatterIntEnum): kUp = 0x01 @@ -34428,7 +34449,7 @@ class StepModeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 0, + kUnknownEnumValue = 0 class Bitmaps: class ColorCapabilitiesBitmap(IntFlag): @@ -36255,7 +36276,7 @@ class LightSensorTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Attributes: @dataclass @@ -37362,7 +37383,7 @@ class OccupancySensorTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Feature(IntFlag): @@ -37797,7 +37818,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -37807,7 +37828,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -37822,7 +37843,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38163,7 +38184,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38173,7 +38194,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38188,7 +38209,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38529,7 +38550,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38539,7 +38560,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38554,7 +38575,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -38895,7 +38916,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -38905,7 +38926,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -38920,7 +38941,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -39261,7 +39282,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -39271,7 +39292,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -39286,7 +39307,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -39627,7 +39648,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -39637,7 +39658,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -39652,7 +39673,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -39993,7 +40014,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40003,7 +40024,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40018,7 +40039,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -40359,7 +40380,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40369,7 +40390,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40384,7 +40405,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -40725,7 +40746,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -40735,7 +40756,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -40750,7 +40771,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -41091,7 +41112,7 @@ class LevelValueEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class MeasurementMediumEnum(MatterIntEnum): kAir = 0x00 @@ -41101,7 +41122,7 @@ class MeasurementMediumEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class MeasurementUnitEnum(MatterIntEnum): kPpm = 0x00 @@ -41116,7 +41137,7 @@ class MeasurementUnitEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 8, + kUnknownEnumValue = 8 class Bitmaps: class Feature(IntFlag): @@ -42360,7 +42381,7 @@ class ChannelTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class LineupInfoTypeEnum(MatterIntEnum): kMso = 0x00 @@ -42368,7 +42389,7 @@ class LineupInfoTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 1, + kUnknownEnumValue = 1 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -42378,7 +42399,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -42901,7 +42922,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Structs: @dataclass @@ -43177,7 +43198,7 @@ class CharacteristicEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 18, + kUnknownEnumValue = 18 class PlaybackStateEnum(MatterIntEnum): kPlaying = 0x00 @@ -43188,7 +43209,7 @@ class PlaybackStateEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -43201,7 +43222,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -43830,7 +43851,7 @@ class InputTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 12, + kUnknownEnumValue = 12 class Bitmaps: class Feature(IntFlag): @@ -44295,7 +44316,7 @@ class CECKeyCodeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 14, + kUnknownEnumValue = 14 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -44305,7 +44326,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 3 class Bitmaps: class Feature(IntFlag): @@ -44495,7 +44516,7 @@ class CharacteristicEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 18, + kUnknownEnumValue = 18 class MetricTypeEnum(MatterIntEnum): kPixels = 0x00 @@ -44504,7 +44525,7 @@ class MetricTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class ParameterEnum(MatterIntEnum): kActor = 0x00 @@ -44528,7 +44549,7 @@ class ParameterEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 17, + kUnknownEnumValue = 17 class StatusEnum(MatterIntEnum): kSuccess = 0x00 @@ -44540,7 +44561,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class Bitmaps: class Feature(IntFlag): @@ -44907,7 +44928,7 @@ class OutputTypeEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -45133,7 +45154,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 6, + kUnknownEnumValue = 6 class Bitmaps: class Feature(IntFlag): @@ -45414,7 +45435,7 @@ class ApplicationStatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Structs: @dataclass @@ -46379,7 +46400,7 @@ class StatusEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 2, + kUnknownEnumValue = 2 class Commands: @dataclass @@ -46519,14 +46540,17 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: @dataclass -class WebRTCTransportProvider(Cluster): - id: typing.ClassVar[int] = 0x00000553 +class ZoneManagement(Cluster): + id: typing.ClassVar[int] = 0x00000550 @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="currentSessions", Tag=0x00000000, Type=typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]), + ClusterObjectFieldDescriptor(Label="supportedZoneSources", Tag=0x00000000, Type=typing.List[ZoneManagement.Enums.ZoneSourceEnum]), + ClusterObjectFieldDescriptor(Label="zones", Tag=0x00000001, Type=typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]), + ClusterObjectFieldDescriptor(Label="timeControl", Tag=0x00000002, Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]), + ClusterObjectFieldDescriptor(Label="sensitivity", Tag=0x00000003, Type=uint), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -46535,7 +46559,10 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), ]) - currentSessions: 'typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]' = None + supportedZoneSources: 'typing.List[ZoneManagement.Enums.ZoneSourceEnum]' = None + zones: 'typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]' = None + timeControl: 'typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]' = None + sensitivity: 'uint' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -46544,164 +46571,147 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class StreamTypeEnum(MatterIntEnum): - kInternal = 0x00 - kRecording = 0x01 - kAnalysis = 0x02 - kLiveView = 0x03 + class StatusCodeEnum(MatterIntEnum): + kZoneNotFound = 0x02 + kZoneInUse = 0x03 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 0 - class WebRTCEndReasonEnum(MatterIntEnum): - kIceFailed = 0x00 - kIceTimeout = 0x01 - kUserHangup = 0x02 - kUserBusy = 0x03 - kReplaced = 0x04 - kNoUserMedia = 0x05 - kInviteTimeout = 0x06 - kAnsweredElsewhere = 0x07 - kOutOfResources = 0x08 - kMediaTimeout = 0x09 - kLowPower = 0x0A - kUnknownReason = 0x0B + class ZoneEventStoppedReasonEnum(MatterIntEnum): + kActionStopped = 0x00 + kTimeout = 0x01 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 2 + + class ZoneEventTriggeredReasonEnum(MatterIntEnum): + kMotion = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class ZoneSourceEnum(MatterIntEnum): + kMfg = 0x00 + kUser = 0x01 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 12, + kUnknownEnumValue = 2 + + class ZoneTypeEnum(MatterIntEnum): + kTwoDCARTZone = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class ZoneUseEnum(MatterIntEnum): + kMotion = 0x00 + kPrivacy = 0x01 + kFocus = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 class Bitmaps: - class WebRTCMetadataOptions(IntFlag): - kDataTLV = 0x1 + class Feature(IntFlag): + kTwoDimensionalCartesianZone = 0x1 class Structs: @dataclass - class ICEServerStruct(ClusterObject): + class TwoDCartesianVertexStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="urls", Tag=1, Type=typing.List[str]), - ClusterObjectFieldDescriptor(Label="username", Tag=2, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="credential", Tag=3, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="caid", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="x", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="y", Tag=1, Type=uint), ]) - urls: 'typing.List[str]' = field(default_factory=lambda: []) - username: 'typing.Optional[str]' = None - credential: 'typing.Optional[str]' = None - caid: 'typing.Optional[uint]' = None + x: 'uint' = 0 + y: 'uint' = 0 @dataclass - class WebRTCSessionStruct(ClusterObject): + class TwoDCartesianZoneStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="peerNodeID", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="peerFabricIndex", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="streamType", Tag=4, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=5, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=6, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="use", Tag=1, Type=ZoneManagement.Enums.ZoneUseEnum), + ClusterObjectFieldDescriptor(Label="vertices", Tag=2, Type=typing.List[ZoneManagement.Structs.TwoDCartesianVertexStruct]), + ClusterObjectFieldDescriptor(Label="color", Tag=3, Type=typing.Optional[str]), ]) - id: 'uint' = 0 - peerNodeID: 'uint' = 0 - peerFabricIndex: 'uint' = 0 - streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 - videoStreamID: 'typing.Union[Nullable, uint]' = NullValue - audioStreamID: 'typing.Union[Nullable, uint]' = NullValue - metadataOptions: 'uint' = 0 + name: 'str' = "" + use: 'ZoneManagement.Enums.ZoneUseEnum' = 0 + vertices: 'typing.List[ZoneManagement.Structs.TwoDCartesianVertexStruct]' = field(default_factory=lambda: []) + color: 'typing.Optional[str]' = None - class Commands: @dataclass - class SolicitOffer(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'SolicitOfferResponse' - + class ZoneInformationStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="ICEServers", Tag=3, Type=typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]), - ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=4, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=5, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="zoneType", Tag=1, Type=ZoneManagement.Enums.ZoneTypeEnum), + ClusterObjectFieldDescriptor(Label="zoneSource", Tag=2, Type=ZoneManagement.Enums.ZoneSourceEnum), ]) - streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 - videoStreamID: 'typing.Union[None, Nullable, uint]' = None - audioStreamID: 'typing.Union[None, Nullable, uint]' = None - ICEServers: 'typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]' = None - ICETransportPolicy: 'typing.Optional[str]' = None - metadataOptions: 'typing.Optional[uint]' = None + zoneID: 'uint' = 0 + zoneType: 'ZoneManagement.Enums.ZoneTypeEnum' = 0 + zoneSource: 'ZoneManagement.Enums.ZoneSourceEnum' = 0 @dataclass - class SolicitOfferResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000002 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - + class ZoneTriggeringTimeControlStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="deferredOffer", Tag=1, Type=bool), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=3, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="initialDuration", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="augmentationDuration", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="maxDuration", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="blindDuration", Tag=3, Type=uint), ]) - webRTCSessionID: 'uint' = 0 - deferredOffer: 'bool' = False - videoStreamID: 'typing.Union[None, Nullable, uint]' = None - audioStreamID: 'typing.Union[None, Nullable, uint]' = None + initialDuration: 'uint' = 0 + augmentationDuration: 'uint' = 0 + maxDuration: 'uint' = 0 + blindDuration: 'uint' = 0 + class Commands: @dataclass - class ProvideOffer(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000003 + class CreateTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000000 is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = 'ProvideOfferResponse' + response_type: typing.ClassVar[str] = 'CreateTwoDCartesianZoneResponse' @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), - ClusterObjectFieldDescriptor(Label="streamType", Tag=2, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=3, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=4, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="ICEServers", Tag=5, Type=typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]), - ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=6, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="zone", Tag=0, Type=ZoneManagement.Structs.TwoDCartesianZoneStruct), ]) - webRTCSessionID: 'typing.Union[Nullable, uint]' = NullValue - sdp: 'str' = "" - streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 - videoStreamID: 'typing.Union[None, Nullable, uint]' = None - audioStreamID: 'typing.Union[None, Nullable, uint]' = None - ICEServers: 'typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]' = None - ICETransportPolicy: 'typing.Optional[str]' = None - metadataOptions: 'typing.Optional[uint]' = None + zone: 'ZoneManagement.Structs.TwoDCartesianZoneStruct' = field(default_factory=lambda: ZoneManagement.Structs.TwoDCartesianZoneStruct()) @dataclass - class ProvideOfferResponse(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000004 + class CreateTwoDCartesianZoneResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000001 is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @@ -46709,19 +46719,15 @@ class ProvideOfferResponse(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), ]) - webRTCSessionID: 'uint' = 0 - videoStreamID: 'uint' = 0 - audioStreamID: 'uint' = 0 + zoneID: 'uint' = 0 @dataclass - class ProvideAnswer(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000005 + class UpdateTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000002 is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = None @@ -46729,35 +46735,49 @@ class ProvideAnswer(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="zone", Tag=1, Type=ZoneManagement.Structs.TwoDCartesianZoneStruct), ]) - webRTCSessionID: 'uint' = 0 - sdp: 'str' = "" + zoneID: 'uint' = 0 + zone: 'ZoneManagement.Structs.TwoDCartesianZoneStruct' = field(default_factory=lambda: ZoneManagement.Structs.TwoDCartesianZoneStruct()) @dataclass - class ProvideICECandidate(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000006 + class GetTwoDCartesianZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000003 is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'GetTwoDCartesianZoneResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=typing.Union[None, Nullable, uint]), + ]) + + zoneID: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class GetTwoDCartesianZoneResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="ICECandidate", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[ZoneManagement.Structs.TwoDCartesianZoneStruct]), ]) - webRTCSessionID: 'uint' = 0 - ICECandidate: 'str' = "" + zones: 'typing.List[ZoneManagement.Structs.TwoDCartesianZoneStruct]' = field(default_factory=lambda: []) @dataclass - class EndSession(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000553 - command_id: typing.ClassVar[int] = 0x00000007 + class RemoveZone(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000550 + command_id: typing.ClassVar[int] = 0x00000005 is_client: typing.ClassVar[bool] = True response_type: typing.ClassVar[str] = None @@ -46765,19 +46785,17 @@ class EndSession(ClusterCommand): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=WebRTCTransportProvider.Enums.WebRTCEndReasonEnum), + ClusterObjectFieldDescriptor(Label="zoneID", Tag=0, Type=uint), ]) - webRTCSessionID: 'uint' = 0 - reason: 'WebRTCTransportProvider.Enums.WebRTCEndReasonEnum' = 0 + zoneID: 'uint' = 0 class Attributes: @dataclass - class CurrentSessions(ClusterAttributeDescriptor): + class SupportedZoneSources(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46785,15 +46803,63 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]) + return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Enums.ZoneSourceEnum]) - value: 'typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]' = field(default_factory=lambda: []) + value: 'typing.List[ZoneManagement.Enums.ZoneSourceEnum]' = field(default_factory=lambda: []) + + @dataclass + class Zones(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]) + + value: 'typing.Optional[typing.List[ZoneManagement.Structs.ZoneInformationStruct]]' = None + + @dataclass + class TimeControl(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]) + + value: 'typing.List[ZoneManagement.Structs.ZoneTriggeringTimeControlStruct]' = field(default_factory=lambda: []) + + @dataclass + class Sensitivity(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46809,7 +46875,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class AcceptedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46825,7 +46891,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class EventList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46841,7 +46907,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class AttributeList(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46857,7 +46923,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class FeatureMap(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -46873,7 +46939,2362 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class ClusterRevision(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: - return 0x00000553 + return 0x00000550 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class ZoneTriggered(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=ZoneManagement.Enums.ZoneEventTriggeredReasonEnum), + ]) + + zones: 'typing.List[uint]' = field(default_factory=lambda: []) + reason: 'ZoneManagement.Enums.ZoneEventTriggeredReasonEnum' = 0 + + @dataclass + class ZoneStopped(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000550 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="zones", Tag=0, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=ZoneManagement.Enums.ZoneEventStoppedReasonEnum), + ]) + + zones: 'typing.List[uint]' = field(default_factory=lambda: []) + reason: 'ZoneManagement.Enums.ZoneEventStoppedReasonEnum' = 0 + + +@dataclass +class CameraAvStreamManagement(Cluster): + id: typing.ClassVar[int] = 0x00000551 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="maxConcurrentVideoEncoders", Tag=0x00000000, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxEncodedPixelRate", Tag=0x00000001, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="videoSensorParams", Tag=0x00000002, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]), + ClusterObjectFieldDescriptor(Label="nightVisionCapable", Tag=0x00000003, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="minViewport", Tag=0x00000004, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="rateDistortionTradeOffPoints", Tag=0x00000005, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]), + ClusterObjectFieldDescriptor(Label="maxPreRollBufferSize", Tag=0x00000006, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneCapabilities", Tag=0x00000007, Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), + ClusterObjectFieldDescriptor(Label="speakerCapabilities", Tag=0x00000008, Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]), + ClusterObjectFieldDescriptor(Label="twoWayTalkSupport", Tag=0x00000009, Type=typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]), + ClusterObjectFieldDescriptor(Label="supportedSnapshotParams", Tag=0x0000000A, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]), + ClusterObjectFieldDescriptor(Label="maxNetworkBandwidth", Tag=0x0000000B, Type=uint), + ClusterObjectFieldDescriptor(Label="currentFrameRate", Tag=0x0000000C, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="HDRModeEnabled", Tag=0x0000000D, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="currentVideoCodecs", Tag=0x0000000E, Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]), + ClusterObjectFieldDescriptor(Label="currentSnapshotConfig", Tag=0x0000000F, Type=typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]), + ClusterObjectFieldDescriptor(Label="fabricsUsingCamera", Tag=0x00000010, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="allocatedVideoStreams", Tag=0x00000011, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]), + ClusterObjectFieldDescriptor(Label="allocatedAudioStreams", Tag=0x00000012, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]), + ClusterObjectFieldDescriptor(Label="allocatedSnapshotStreams", Tag=0x00000013, Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]), + ClusterObjectFieldDescriptor(Label="rankedVideoStreamPrioritiesList", Tag=0x00000014, Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]), + ClusterObjectFieldDescriptor(Label="softRecordingPrivacyModeEnabled", Tag=0x00000015, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="softLivestreamPrivacyModeEnabled", Tag=0x00000016, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="hardPrivacyModeOn", Tag=0x00000017, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="nightVision", Tag=0x00000018, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="nightVisionIllum", Tag=0x00000019, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="AWBEnabled", Tag=0x0000001A, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="autoShutterSpeedEnabled", Tag=0x0000001B, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="autoISOEnabled", Tag=0x0000001C, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="viewport", Tag=0x0000001D, Type=typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]), + ClusterObjectFieldDescriptor(Label="speakerMuted", Tag=0x0000001E, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="speakerVolumeLevel", Tag=0x0000001F, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speakerMaxLevel", Tag=0x00000020, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="speakerMinLevel", Tag=0x00000021, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneMuted", Tag=0x00000022, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="microphoneVolumeLevel", Tag=0x00000023, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneMaxLevel", Tag=0x00000024, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneMinLevel", Tag=0x00000025, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="microphoneAGCEnabled", Tag=0x00000026, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="imageRotation", Tag=0x00000027, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="imageFlipHorizontal", Tag=0x00000028, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="imageFlipVertical", Tag=0x00000029, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="localVideoRecordingEnabled", Tag=0x0000002A, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="localSnapshotRecordingEnabled", Tag=0x0000002B, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="statusLightEnabled", Tag=0x0000002C, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="statusLightBrightness", Tag=0x0000002D, Type=typing.Optional[Globals.Enums.ThreeLevelAutoEnum]), + ClusterObjectFieldDescriptor(Label="depthSensorStatus", Tag=0x0000002E, Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + maxConcurrentVideoEncoders: 'typing.Optional[uint]' = None + maxEncodedPixelRate: 'typing.Optional[uint]' = None + videoSensorParams: 'typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]' = None + nightVisionCapable: 'typing.Optional[bool]' = None + minViewport: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + rateDistortionTradeOffPoints: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]' = None + maxPreRollBufferSize: 'typing.Optional[uint]' = None + microphoneCapabilities: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + speakerCapabilities: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + twoWayTalkSupport: 'typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]' = None + supportedSnapshotParams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]' = None + maxNetworkBandwidth: 'uint' = None + currentFrameRate: 'typing.Optional[uint]' = None + HDRModeEnabled: 'typing.Optional[bool]' = None + currentVideoCodecs: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]' = None + currentSnapshotConfig: 'typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]' = None + fabricsUsingCamera: 'typing.List[uint]' = None + allocatedVideoStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]' = None + allocatedAudioStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]' = None + allocatedSnapshotStreams: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]' = None + rankedVideoStreamPrioritiesList: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]' = None + softRecordingPrivacyModeEnabled: 'typing.Optional[bool]' = None + softLivestreamPrivacyModeEnabled: 'typing.Optional[bool]' = None + hardPrivacyModeOn: 'typing.Optional[bool]' = None + nightVision: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + nightVisionIllum: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + AWBEnabled: 'typing.Optional[bool]' = None + autoShutterSpeedEnabled: 'typing.Optional[bool]' = None + autoISOEnabled: 'typing.Optional[bool]' = None + viewport: 'typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]' = None + speakerMuted: 'typing.Optional[bool]' = None + speakerVolumeLevel: 'typing.Optional[uint]' = None + speakerMaxLevel: 'typing.Optional[uint]' = None + speakerMinLevel: 'typing.Optional[uint]' = None + microphoneMuted: 'typing.Optional[bool]' = None + microphoneVolumeLevel: 'typing.Optional[uint]' = None + microphoneMaxLevel: 'typing.Optional[uint]' = None + microphoneMinLevel: 'typing.Optional[uint]' = None + microphoneAGCEnabled: 'typing.Optional[bool]' = None + imageRotation: 'typing.Optional[uint]' = None + imageFlipHorizontal: 'typing.Optional[bool]' = None + imageFlipVertical: 'typing.Optional[bool]' = None + localVideoRecordingEnabled: 'typing.Optional[bool]' = None + localSnapshotRecordingEnabled: 'typing.Optional[bool]' = None + statusLightEnabled: 'typing.Optional[bool]' = None + statusLightBrightness: 'typing.Optional[Globals.Enums.ThreeLevelAutoEnum]' = None + depthSensorStatus: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class AudioCodecEnum(MatterIntEnum): + kOpus = 0x00 + kAacLc = 0x01 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 2 + + class ImageCodecEnum(MatterIntEnum): + kJpeg = 0x00 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 1 + + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4 + + class TriStateAutoEnum(MatterIntEnum): + kOff = 0x00 + kOn = 0x01 + kAuto = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class TwoWayTalkSupportTypeEnum(MatterIntEnum): + kNotSupported = 0x00 + kHalfDuplex = 0x01 + kFullDuplex = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 3 + + class VideoCodecEnum(MatterIntEnum): + kH264 = 0x00 + kHevc = 0x01 + kVvc = 0x02 + kAv1 = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4 + + class Bitmaps: + class Feature(IntFlag): + kPrivacy = 0x1 + kAudio = 0x2 + kSpeaker = 0x4 + kImageControl = 0x8 + kVideo = 0x10 + kSnapshot = 0x20 + kWatermark = 0x40 + kOnScreenDisplay = 0x80 + kLocalStorage = 0x100 + + class Structs: + @dataclass + class VideoResolutionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="width", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="height", Tag=1, Type=uint), + ]) + + width: 'uint' = 0 + height: 'uint' = 0 + + @dataclass + class VideoStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=2, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=6, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=9, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=10, Type=uint), + ClusterObjectFieldDescriptor(Label="watermarkEnabled", Tag=11, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="OSDEnabled", Tag=12, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=13, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + videoCodec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + minFrameRate: 'uint' = 0 + maxFrameRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + maxBitRate: 'uint' = 0 + minFragmentLen: 'uint' = 0 + maxFragmentLen: 'uint' = 0 + watermarkEnabled: 'typing.Optional[bool]' = None + OSDEnabled: 'typing.Optional[bool]' = None + referenceCount: 'uint' = 0 + + @dataclass + class SnapshotStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="quality", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=7, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + frameRate: 'uint' = 0 + bitRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + quality: 'uint' = 0 + referenceCount: 'uint' = 0 + + @dataclass + class SnapshotParamsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="resolution", Tag=0, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=2, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ]) + + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxFrameRate: 'uint' = 0 + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + + @dataclass + class RateDistortionTradeOffPointsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="codec", Tag=0, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="resolution", Tag=1, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=2, Type=uint), + ]) + + codec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + + @dataclass + class AudioCapabilitiesStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="maxNumberOfChannels", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="supportedCodecs", Tag=1, Type=typing.List[CameraAvStreamManagement.Enums.AudioCodecEnum]), + ClusterObjectFieldDescriptor(Label="supportedSampleRates", Tag=2, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="supportedBitDepths", Tag=3, Type=typing.List[uint]), + ]) + + maxNumberOfChannels: 'uint' = 0 + supportedCodecs: 'typing.List[CameraAvStreamManagement.Enums.AudioCodecEnum]' = field(default_factory=lambda: []) + supportedSampleRates: 'typing.List[uint]' = field(default_factory=lambda: []) + supportedBitDepths: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AudioStreamStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=2, Type=CameraAvStreamManagement.Enums.AudioCodecEnum), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=5, Type=uint), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="referenceCount", Tag=7, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + audioCodec: 'CameraAvStreamManagement.Enums.AudioCodecEnum' = 0 + channelCount: 'uint' = 0 + sampleRate: 'uint' = 0 + bitRate: 'uint' = 0 + bitDepth: 'uint' = 0 + referenceCount: 'uint' = 0 + + @dataclass + class VideoSensorParamsStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="sensorWidth", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sensorHeight", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="HDRCapable", Tag=2, Type=bool), + ClusterObjectFieldDescriptor(Label="maxFPS", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="maxHDRFPS", Tag=4, Type=uint), + ]) + + sensorWidth: 'uint' = 0 + sensorHeight: 'uint' = 0 + HDRCapable: 'bool' = False + maxFPS: 'uint' = 0 + maxHDRFPS: 'uint' = 0 + + @dataclass + class ViewportStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="x1", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="y1", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="x2", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="y2", Tag=3, Type=uint), + ]) + + x1: 'uint' = 0 + y1: 'uint' = 0 + x2: 'uint' = 0 + y2: 'uint' = 0 + + class Commands: + @dataclass + class AudioStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'AudioStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=1, Type=CameraAvStreamManagement.Enums.AudioCodecEnum), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=4, Type=uint), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=5, Type=uint), + ]) + + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + audioCodec: 'CameraAvStreamManagement.Enums.AudioCodecEnum' = 0 + channelCount: 'uint' = 0 + sampleRate: 'uint' = 0 + bitRate: 'uint' = 0 + bitDepth: 'uint' = 0 + + @dataclass + class AudioStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + + @dataclass + class AudioStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ]) + + audioStreamID: 'uint' = 0 + + @dataclass + class VideoStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'VideoStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=CameraAvStreamManagement.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=1, Type=CameraAvStreamManagement.Enums.VideoCodecEnum), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=6, Type=uint), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=7, Type=uint), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=8, Type=uint), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=9, Type=uint), + ClusterObjectFieldDescriptor(Label="watermarkEnabled", Tag=10, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="OSDEnabled", Tag=11, Type=typing.Optional[bool]), + ]) + + streamType: 'CameraAvStreamManagement.Enums.StreamTypeEnum' = 0 + videoCodec: 'CameraAvStreamManagement.Enums.VideoCodecEnum' = 0 + minFrameRate: 'uint' = 0 + maxFrameRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + minBitRate: 'uint' = 0 + maxBitRate: 'uint' = 0 + minFragmentLen: 'uint' = 0 + maxFragmentLen: 'uint' = 0 + watermarkEnabled: 'typing.Optional[bool]' = None + OSDEnabled: 'typing.Optional[bool]' = None + + @dataclass + class VideoStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + + @dataclass + class VideoStreamModify(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="resolution", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="watermarkEnabled", Tag=2, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="OSDEnabled", Tag=3, Type=typing.Optional[bool]), + ]) + + videoStreamID: 'uint' = 0 + resolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + watermarkEnabled: 'typing.Optional[bool]' = None + OSDEnabled: 'typing.Optional[bool]' = None + + @dataclass + class VideoStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ]) + + videoStreamID: 'uint' = 0 + + @dataclass + class SnapshotStreamAllocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'SnapshotStreamAllocateResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=0, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=3, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=4, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ClusterObjectFieldDescriptor(Label="quality", Tag=5, Type=uint), + ]) + + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + frameRate: 'uint' = 0 + bitRate: 'uint' = 0 + minResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + maxResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + quality: 'uint' = 0 + + @dataclass + class SnapshotStreamAllocateResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000008 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + + @dataclass + class SnapshotStreamDeallocate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000009 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ]) + + snapshotStreamID: 'uint' = 0 + + @dataclass + class SetStreamPriorities(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000A + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamPriorities", Tag=0, Type=typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]), + ]) + + streamPriorities: 'typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]' = field(default_factory=lambda: []) + + @dataclass + class CaptureSnapshot(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000B + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="requestedResolution", Tag=1, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ]) + + snapshotStreamID: 'uint' = 0 + requestedResolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + + @dataclass + class CaptureSnapshotResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000C + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="data", Tag=0, Type=bytes), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=CameraAvStreamManagement.Enums.ImageCodecEnum), + ClusterObjectFieldDescriptor(Label="resolution", Tag=2, Type=CameraAvStreamManagement.Structs.VideoResolutionStruct), + ]) + + data: 'bytes' = b"" + imageCodec: 'CameraAvStreamManagement.Enums.ImageCodecEnum' = 0 + resolution: 'CameraAvStreamManagement.Structs.VideoResolutionStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.VideoResolutionStruct()) + + @dataclass + class SetViewport(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000D + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="viewport", Tag=0, Type=CameraAvStreamManagement.Structs.ViewportStruct), + ]) + + viewport: 'CameraAvStreamManagement.Structs.ViewportStruct' = field(default_factory=lambda: CameraAvStreamManagement.Structs.ViewportStruct()) + + @dataclass + class SetImageRotation(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000E + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="angle", Tag=0, Type=uint), + ]) + + angle: 'uint' = 0 + + @dataclass + class SetImageFlipHorizontal(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x0000000F + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="enabled", Tag=0, Type=bool), + ]) + + enabled: 'bool' = False + + @dataclass + class SetImageFlipVertical(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000551 + command_id: typing.ClassVar[int] = 0x00000010 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="enabled", Tag=0, Type=bool), + ]) + + enabled: 'bool' = False + + class Attributes: + @dataclass + class MaxConcurrentVideoEncoders(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MaxEncodedPixelRate(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class VideoSensorParams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.VideoSensorParamsStruct]' = None + + @dataclass + class NightVisionCapable(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class MinViewport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + + @dataclass + class RateDistortionTradeOffPoints(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000005 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.RateDistortionTradeOffPointsStruct]]' = None + + @dataclass + class MaxPreRollBufferSize(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000006 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneCapabilities(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000007 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + + @dataclass + class SpeakerCapabilities(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000008 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.AudioCapabilitiesStruct]' = None + + @dataclass + class TwoWayTalkSupport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000009 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TwoWayTalkSupportTypeEnum]' = None + + @dataclass + class SupportedSnapshotParams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotParamsStruct]]' = None + + @dataclass + class MaxNetworkBandwidth(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class CurrentFrameRate(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class HDRModeEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class CurrentVideoCodecs(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.VideoCodecEnum]]' = None + + @dataclass + class CurrentSnapshotConfig(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000000F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.SnapshotParamsStruct]' = None + + @dataclass + class FabricsUsingCamera(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000010 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AllocatedVideoStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000011 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.VideoStreamStruct]]' = None + + @dataclass + class AllocatedAudioStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000012 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.AudioStreamStruct]]' = None + + @dataclass + class AllocatedSnapshotStreams(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000013 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Structs.SnapshotStreamStruct]]' = None + + @dataclass + class RankedVideoStreamPrioritiesList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000014 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]) + + value: 'typing.Optional[typing.List[CameraAvStreamManagement.Enums.StreamTypeEnum]]' = None + + @dataclass + class SoftRecordingPrivacyModeEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000015 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class SoftLivestreamPrivacyModeEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000016 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class HardPrivacyModeOn(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000017 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class NightVision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000018 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class NightVisionIllum(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000019 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class AWBEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class AutoShutterSpeedEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class AutoISOEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class Viewport(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]) + + value: 'typing.Optional[CameraAvStreamManagement.Structs.ViewportStruct]' = None + + @dataclass + class SpeakerMuted(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class SpeakerVolumeLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000001F + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeakerMaxLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000020 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class SpeakerMinLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000021 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneMuted(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000022 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class MicrophoneVolumeLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000023 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneMaxLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000024 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneMinLevel(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000025 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class MicrophoneAGCEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000026 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class ImageRotation(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000027 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + + @dataclass + class ImageFlipHorizontal(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000028 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class ImageFlipVertical(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000029 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class LocalVideoRecordingEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002A + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class LocalSnapshotRecordingEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002B + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class StatusLightEnabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002C + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) + + value: 'typing.Optional[bool]' = None + + @dataclass + class StatusLightBrightness(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[Globals.Enums.ThreeLevelAutoEnum]) + + value: 'typing.Optional[Globals.Enums.ThreeLevelAutoEnum]' = None + + @dataclass + class DepthSensorStatus(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000002E + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]) + + value: 'typing.Optional[CameraAvStreamManagement.Enums.TriStateAutoEnum]' = None + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + class Events: + @dataclass + class VideoStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]), + ClusterObjectFieldDescriptor(Label="videoCodec", Tag=2, Type=typing.Optional[CameraAvStreamManagement.Enums.VideoCodecEnum]), + ClusterObjectFieldDescriptor(Label="minFrameRate", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxFrameRate", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=5, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=6, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="minBitRate", Tag=7, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxBitRate", Tag=8, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minFragmentLen", Tag=9, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="maxFragmentLen", Tag=10, Type=typing.Optional[uint]), + ]) + + videoStreamID: 'uint' = 0 + streamType: 'typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]' = None + videoCodec: 'typing.Optional[CameraAvStreamManagement.Enums.VideoCodecEnum]' = None + minFrameRate: 'typing.Optional[uint]' = None + maxFrameRate: 'typing.Optional[uint]' = None + minResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + maxResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + minBitRate: 'typing.Optional[uint]' = None + maxBitRate: 'typing.Optional[uint]' = None + minFragmentLen: 'typing.Optional[uint]' = None + maxFragmentLen: 'typing.Optional[uint]' = None + + @dataclass + class AudioStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]), + ClusterObjectFieldDescriptor(Label="audioCodec", Tag=2, Type=typing.Optional[CameraAvStreamManagement.Enums.AudioCodecEnum]), + ClusterObjectFieldDescriptor(Label="channelCount", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="sampleRate", Tag=4, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=5, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitDepth", Tag=6, Type=typing.Optional[uint]), + ]) + + audioStreamID: 'uint' = 0 + streamType: 'typing.Optional[CameraAvStreamManagement.Enums.StreamTypeEnum]' = None + audioCodec: 'typing.Optional[CameraAvStreamManagement.Enums.AudioCodecEnum]' = None + channelCount: 'typing.Optional[uint]' = None + sampleRate: 'typing.Optional[uint]' = None + bitRate: 'typing.Optional[uint]' = None + bitDepth: 'typing.Optional[uint]' = None + + @dataclass + class SnapshotStreamChanged(ClusterEvent): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000551 + + @ChipUtility.classproperty + def event_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="snapshotStreamID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="imageCodec", Tag=1, Type=typing.Optional[CameraAvStreamManagement.Enums.ImageCodecEnum]), + ClusterObjectFieldDescriptor(Label="frameRate", Tag=2, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="bitRate", Tag=3, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="minResolution", Tag=4, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="maxResolution", Tag=5, Type=typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]), + ClusterObjectFieldDescriptor(Label="quality", Tag=6, Type=typing.Optional[uint]), + ]) + + snapshotStreamID: 'uint' = 0 + imageCodec: 'typing.Optional[CameraAvStreamManagement.Enums.ImageCodecEnum]' = None + frameRate: 'typing.Optional[uint]' = None + bitRate: 'typing.Optional[uint]' = None + minResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + maxResolution: 'typing.Optional[CameraAvStreamManagement.Structs.VideoResolutionStruct]' = None + quality: 'typing.Optional[uint]' = None + + +@dataclass +class WebRTCTransportProvider(Cluster): + id: typing.ClassVar[int] = 0x00000553 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="currentSessions", Tag=0x00000000, Type=typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + currentSessions: 'typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4 + + class WebRTCEndReasonEnum(MatterIntEnum): + kIceFailed = 0x00 + kIceTimeout = 0x01 + kUserHangup = 0x02 + kUserBusy = 0x03 + kReplaced = 0x04 + kNoUserMedia = 0x05 + kInviteTimeout = 0x06 + kAnsweredElsewhere = 0x07 + kOutOfResources = 0x08 + kMediaTimeout = 0x09 + kLowPower = 0x0A + kUnknownReason = 0x0B + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 12 + + class Bitmaps: + class WebRTCMetadataOptions(IntFlag): + kDataTLV = 0x1 + + class Structs: + @dataclass + class ICEServerStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="urls", Tag=1, Type=typing.List[str]), + ClusterObjectFieldDescriptor(Label="username", Tag=2, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="credential", Tag=3, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="caid", Tag=4, Type=typing.Optional[uint]), + ]) + + urls: 'typing.List[str]' = field(default_factory=lambda: []) + username: 'typing.Optional[str]' = None + credential: 'typing.Optional[str]' = None + caid: 'typing.Optional[uint]' = None + + @dataclass + class WebRTCSessionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="peerNodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="peerFabricIndex", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=4, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=5, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=6, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=uint), + ]) + + id: 'uint' = 0 + peerNodeID: 'uint' = 0 + peerFabricIndex: 'uint' = 0 + streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[Nullable, uint]' = NullValue + audioStreamID: 'typing.Union[Nullable, uint]' = NullValue + metadataOptions: 'uint' = 0 + + class Commands: + @dataclass + class SolicitOffer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'SolicitOfferResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="streamType", Tag=0, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="ICEServers", Tag=3, Type=typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]), + ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=4, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=5, Type=typing.Optional[uint]), + ]) + + streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[None, Nullable, uint]' = None + audioStreamID: 'typing.Union[None, Nullable, uint]' = None + ICEServers: 'typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]' = None + ICETransportPolicy: 'typing.Optional[str]' = None + metadataOptions: 'typing.Optional[uint]' = None + + @dataclass + class SolicitOfferResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="deferredOffer", Tag=1, Type=bool), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=2, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=3, Type=typing.Union[None, Nullable, uint]), + ]) + + webRTCSessionID: 'uint' = 0 + deferredOffer: 'bool' = False + videoStreamID: 'typing.Union[None, Nullable, uint]' = None + audioStreamID: 'typing.Union[None, Nullable, uint]' = None + + @dataclass + class ProvideOffer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'ProvideOfferResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="streamType", Tag=2, Type=WebRTCTransportProvider.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=3, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=4, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="ICEServers", Tag=5, Type=typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]), + ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=6, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=typing.Optional[uint]), + ]) + + webRTCSessionID: 'typing.Union[Nullable, uint]' = NullValue + sdp: 'str' = "" + streamType: 'WebRTCTransportProvider.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[None, Nullable, uint]' = None + audioStreamID: 'typing.Union[None, Nullable, uint]' = None + ICEServers: 'typing.Optional[typing.List[WebRTCTransportProvider.Structs.ICEServerStruct]]' = None + ICETransportPolicy: 'typing.Optional[str]' = None + metadataOptions: 'typing.Optional[uint]' = None + + @dataclass + class ProvideOfferResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=2, Type=uint), + ]) + + webRTCSessionID: 'uint' = 0 + videoStreamID: 'uint' = 0 + audioStreamID: 'uint' = 0 + + @dataclass + class ProvideAnswer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000005 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + sdp: 'str' = "" + + @dataclass + class ProvideICECandidate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000006 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="ICECandidate", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + ICECandidate: 'str' = "" + + @dataclass + class EndSession(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000553 + command_id: typing.ClassVar[int] = 0x00000007 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=WebRTCTransportProvider.Enums.WebRTCEndReasonEnum), + ]) + + webRTCSessionID: 'uint' = 0 + reason: 'WebRTCTransportProvider.Enums.WebRTCEndReasonEnum' = 0 + + class Attributes: + @dataclass + class CurrentSessions(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]) + + value: 'typing.List[WebRTCTransportProvider.Structs.WebRTCSessionStruct]' = field(default_factory=lambda: []) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000553 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + +@dataclass +class WebRTCTransportRequestor(Cluster): + id: typing.ClassVar[int] = 0x00000554 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="currentSessions", Tag=0x00000000, Type=typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + currentSessions: 'typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Enums: + class StreamTypeEnum(MatterIntEnum): + kInternal = 0x00 + kRecording = 0x01 + kAnalysis = 0x02 + kLiveView = 0x03 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 4 + + class WebRTCEndReasonEnum(MatterIntEnum): + kIceFailed = 0x00 + kIceTimeout = 0x01 + kUserHangup = 0x02 + kUserBusy = 0x03 + kReplaced = 0x04 + kNoUserMedia = 0x05 + kInviteTimeout = 0x06 + kAnsweredElsewhere = 0x07 + kOutOfResources = 0x08 + kMediaTimeout = 0x09 + kLowPower = 0x0A + kUnknownReason = 0x0B + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 12 + + class Bitmaps: + class WebRTCMetadataOptions(IntFlag): + kDataTLV = 0x1 + + class Structs: + @dataclass + class ICEServerStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="urls", Tag=1, Type=typing.List[str]), + ClusterObjectFieldDescriptor(Label="username", Tag=2, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="credential", Tag=3, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="caid", Tag=4, Type=typing.Optional[uint]), + ]) + + urls: 'typing.List[str]' = field(default_factory=lambda: []) + username: 'typing.Optional[str]' = None + credential: 'typing.Optional[str]' = None + caid: 'typing.Optional[uint]' = None + + @dataclass + class WebRTCSessionStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="id", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="peerNodeID", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="peerFabricIndex", Tag=3, Type=uint), + ClusterObjectFieldDescriptor(Label="streamType", Tag=4, Type=WebRTCTransportRequestor.Enums.StreamTypeEnum), + ClusterObjectFieldDescriptor(Label="videoStreamID", Tag=5, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="audioStreamID", Tag=6, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="metadataOptions", Tag=7, Type=uint), + ]) + + id: 'uint' = 0 + peerNodeID: 'uint' = 0 + peerFabricIndex: 'uint' = 0 + streamType: 'WebRTCTransportRequestor.Enums.StreamTypeEnum' = 0 + videoStreamID: 'typing.Union[Nullable, uint]' = NullValue + audioStreamID: 'typing.Union[Nullable, uint]' = NullValue + metadataOptions: 'uint' = 0 + + class Commands: + @dataclass + class Offer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="ICEServers", Tag=2, Type=typing.Optional[typing.List[WebRTCTransportRequestor.Structs.ICEServerStruct]]), + ClusterObjectFieldDescriptor(Label="ICETransportPolicy", Tag=3, Type=typing.Optional[str]), + ]) + + webRTCSessionID: 'uint' = 0 + sdp: 'str' = "" + ICEServers: 'typing.Optional[typing.List[WebRTCTransportRequestor.Structs.ICEServerStruct]]' = None + ICETransportPolicy: 'typing.Optional[str]' = None + + @dataclass + class Answer(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="sdp", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + sdp: 'str' = "" + + @dataclass + class ICECandidate(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000003 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="ICECandidate", Tag=1, Type=str), + ]) + + webRTCSessionID: 'uint' = 0 + ICECandidate: 'str' = "" + + @dataclass + class End(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000554 + command_id: typing.ClassVar[int] = 0x00000004 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="webRTCSessionID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="reason", Tag=1, Type=WebRTCTransportRequestor.Enums.WebRTCEndReasonEnum), + ]) + + webRTCSessionID: 'uint' = 0 + reason: 'WebRTCTransportRequestor.Enums.WebRTCEndReasonEnum' = 0 + + class Attributes: + @dataclass + class CurrentSessions(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]) + + value: 'typing.List[WebRTCTransportRequestor.Structs.WebRTCSessionStruct]' = field(default_factory=lambda: []) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000554 @ChipUtility.classproperty def attribute_id(cls) -> int: @@ -47747,7 +50168,7 @@ class SimpleEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 4 class Bitmaps: class Bitmap16MaskMap(IntFlag): @@ -50361,7 +52782,7 @@ class FaultType(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 5, + kUnknownEnumValue = 5 class Commands: @dataclass diff --git a/src/controller/python/chip/clusters/attribute.cpp b/src/controller/python/chip/clusters/attribute.cpp index 421284a0ae..a57da5d6d8 100644 --- a/src/controller/python/chip/clusters/attribute.cpp +++ b/src/controller/python/chip/clusters/attribute.cpp @@ -453,12 +453,20 @@ PyChipError pychip_WriteClient_WriteGroupAttributes(size_t groupIdSizeT, chip::C return ToPyChipError(err); } -void pychip_ReadClient_Abort(ReadClient * apReadClient, ReadClientCallback * apCallback) +void pychip_ReadClient_ShutdownSubscription(ReadClient * apReadClient) { - VerifyOrDie(apReadClient != nullptr); - VerifyOrDie(apCallback != nullptr); + // If apReadClient is nullptr, it means that its life cycle has ended (such as an error happend), and nothing needs to be done. + VerifyOrReturn(apReadClient != nullptr); + // If it is not SubscriptionType, this function should not be executed. + VerifyOrDie(apReadClient->IsSubscriptionType()); - delete apCallback; + Optional subscriptionId = apReadClient->GetSubscriptionId(); + VerifyOrDie(subscriptionId.HasValue()); + + FabricIndex fabricIndex = apReadClient->GetFabricIndex(); + NodeId nodeId = apReadClient->GetPeerNodeId(); + + InteractionModelEngine::GetInstance()->ShutdownSubscription(ScopedNodeId(nodeId, fabricIndex), subscriptionId.Value()); } void pychip_ReadClient_OverrideLivenessTimeout(ReadClient * pReadClient, uint32_t livenessTimeoutMs) @@ -497,10 +505,10 @@ void pychip_ReadClient_GetSubscriptionTimeoutMs(ReadClient * pReadClient, uint32 } } -PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient, ReadClientCallback ** pCallback, - DeviceProxy * device, uint8_t * readParamsBuf, void ** attributePathsFromPython, - size_t numAttributePaths, void ** dataversionFiltersFromPython, size_t numDataversionFilters, - void ** eventPathsFromPython, size_t numEventPaths, uint64_t * eventNumberFilter) +PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient, DeviceProxy * device, uint8_t * readParamsBuf, + void ** attributePathsFromPython, size_t numAttributePaths, void ** dataversionFiltersFromPython, + size_t numDataversionFilters, void ** eventPathsFromPython, size_t numEventPaths, + uint64_t * eventNumberFilter) { CHIP_ERROR err = CHIP_NO_ERROR; PyReadAttributeParams pyParams = {}; @@ -612,7 +620,6 @@ PyChipError pychip_ReadClient_Read(void * appContext, ReadClient ** pReadClient, } *pReadClient = readClient.get(); - *pCallback = callback.get(); callback->AdoptReadClient(std::move(readClient)); diff --git a/src/controller/python/templates/partials/enum_def.zapt b/src/controller/python/templates/partials/enum_def.zapt index d8063739e1..01fbc62e6e 100644 --- a/src/controller/python/templates/partials/enum_def.zapt +++ b/src/controller/python/templates/partials/enum_def.zapt @@ -8,7 +8,7 @@ # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving an unknown # enum value. This specific value should never be transmitted. - kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}}, + kUnknownEnumValue = {{first_unused_enum_value mode="first_unused"}} {{else}} # kUnknownEnumValue intentionally not defined. This enum never goes # through DataModel::Decode, likely because it is a part of a derived diff --git a/src/controller/python/test/test_scripts/mobile-device-test.py b/src/controller/python/test/test_scripts/mobile-device-test.py index 5515fa1ba0..cb032bc3ac 100755 --- a/src/controller/python/test/test_scripts/mobile-device-test.py +++ b/src/controller/python/test/test_scripts/mobile-device-test.py @@ -33,7 +33,7 @@ # --disable-test ClusterObjectTests.TestTimedRequestTimeout # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === diff --git a/src/crypto/CHIPCryptoPALPSA.cpp b/src/crypto/CHIPCryptoPALPSA.cpp index 99b947c18f..ba34669a51 100644 --- a/src/crypto/CHIPCryptoPALPSA.cpp +++ b/src/crypto/CHIPCryptoPALPSA.cpp @@ -472,7 +472,7 @@ CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * pass, size_t pass_length for (uint32_t blockNo = 1; key_length != 0; ++blockNo) { - uint8_t in[chip::max(kMacLength, kSpake2p_Max_PBKDF_Salt_Length + 4)]; + uint8_t in[std::max(kMacLength, kSpake2p_Max_PBKDF_Salt_Length + 4)]; size_t inLength = salt_length + 4; uint8_t out[kMacLength]; size_t outLength; @@ -495,7 +495,7 @@ CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * pass, size_t pass_length inLength = outLength; } - const size_t usedKeyLength = chip::min(key_length, kMacLength); + const size_t usedKeyLength = std::min(key_length, kMacLength); memcpy(key, result, usedKeyLength); key += usedKeyLength; key_length -= usedKeyLength; diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 5975872589..a298b29684 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -232,6 +232,11 @@ - (void)onDone @end +@interface MTRBaseDevice () +// Will return nil if our controller is not in fact a concrete controller. +@property (nullable, nonatomic, strong, readonly) MTRDeviceController_Concrete * concreteController; +@end + @implementation MTRBaseDevice - (instancetype)initWithPASEDevice:(chip::DeviceProxy *)device controller:(MTRDeviceController *)controller @@ -261,9 +266,24 @@ + (MTRBaseDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceCont return [controller baseDeviceForNodeID:nodeID]; } +- (nullable MTRDeviceController_Concrete *)concreteController +{ + auto * controller = self.deviceController; + if ([controller isKindOfClass:MTRDeviceController_Concrete.class]) { + return static_cast(controller); + } + + return nil; +} + - (MTRTransportType)sessionTransportType { - return [self.deviceController sessionTransportTypeForDevice:self]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Unable to determine session transport type for MTRBaseDevice created with an XPC controller"); + return MTRTransportTypeUndefined; + } + return [concreteController sessionTransportTypeForDevice:self]; } - (void)invalidateCASESession @@ -272,7 +292,14 @@ - (void)invalidateCASESession return; } - [self.deviceController invalidateCASESessionForNode:self.nodeID]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // Nothing we can do here. + MTR_LOG_ERROR("Unable invalidate CASE session for MTRBaseDevice created with an XPC controller"); + return; + } + + [concreteController invalidateCASESessionForNode:@(self.nodeID)]; } namespace { @@ -311,121 +338,131 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // No subscriptions (or really any MTRBaseDevice use) with XPC controllers. + MTR_LOG_ERROR("Unable to create subscription for MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + // Copy params before going async. params = [params copy]; - [self.deviceController getSessionForNode:self.nodeID - completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, - NSError * _Nullable error, NSNumber * _Nullable retryDelay) { - if (error != nil) { - dispatch_async(queue, ^{ - errorHandler(error); - }); - return; - } - - // Wildcard endpoint, cluster, attribute, event. - auto attributePath = std::make_unique(); - auto eventPath = std::make_unique(); - eventPath->mIsUrgentEvent = params.reportEventsUrgently; - ReadPrepareParams readParams(session.Value()); - [params toReadPrepareParams:readParams]; - readParams.mpAttributePathParamsList = attributePath.get(); - readParams.mAttributePathParamsListSize = 1; - readParams.mpEventPathParamsList = eventPath.get(); - readParams.mEventPathParamsListSize = 1; - - std::unique_ptr clusterStateCache; - ReadClient::Callback * callbackForReadClient = nullptr; - OnDoneHandler onDoneHandler = nil; - - if (clusterStateCacheContainer) { - __weak MTRClusterStateCacheContainer * weakPtr = clusterStateCacheContainer; - onDoneHandler = ^{ - // This, like all manipulation of cppClusterStateCache, needs to run on the Matter - // queue. - MTRClusterStateCacheContainer * container = weakPtr; - if (container) { - container.cppClusterStateCache = nullptr; - container.baseDevice = nil; - } - }; - } - - auto callback = std::make_unique( - ^(NSArray * value) { - dispatch_async(queue, ^{ - if (attributeReportHandler != nil) { - attributeReportHandler(value); - } - }); - }, - ^(NSArray * value) { - dispatch_async(queue, ^{ - if (eventReportHandler != nil) { - eventReportHandler(value); - } - }); - }, - ^(NSError * error) { - dispatch_async(queue, ^{ - errorHandler(error); - }); - }, - ^(NSError * error, NSNumber * resubscriptionDelay) { - dispatch_async(queue, ^{ - if (resubscriptionScheduled != nil) { - resubscriptionScheduled(error, resubscriptionDelay); - } - }); - }, - ^(void) { - dispatch_async(queue, ^{ - if (subscriptionEstablished != nil) { - subscriptionEstablished(); - } - }); - }, - onDoneHandler); - - if (clusterStateCacheContainer) { - clusterStateCache = std::make_unique(*callback.get()); - callbackForReadClient = &clusterStateCache->GetBufferedCallback(); - } else { - callbackForReadClient = &callback->GetBufferedCallback(); - } - - auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), - exchangeManager, *callbackForReadClient, ReadClient::InteractionType::Subscribe); - - CHIP_ERROR err; - if (!params.resubscribeAutomatically) { - err = readClient->SendRequest(readParams); - } else { - // SendAutoResubscribeRequest cleans up the params, even on failure. - attributePath.release(); - eventPath.release(); - err = readClient->SendAutoResubscribeRequest(std::move(readParams)); - } - - if (err != CHIP_NO_ERROR) { - dispatch_async(queue, ^{ - errorHandler([MTRError errorForCHIPErrorCode:err]); - }); - - return; - } - - if (clusterStateCacheContainer) { - clusterStateCacheContainer.cppClusterStateCache = clusterStateCache.get(); - // ClusterStateCache will be deleted when OnDone is called. - callback->AdoptClusterStateCache(std::move(clusterStateCache)); - clusterStateCacheContainer.baseDevice = self; - } - // Callback and ReadClient will be deleted when OnDone is called. - callback->AdoptReadClient(std::move(readClient)); - callback.release(); - }]; + [concreteController getSessionForNode:self.nodeID + completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, + NSError * _Nullable error, NSNumber * _Nullable retryDelay) { + if (error != nil) { + dispatch_async(queue, ^{ + errorHandler(error); + }); + return; + } + + // Wildcard endpoint, cluster, attribute, event. + auto attributePath = std::make_unique(); + auto eventPath = std::make_unique(); + eventPath->mIsUrgentEvent = params.reportEventsUrgently; + ReadPrepareParams readParams(session.Value()); + [params toReadPrepareParams:readParams]; + readParams.mpAttributePathParamsList = attributePath.get(); + readParams.mAttributePathParamsListSize = 1; + readParams.mpEventPathParamsList = eventPath.get(); + readParams.mEventPathParamsListSize = 1; + + std::unique_ptr clusterStateCache; + ReadClient::Callback * callbackForReadClient = nullptr; + OnDoneHandler onDoneHandler = nil; + + if (clusterStateCacheContainer) { + __weak MTRClusterStateCacheContainer * weakPtr = clusterStateCacheContainer; + onDoneHandler = ^{ + // This, like all manipulation of cppClusterStateCache, needs to run on the Matter + // queue. + MTRClusterStateCacheContainer * container = weakPtr; + if (container) { + container.cppClusterStateCache = nullptr; + container.baseDevice = nil; + } + }; + } + + auto callback = std::make_unique( + ^(NSArray * value) { + dispatch_async(queue, ^{ + if (attributeReportHandler != nil) { + attributeReportHandler(value); + } + }); + }, + ^(NSArray * value) { + dispatch_async(queue, ^{ + if (eventReportHandler != nil) { + eventReportHandler(value); + } + }); + }, + ^(NSError * error) { + dispatch_async(queue, ^{ + errorHandler(error); + }); + }, + ^(NSError * error, NSNumber * resubscriptionDelay) { + dispatch_async(queue, ^{ + if (resubscriptionScheduled != nil) { + resubscriptionScheduled(error, resubscriptionDelay); + } + }); + }, + ^(void) { + dispatch_async(queue, ^{ + if (subscriptionEstablished != nil) { + subscriptionEstablished(); + } + }); + }, + onDoneHandler); + + if (clusterStateCacheContainer) { + clusterStateCache = std::make_unique(*callback.get()); + callbackForReadClient = &clusterStateCache->GetBufferedCallback(); + } else { + callbackForReadClient = &callback->GetBufferedCallback(); + } + + auto readClient = std::make_unique(InteractionModelEngine::GetInstance(), + exchangeManager, *callbackForReadClient, ReadClient::InteractionType::Subscribe); + + CHIP_ERROR err; + if (!params.resubscribeAutomatically) { + err = readClient->SendRequest(readParams); + } else { + // SendAutoResubscribeRequest cleans up the params, even on failure. + attributePath.release(); + eventPath.release(); + err = readClient->SendAutoResubscribeRequest(std::move(readParams)); + } + + if (err != CHIP_NO_ERROR) { + dispatch_async(queue, ^{ + errorHandler([MTRError errorForCHIPErrorCode:err]); + }); + + return; + } + + if (clusterStateCacheContainer) { + clusterStateCacheContainer.cppClusterStateCache = clusterStateCache.get(); + // ClusterStateCache will be deleted when OnDone is called. + callback->AdoptClusterStateCache(std::move(clusterStateCache)); + clusterStateCacheContainer.baseDevice = self; + } + // Callback and ReadClient will be deleted when OnDone is called. + callback->AdoptReadClient(std::move(readClient)); + callback.release(); + }]; } static NSDictionary * _MakeDataValueDictionary(NSString * type, id _Nullable value, NSNumber * _Nullable dataVersion) @@ -1616,6 +1653,16 @@ - (void)subscribeToAttributePaths:(NSArray * _Nullabl return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + // No subscriptions (or really any MTRBaseDevice use) with XPC controllers. + MTR_LOG_ERROR("Unable to create subscription for MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + reportHandler(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + // Copy params before going async. NSArray * attributes = nil; if (attributePaths != nil) { @@ -1629,7 +1676,7 @@ - (void)subscribeToAttributePaths:(NSArray * _Nullabl params = (params == nil) ? nil : [params copy]; - [self.deviceController + [concreteController getSessionForNode:self.nodeID completion:^(ExchangeManager * _Nullable exchangeManager, const Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { @@ -1847,7 +1894,7 @@ NSTimeInterval MTRTimeIntervalForEventTimestampValue(uint64_t timeValue) uint64_t eventTimestampValueSeconds = timeValue / chip::kMillisecondsPerSecond; uint64_t eventTimestampValueRemainderMilliseconds = timeValue % chip::kMillisecondsPerSecond; NSTimeInterval eventTimestampValueRemainder - = NSTimeInterval(eventTimestampValueRemainderMilliseconds) / chip::kMillisecondsPerSecond; + = NSTimeInterval(eventTimestampValueRemainderMilliseconds) / static_cast(chip::kMillisecondsPerSecond); NSTimeInterval eventTimestampValue = eventTimestampValueSeconds + eventTimestampValueRemainder; return eventTimestampValue; @@ -1890,6 +1937,16 @@ - (void)_openCommissioningWindowWithSetupPasscode:(nullable NSNumber *)setupPass return; } + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Can't open a commissioning window via MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + MATTER_LOG_METRIC_END(kMetricOpenPairingWindow, CHIP_ERROR_INCORRECT_STATE); + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + unsigned long long durationVal = [duration unsignedLongLongValue]; if (!CanCastTo(durationVal)) { MTR_LOG_ERROR("Error: Duration %llu is too large.", durationVal); @@ -1925,7 +1982,7 @@ - (void)_openCommissioningWindowWithSetupPasscode:(nullable NSNumber *)setupPass passcode.Emplace(static_cast(passcodeVal)); } - [self.deviceController + [concreteController asyncGetCommissionerOnMatterQueue:^(Controller::DeviceCommissioner * commissioner) { auto resultCallback = ^(CHIP_ERROR status, const SetupPayload & payload) { if (status != CHIP_NO_ERROR) { @@ -2175,11 +2232,20 @@ - (void)downloadLogOfType:(MTRDiagnosticLogType)type queue:(dispatch_queue_t)queue completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion { - [_deviceController downloadLogFromNodeWithID:@(_nodeID) - type:type - timeout:timeout - queue:queue - completion:completion]; + auto * concreteController = self.concreteController; + if (concreteController == nil) { + MTR_LOG_ERROR("Can't download logs via MTRBaseDevice created with an XPC controller"); + dispatch_async(queue, ^{ + completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); + }); + return; + } + + [concreteController downloadLogFromNodeWithID:@(_nodeID) + type:type + timeout:timeout + queue:queue + completion:completion]; } - (NSString *)description @@ -2302,6 +2368,45 @@ - (void)deregisterReportHandlersWithClientQueue:(dispatch_queue_t)queue completi @end +static NSString * FormatPossiblyWildcardEndpoint(NSNumber * _Nullable possiblyWildcardEndpoint) +{ + if (possiblyWildcardEndpoint == nil) { + return @"wildcard"; + } + + return [NSString stringWithFormat:@"%u", possiblyWildcardEndpoint.unsignedShortValue]; +} + +static NSString * FormatPossiblyWildcardCluster(NSNumber * _Nullable possiblyWildcardCluster) +{ + if (possiblyWildcardCluster == nil) { + return @"wildcard"; + } + + return [NSString stringWithFormat:@"0x%llx (%llu, %@)", + possiblyWildcardCluster.unsignedLongLongValue, + possiblyWildcardCluster.unsignedLongLongValue, + MTRClusterNameForID(static_cast(possiblyWildcardCluster.unsignedLongLongValue))]; +} + +static NSString * FormatPossiblyWildcardClusterElement(NSNumber * _Nullable possiblyWildcardCluster, NSNumber * _Nullable possiblyWildcardElement, NSString * (^nameGetter)(MTRClusterIDType clusterID, NSNumber * elementID)) +{ + if (possiblyWildcardElement == nil) { + return @"wildcard"; + } + + if (possiblyWildcardCluster == nil) { + // We can't get a useful name for this, so just return the numeric + // value. + return [NSString stringWithFormat:@"0x%llx (%llu)", possiblyWildcardElement.unsignedLongLongValue, possiblyWildcardElement.unsignedLongLongValue]; + } + + return [NSString stringWithFormat:@"0x%llx (%llu, %@)", + possiblyWildcardElement.unsignedLongLongValue, + possiblyWildcardElement.unsignedLongLongValue, + nameGetter(static_cast(possiblyWildcardCluster.unsignedLongLongValue), possiblyWildcardElement)]; +} + @implementation MTRAttributeRequestPath - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID clusterID:(NSNumber * _Nullable)clusterID @@ -2315,9 +2420,12 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@"", - _endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, - _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue]; + NSString * endpointStr = FormatPossiblyWildcardEndpoint(_endpoint); + NSString * clusterStr = FormatPossiblyWildcardCluster(_cluster); + NSString * attributeStr = FormatPossiblyWildcardClusterElement(_cluster, _attribute, ^(MTRClusterIDType clusterID, NSNumber * attributeID) { + return MTRAttributeNameForID(clusterID, static_cast(attributeID.unsignedLongLongValue)); + }); + return [NSString stringWithFormat:@"", endpointStr, clusterStr, attributeStr]; } + (MTRAttributeRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID @@ -2439,9 +2547,12 @@ - (instancetype)initWithEndpointID:(NSNumber * _Nullable)endpointID - (NSString *)description { - return [NSString stringWithFormat:@"", - _endpoint.unsignedShortValue, _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, - _event.unsignedLongLongValue, _event.unsignedLongLongValue]; + NSString * endpointStr = FormatPossiblyWildcardEndpoint(_endpoint); + NSString * clusterStr = FormatPossiblyWildcardCluster(_cluster); + NSString * eventStr = FormatPossiblyWildcardClusterElement(_cluster, _event, ^(MTRClusterIDType clusterID, NSNumber * eventID) { + return MTREventNameForID(clusterID, static_cast(eventID.unsignedLongLongValue)); + }); + return [NSString stringWithFormat:@"", endpointStr, clusterStr, eventStr]; } + (MTREventRequestPath *)requestPathWithEndpointID:(NSNumber * _Nullable)endpointID @@ -2561,8 +2672,9 @@ - (instancetype)initWithPath:(const ConcreteClusterPath &)path - (NSString *)description { - return [NSString stringWithFormat:@"", _endpoint.unsignedShortValue, - _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue]; + return [NSString stringWithFormat:@"", _endpoint.unsignedShortValue, + _cluster.unsignedLongLongValue, _cluster.unsignedLongLongValue, + MTRClusterNameForID(static_cast(_cluster.unsignedLongLongValue))]; } + (MTRClusterPath *)clusterPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID @@ -2646,9 +2758,11 @@ - (instancetype)initWithPath:(const ConcreteDataAttributePath &)path - (NSString *)description { - return [NSString stringWithFormat:@"", - self.endpoint.unsignedShortValue, self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, - _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue]; + return [NSString stringWithFormat:@"", + self.endpoint.unsignedShortValue, + self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, MTRClusterNameForID(static_cast(self.cluster.unsignedLongLongValue)), + _attribute.unsignedLongLongValue, _attribute.unsignedLongLongValue, + MTRAttributeNameForID(static_cast(self.cluster.unsignedLongLongValue), static_cast(_attribute.unsignedLongLongValue))]; } + (MTRAttributePath *)attributePathWithEndpointID:(NSNumber *)endpointID @@ -2743,8 +2857,11 @@ - (instancetype)initWithPath:(const ConcreteEventPath &)path - (NSString *)description { return - [NSString stringWithFormat:@"", self.endpoint.unsignedShortValue, - self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, _event.unsignedLongLongValue, _event.unsignedLongLongValue]; + [NSString stringWithFormat:@"", + self.endpoint.unsignedShortValue, + self.cluster.unsignedLongLongValue, self.cluster.unsignedLongLongValue, MTRClusterNameForID(static_cast(self.cluster.unsignedLongLongValue)), + _event.unsignedLongLongValue, _event.unsignedLongLongValue, + MTREventNameForID(static_cast(self.cluster.unsignedLongLongValue), static_cast(_event.unsignedLongLongValue))]; } + (MTREventPath *)eventPathWithEndpointID:(NSNumber *)endpointID clusterID:(NSNumber *)clusterID eventID:(NSNumber *)eventID diff --git a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h index 6631e2d132..d9c98157c2 100644 --- a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h +++ b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase.h @@ -81,6 +81,9 @@ class MTRCallbackBridgeBase { { LogRequestStart(); + // TODO: Figure out whether we can usefully get an MTRDeviceController_Concrete in here, so + // we can move getSessionForCommissioneeDevice off of MTRDeviceController_Internal. Ideally + // without bloating this inline method too much. [device.deviceController getSessionForCommissioneeDevice:device.nodeID completion:^(chip::Messaging::ExchangeManager * exchangeManager, const chip::Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { @@ -92,6 +95,8 @@ class MTRCallbackBridgeBase { { LogRequestStart(); + // TODO: Figure out whether we can usefully get an MTRDeviceController_Concrete in here, so + // we can move getSessionForNode off of MTRDeviceController_Internal. [controller getSessionForNode:nodeID completion:^(chip::Messaging::ExchangeManager * _Nullable exchangeManager, const chip::Optional & session, NSError * _Nullable error, NSNumber * _Nullable retryDelay) { diff --git a/src/darwin/Framework/CHIP/MTRConversion.h b/src/darwin/Framework/CHIP/MTRConversion.h index b0cf1afea4..e576b4f53e 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.h +++ b/src/darwin/Framework/CHIP/MTRConversion.h @@ -38,7 +38,8 @@ AsNumber(chip::Optional optional) inline NSDate * MatterEpochSecondsAsDate(uint32_t matterEpochSeconds) { - return [NSDate dateWithTimeIntervalSince1970:(chip::kChipEpochSecondsSinceUnixEpoch + (NSTimeInterval) matterEpochSeconds)]; + const auto interval = static_cast(chip::kChipEpochSecondsSinceUnixEpoch) + static_cast(matterEpochSeconds); + return [NSDate dateWithTimeIntervalSince1970:(NSTimeInterval) interval]; } template diff --git a/src/darwin/Framework/CHIP/MTRConversion.mm b/src/darwin/Framework/CHIP/MTRConversion.mm index 5e657b9330..3b0b734431 100644 --- a/src/darwin/Framework/CHIP/MTRConversion.mm +++ b/src/darwin/Framework/CHIP/MTRConversion.mm @@ -92,7 +92,7 @@ bool DateToMatterEpochMilliseconds(NSDate * date, uint64_t & matterEpochMillisec bool DateToMatterEpochMicroseconds(NSDate * date, uint64_t & matterEpochMicroseconds) { - uint64_t timeSinceUnixEpoch = static_cast(date.timeIntervalSince1970 * chip::kMicrosecondsPerSecond); + uint64_t timeSinceUnixEpoch = static_cast(date.timeIntervalSince1970 * static_cast(chip::kMicrosecondsPerSecond)); if (timeSinceUnixEpoch < chip::kChipEpochUsSinceUnixEpoch) { // This is a pre-Matter-epoch time, and cannot be represented as an epoch time value. return false; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index a1872c3020..5695ef23c7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -43,7 +43,6 @@ #import "MTRLogging_Internal.h" #import "MTRMetricKeys.h" #import "MTRMetricsCollector.h" -#import "MTROperationalCredentialsDelegate.h" #import "MTRP256KeypairBridge.h" #import "MTRPersistentStorageDelegateBridge.h" #import "MTRServerEndpoint_Internal.h" @@ -120,11 +119,9 @@ - (instancetype)initWithDelegate:(id)delegate queue @end @implementation MTRDeviceController { - chip::Controller::DeviceCommissioner * _cppCommissioner; chip::Credentials::PartialDACVerifier * _partialDACVerifier; chip::Credentials::DefaultDACVerifier * _defaultDACVerifier; MTRDeviceControllerDelegateBridge * _deviceControllerDelegateBridge; - MTROperationalCredentialsDelegate * _operationalCredentialsDelegate; MTRDeviceAttestationDelegateBridge * _deviceAttestationDelegateBridge; os_unfair_lock _underlyingDeviceMapLock; MTRCommissionableBrowser * _commissionableBrowser; @@ -208,7 +205,8 @@ - (NSString *)description - (BOOL)isRunning { - return _cppCommissioner != nullptr; + MTR_ABSTRACT_METHOD(); + return NO; } #pragma mark - Suspend/resume support @@ -315,19 +313,13 @@ - (void)_controllerResumed - (void)shutdown { - // Subclass hook; nothing to do. + [self _clearDeviceControllerDelegates]; } -- (NSNumber *)controllerNodeID +- (nullable NSNumber *)controllerNodeID { - auto block = ^NSNumber * { return @(self->_cppCommissioner->GetNodeId()); }; - - NSNumber * nodeID = [self syncRunOnWorkQueueWithReturnValue:block error:nil]; - if (!nodeID) { - MTR_LOG_ERROR("%@ A controller has no node id if it has not been started", self); - } - - return nodeID; + MTR_ABSTRACT_METHOD(); + return nil; } - (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload @@ -449,18 +441,6 @@ - (void)removeDevice:(MTRDevice *)device } } -#ifdef DEBUG -- (NSDictionary *)unitTestGetDeviceAttributeCounts -{ - std::lock_guard lock(*self.deviceMapLock); - NSMutableDictionary * deviceAttributeCounts = [NSMutableDictionary dictionary]; - for (NSNumber * nodeID in _nodeIDToDeviceMap) { - deviceAttributeCounts[nodeID] = @([[_nodeIDToDeviceMap objectForKey:nodeID] unitTestAttributeCount]); - } - return deviceAttributeCounts; -} -#endif - - (BOOL)setOperationalCertificateIssuer:(nullable id)operationalCertificateIssuer queue:(nullable dispatch_queue_t)queue { @@ -567,56 +547,9 @@ - (void)getSessionForCommissioneeDevice:(chip::NodeId)deviceID completion:(MTRIn completion(nullptr, chip::NullOptional, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); } -- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device -{ - VerifyOrReturnValue([self checkIsRunning], MTRTransportTypeUndefined); - - __block MTRTransportType result = MTRTransportTypeUndefined; - dispatch_sync(_chipWorkQueue, ^{ - VerifyOrReturn([self checkIsRunning]); - - if (device.isPASEDevice) { - chip::CommissioneeDeviceProxy * deviceProxy; - VerifyOrReturn(CHIP_NO_ERROR == self->_cppCommissioner->GetDeviceBeingCommissioned(device.nodeID, &deviceProxy)); - result = MTRMakeTransportType(deviceProxy->GetDeviceTransportType()); - } else { - auto scopedNodeID = self->_cppCommissioner->GetPeerScopedId(device.nodeID); - auto sessionHandle = self->_cppCommissioner->SessionMgr()->FindSecureSessionForNode(scopedNodeID); - VerifyOrReturn(sessionHandle.HasValue()); - result = MTRMakeTransportType(sessionHandle.Value()->AsSecureSession()->GetPeerAddress().GetTransportType()); - } - }); - return result; -} - -- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block - errorHandler:(nullable MTRDeviceErrorHandler)errorHandler -{ - { - NSError * error; - if (![self checkIsRunning:&error]) { - if (errorHandler != nil) { - errorHandler(error); - } - return; - } - } - - dispatch_async(_chipWorkQueue, ^{ - NSError * error; - if (![self checkIsRunning:&error]) { - if (errorHandler != nil) { - errorHandler(error); - } - return; - } - - block(self->_cppCommissioner); - }); -} - - (void)asyncDispatchToMatterQueue:(dispatch_block_t)block errorHandler:(nullable MTRDeviceErrorHandler)errorHandler { + // TODO: Figure out how to get callsites to have an MTRDeviceController_Concrete. MTR_ABSTRACT_METHOD(); errorHandler([MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); } @@ -666,68 +599,6 @@ - (nullable NSNumber *)compressedFabricID return storedValue.has_value() ? @(storedValue.value()) : nil; } -- (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; -{ - auto block = ^{ - auto sessionMgr = self->_cppCommissioner->SessionMgr(); - VerifyOrDie(sessionMgr != nullptr); - - sessionMgr->MarkSessionsAsDefunct( - self->_cppCommissioner->GetPeerScopedId(nodeID), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); - }; - - [self syncRunOnWorkQueue:block error:nil]; -} - -- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID - type:(MTRDiagnosticLogType)type - timeout:(NSTimeInterval)timeout - queue:(dispatch_queue_t)queue - completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion -{ - MTR_ABSTRACT_METHOD(); - dispatch_async(queue, ^{ - completion(nil, [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]); - }); -} - -- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath -{ - assertChipStackLockedByCurrentThread(); - - for (MTRServerEndpoint * endpoint in _serverEndpoints) { - if ([clusterPath.endpoint isEqual:endpoint.endpointID]) { - return [endpoint matterAccessGrantsForCluster:clusterPath.cluster]; - } - } - - // Nothing matched, no grants. - return @[]; -} - -- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID -{ - assertChipStackLockedByCurrentThread(); - - for (MTRServerEndpoint * endpoint in _serverEndpoints) { - for (MTRServerCluster * cluster in endpoint.serverClusters) { - if (![cluster.clusterID isEqual:clusterID]) { - continue; - } - - for (MTRServerAttribute * attr in cluster.attributes) { - if (![attr.attributeID isEqual:attributeID]) { - continue; - } - - return @(attr.requiredReadPrivilege); - } - } - } - - return nil; -} - #ifdef DEBUG + (void)forceLocalhostAdvertisingOnly { @@ -800,6 +671,14 @@ - (void)removeDeviceControllerDelegate:(id)delegate } } +- (void)_clearDeviceControllerDelegates +{ + @synchronized(self) { + _strongDelegateForSetDelegateAPI = nil; + [_delegates removeAllObjects]; + } +} + // Iterates the delegates, and remove delegate info objects if the delegate object has dealloc'ed // Returns number of delegates called - (NSUInteger)_iterateDelegateInfoWithBlock:(void (^_Nullable)(MTRDeviceControllerDelegateInfo * delegateInfo))block diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 23643d6a52..750ab648cb 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -70,17 +70,6 @@ using namespace chip::Controller; using namespace chip::Tracing::DarwinFramework; -static bool sExitHandlerRegistered = false; -static void ShutdownOnExit() -{ - // Depending on the structure of the software, this code might execute *after* the main autorelease pool has exited. - // Therefore, it needs to be enclosed in its own autorelease pool. - @autoreleasepool { - MTR_LOG("ShutdownOnExit invoked on exit"); - [[MTRDeviceControllerFactory sharedInstance] stopControllerFactory]; - } -} - @interface MTRDeviceControllerFactoryParams () // Flag to keep track of whether our .storage is real consumer-provided storage @@ -394,17 +383,6 @@ - (BOOL)_startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParam SuccessOrExit(err = _controllerFactory->Init(params)); } - // This needs to happen after DeviceControllerFactory::Init, - // because that creates (lazily, by calling functions with - // static variables in them) some static-lifetime objects. - if (!sExitHandlerRegistered) { - if (atexit(ShutdownOnExit) != 0) { - char error[128]; - strerror_r(errno, error, sizeof(error)); - MTR_LOG_ERROR("Warning: Failed to register atexit handler: %s", error); - } - sExitHandlerRegistered = true; - } HeapObjectPoolExitHandling::IgnoreLeaksOnExit(); // Make sure we don't leave a system state running while we have no @@ -441,8 +419,8 @@ - (void)stopControllerFactory { [self _assertCurrentQueueIsNotMatterQueue]; - while ([_controllers count] != 0) { - [_controllers[0] shutdown]; + for (MTRDeviceController * controller in [_controllers copy]) { + [controller shutdown]; } dispatch_sync(_chipWorkQueue, ^{ diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index e0820d57e0..0cfb25f494 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -17,6 +17,8 @@ #import +#import +#import #import #import #import @@ -131,6 +133,60 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)operationalInstanceAdded:(NSNumber *)nodeID; +/** + * Get the access grants that apply for the given cluster path. + */ +- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath; + +/** + * Get the privilege level needed to read the given attribute. There's no + * endpoint provided because the expectation is that this information is the + * same for all cluster instances. + * + * Returns nil if we have no such attribute defined on any endpoint, otherwise + * one of MTRAccessControlEntry* constants wrapped in NSNumber. + * + * Only called on the Matter queue. + */ +- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID; + +/** + * Try to asynchronously dispatch the given block on the Matter queue. If the + * controller is not running either at call time or when the block would be + * about to run, the provided error handler will be called with an error. Note + * that this means the error handler might be called on an arbitrary queue, and + * might be called before this function returns or after it returns. + * + * The DeviceCommissioner pointer passed to the callback should only be used + * synchronously during the callback invocation. + * + * If the error handler is nil, failure to run the block will be silent. + */ +- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block + errorHandler:(nullable MTRDeviceErrorHandler)errorHandler; + +/** + * Returns the transport used by the current session with the given device, + * or `MTRTransportTypeUndefined` if no session is currently active. + */ +- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device; + +/** + * Invalidate the CASE session for the given node ID. This is a temporary thing + * just to support MTRBaseDevice's invalidateCASESession. Must not be called on + * the Matter event queue. + */ +- (void)invalidateCASESessionForNode:(NSNumber *)nodeID; + +/** + * Download log of the desired type from the device. + */ +- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID + type:(MTRDiagnosticLogType)type + timeout:(NSTimeInterval)timeout + queue:(dispatch_queue_t)queue + completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index cb86c5d2db..eb7881bfd1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -141,6 +141,7 @@ @implementation MTRDeviceController_Concrete { @synthesize commissionableBrowser = _commissionableBrowser; @synthesize concurrentSubscriptionPool = _concurrentSubscriptionPool; @synthesize storageBehaviorConfiguration = _storageBehaviorConfiguration; +@synthesize controllerNodeID = _controllerNodeID; - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error @@ -417,6 +418,7 @@ - (void)shutdown return; } [self finalShutdown]; + [super shutdown]; } - (void)finalShutdown @@ -729,6 +731,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams self->_storedFabricIndex = fabricIdx; self->_storedCompressedFabricID = _cppCommissioner->GetCompressedFabricId(); + self->_controllerNodeID = @(_cppCommissioner->GetNodeId()); chip::Crypto::P256PublicKey rootPublicKey; if (_cppCommissioner->GetRootPublicKey(rootPublicKey) == CHIP_NO_ERROR) { @@ -793,18 +796,6 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams return YES; } -- (NSNumber *)controllerNodeID -{ - auto block = ^NSNumber * { return @(self->_cppCommissioner->GetNodeId()); }; - - NSNumber * nodeID = [self syncRunOnWorkQueueWithReturnValue:block error:nil]; - if (!nodeID) { - MTR_LOG_ERROR("%@ A controller has no node id if it has not been started", self); - } - - return nodeID; -} - static inline void emitMetricForSetupPayload(MTRSetupPayload * payload) { MATTER_LOG_METRIC(kMetricDeviceVendorID, [payload.vendorID unsignedIntValue]); @@ -1231,30 +1222,6 @@ - (BOOL)setOperationalCertificateIssuer:(nullable id_cppCommissioner->SessionMgr(); VerifyOrDie(sessionMgr != nullptr); sessionMgr->MarkSessionsAsDefunct( - self->_cppCommissioner->GetPeerScopedId(nodeID), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); + self->_cppCommissioner->GetPeerScopedId(nodeID.unsignedLongLongValue), chip::MakeOptional(chip::Transport::SecureSession::Type::kCASE)); }; [self syncRunOnWorkQueue:block error:nil]; @@ -1713,15 +1680,6 @@ - (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID att return nil; } -#ifdef DEBUG -+ (void)forceLocalhostAdvertisingOnly -{ - auto interfaceIndex = chip::Inet::InterfaceId::PlatformType(kDNSServiceInterfaceIndexLocalOnly); - auto interfaceId = chip::Inet::InterfaceId(interfaceIndex); - chip::app::DnssdServer::Instance().SetInterfaceId(interfaceId); -} -#endif // DEBUG - @end /** @@ -1736,11 +1694,6 @@ - (instancetype)initWithIssuer:(id)nocChainIssuer; @implementation MTRDeviceController_Concrete (Deprecated) -- (NSNumber *)controllerNodeId -{ - return self.controllerNodeID; -} - - (nullable NSData *)fetchAttestationChallengeForDeviceId:(uint64_t)deviceId { return [self attestationChallengeForDeviceID:@(deviceId)]; @@ -1986,11 +1939,6 @@ - (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID return [self syncRunOnWorkQueueWithReturnValue:block error:error]; } -- (nullable NSData *)computePaseVerifier:(uint32_t)setupPincode iterations:(uint32_t)iterations salt:(NSData *)salt -{ - return [MTRDeviceController computePASEVerifierForSetupPasscode:@(setupPincode) iterations:@(iterations) salt:salt error:nil]; -} - - (void)setPairingDelegate:(id)delegate queue:(dispatch_queue_t)queue { auto * delegateShim = [[MTRDevicePairingDelegateShim alloc] initWithDelegate:delegate]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 958e7914b1..8fd6e4cb4b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -20,7 +20,6 @@ */ #import -#import #import // for MTRClusterPath #import "MTRDeviceConnectionBridge.h" // For MTRInternalDeviceConnectionCallback @@ -155,34 +154,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)getSessionForCommissioneeDevice:(chip::NodeId)deviceID completion:(MTRInternalDeviceConnectionCallback)completion; -/** - * Returns the transport used by the current session with the given device, - * or `MTRTransportTypeUndefined` if no session is currently active. - */ -- (MTRTransportType)sessionTransportTypeForDevice:(MTRBaseDevice *)device; - -/** - * Invalidate the CASE session for the given node ID. This is a temporary thing - * just to support MTRBaseDevice's invalidateCASESession. Must not be called on - * the Matter event queue. - */ -- (void)invalidateCASESessionForNode:(chip::NodeId)nodeID; - -/** - * Try to asynchronously dispatch the given block on the Matter queue. If the - * controller is not running either at call time or when the block would be - * about to run, the provided error handler will be called with an error. Note - * that this means the error handler might be called on an arbitrary queue, and - * might be called before this function returns or after it returns. - * - * The DeviceCommissioner pointer passed to the callback should only be used - * synchronously during the callback invocation. - * - * If the error handler is nil, failure to run the block will be silent. - */ -- (void)asyncGetCommissionerOnMatterQueue:(void (^)(chip::Controller::DeviceCommissioner *))block - errorHandler:(nullable MTRDeviceErrorHandler)errorHandler; - /** * Try to asynchronously dispatch the given block on the Matter queue. If the * controller is not running either at call time or when the block would be @@ -201,32 +172,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (MTRBaseDevice *)baseDeviceForNodeID:(NSNumber *)nodeID; -/** - * Download log of the desired type from the device. - */ -- (void)downloadLogFromNodeWithID:(NSNumber *)nodeID - type:(MTRDiagnosticLogType)type - timeout:(NSTimeInterval)timeout - queue:(dispatch_queue_t)queue - completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; - -/** - * Get the access grants that apply for the given cluster path. - */ -- (NSArray *)accessGrantsForClusterPath:(MTRClusterPath *)clusterPath; - -/** - * Get the privilege level needed to read the given attribute. There's no - * endpoint provided because the expectation is that this information is the - * same for all cluster instances. - * - * Returns nil if we have no such attribute defined on any endpoint, otherwise - * one of MTRAccessControlEntry* constants wrapped in NSNumber. - * - * Only called on the Matter queue. - */ -- (nullable NSNumber *)neededReadPrivilegeForClusterID:(NSNumber *)clusterID attributeID:(NSNumber *)attributeID; - #pragma mark - Device-specific data and SDK access // DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID; @@ -265,8 +210,6 @@ static NSString * const kDeviceControllerErrorKeyAllocation = @"Generating new o static NSString * const kDeviceControllerErrorCSRValidation = @"Extracting public key from CSR failed"; static NSString * const kDeviceControllerErrorGetCommissionee = @"Failure obtaining device being commissioned"; static NSString * const kDeviceControllerErrorGetAttestationChallenge = @"Failure getting attestation challenge"; -static NSString * const kDeviceControllerErrorSpake2pVerifierGenerationFailed = @"PASE verifier generation failed"; -static NSString * const kDeviceControllerErrorSpake2pVerifierSerializationFailed = @"PASE verifier serialization failed"; static NSString * const kDeviceControllerErrorCDCertStoreInit = @"Init failure while initializing Certificate Declaration Signing Keys store"; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm index 45c675121e..7e88870aa7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm @@ -40,46 +40,53 @@ @interface MTRDeviceController_XPC () @end +NSString * const MTRDeviceControllerRegistrationControllerContextKey = @"MTRDeviceControllerRegistrationControllerContext"; +NSString * const MTRDeviceControllerRegistrationNodeIDsKey = @"MTRDeviceControllerRegistrationNodeIDs"; +NSString * const MTRDeviceControllerRegistrationNodeIDKey = @"MTRDeviceControllerRegistrationNodeID"; + // #define MTR_HAVE_MACH_SERVICE_NAME_CONSTRUCTOR @implementation MTRDeviceController_XPC -#pragma mark - Device Node ID Commands +#pragma mark - Node ID Management -- (void)_registerNodeID:(NSNumber *)nodeID +MTR_DEVICECONTROLLER_SIMPLE_REMOTE_XPC_COMMAND(updateControllerConfiguration + : (NSDictionary *) controllerState, updateControllerConfiguration + : (NSDictionary *) controllerState) + +- (void)_updateRegistrationInfo { - @try { - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Register node error: %@ nodeID: %@", error, nodeID); - }] deviceController:self.uniqueIdentifier registerNodeID:nodeID]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); + NSMutableDictionary * registrationInfo = [NSMutableDictionary dictionary]; + + NSMutableDictionary * controllerContext = [NSMutableDictionary dictionary]; + NSMutableArray * nodeIDs = [NSMutableArray array]; + + for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { + NSMutableDictionary * nodeDictionary = [NSMutableDictionary dictionary]; + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationNodeIDKey, nodeID, nodeDictionary) + + [nodeIDs addObject:nodeDictionary]; } + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationNodeIDsKey, nodeIDs, registrationInfo) + MTR_REQUIRED_ATTRIBUTE(MTRDeviceControllerRegistrationControllerContextKey, controllerContext, registrationInfo) + + [self updateControllerConfiguration:registrationInfo]; +} + +- (void)_registerNodeID:(NSNumber *)nodeID +{ + [self _updateRegistrationInfo]; } - (void)_unregisterNodeID:(NSNumber *)nodeID { - @try { - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Unregister node error: %@ nodeID: %@", error, nodeID); - }] deviceController:self.uniqueIdentifier unregisterNodeID:nodeID]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); - } + [self _updateRegistrationInfo]; } -- (void)_checkinWithContext:(NSDictionary *)context +- (void)removeDevice:(MTRDevice *)device { - @try { - if (!context) - context = [NSDictionary dictionary]; - - [[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Checkin error: %@", error); - }] deviceController:self.uniqueIdentifier checkInWithContext:context]; - } @catch (NSException * exception) { - MTR_LOG_ERROR("Exception registering nodeID: %@", exception); - } + [super removeDevice:device]; + [self _updateRegistrationInfo]; } #pragma mark - XPC @@ -241,18 +248,10 @@ - (BOOL)_setupXPCConnection MTR_LOG("%@ Activating new XPC connection", self); [self.xpcConnection activate]; - [self _checkinWithContext:[NSDictionary dictionary]]; - // FIXME: Trying to kick all the MTRDevices attached to this controller to re-establish connections // This state needs to be stored properly and re-established at connnection time - MTR_LOG("%@ Starting existing NodeID Registration", self); - for (NSNumber * nodeID in [self.nodeIDToDeviceMap keyEnumerator]) { - MTR_LOG("%@ => Registering nodeID: %@", self, nodeID); - [self _registerNodeID:nodeID]; - } - - MTR_LOG("%@ Done existing NodeID Registration", self); + [self _updateRegistrationInfo]; self.xpcConnectedOrConnecting = YES; } else { MTR_LOG_ERROR("%@ Failed to set up XPC Connection", self); @@ -340,7 +339,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N [self.nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID); - [self _registerNodeID:nodeID]; + [self _updateRegistrationInfo]; return deviceToReturn; } diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index 5d6e47c8d9..68b610cb25 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -757,7 +757,9 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason } if ([self _deviceUsesThread]) { MTR_LOG(" => %@ - device is a thread device, scheduling in pool", self); + mtr_weakify(self); [self _scheduleSubscriptionPoolWork:^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ std::lock_guard lock(self->_lock); [self _setupSubscriptionWithReason:[NSString stringWithFormat:@"%@ and scheduled subscription is happening", reason]]; @@ -770,8 +772,6 @@ - (void)_ensureSubscriptionForExistingDelegates:(NSString *)reason } errorHandler:nil]; } } - - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (void)invalidate @@ -1165,10 +1165,19 @@ - (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds: return; } + mtr_weakify(self); dispatch_block_t workBlockToQueue = ^{ + mtr_strongify(self); + if (nil == self) { + // This block may be delayed by a specified number of nanoseconds, potentially running after the device is deallocated. + // If so, MTRAsyncWorkItem::initWithQueue will assert on a nil queue, which will cause a crash. + return; + } + // In the case where a resubscription triggering event happened and already established, running the work block should result in a no-op MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; [workItem setReadyHandler:^(id _Nonnull context, NSInteger retryCount, MTRAsyncWorkCompletionBlock _Nonnull completion) { + mtr_strongify(self); MTR_LOG("%@ - work item is ready to attempt pooled subscription", self); os_unfair_lock_lock(&self->_lock); #ifdef DEBUG @@ -1236,7 +1245,6 @@ - (void)_handleResubscriptionNeededWithDelayOnDeviceQueue:(NSNumber *)resubscrip std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; BOOL deviceUsesThread = [self _deviceUsesThread]; // If a previous resubscription failed, remove the item from the subscription pool. @@ -1246,7 +1254,9 @@ - (void)_handleResubscriptionNeededWithDelayOnDeviceQueue:(NSNumber *)resubscrip // Use the existing _triggerResubscribeWithReason mechanism, which does the right checks when // this block is run -- if other triggering events had happened, this would become a no-op. + mtr_weakify(self); auto resubscriptionBlock = ^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ [self _triggerResubscribeWithReason:@"ResubscriptionNeeded timer fired" nodeLikelyReachable:NO]; } errorHandler:^(NSError * _Nonnull error) { @@ -1312,7 +1322,6 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay std::lock_guard lock(_descriptionLock); _lastSubscriptionFailureTimeForDescription = _lastSubscriptionFailureTime; } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; // if there is no delegate then also do not retry if (![self _delegateExists]) { @@ -1357,7 +1366,9 @@ - (void)_doHandleSubscriptionReset:(NSNumber * _Nullable)retryDelay // Call _reattemptSubscriptionNowIfNeededWithReason when timer fires - if subscription is // in a better state at that time this will be a no-op. + mtr_weakify(self); auto resubscriptionBlock = ^{ + mtr_strongify(self); [self->_deviceController asyncDispatchToMatterQueue:^{ std::lock_guard lock(self->_lock); [self _reattemptSubscriptionNowIfNeededWithReason:@"got subscription reset"]; @@ -1685,8 +1696,6 @@ - (void)_scheduleClusterDataPersistence } } - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; - // Do not schedule persistence if device is reporting excessively if ([self _deviceIsReportingExcessively]) { return; @@ -1752,6 +1761,7 @@ - (void)_handleReportEnd [delegate deviceConfigurationChanged:self]; } }]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; _deviceConfigurationChanged = NO; } @@ -1766,6 +1776,7 @@ - (void)_handleReportEnd // all the data for the device now. _deviceCachePrimed = YES; [self _callDelegateDeviceCachePrimed]; + [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } // For unit testing only @@ -1776,8 +1787,6 @@ - (void)_handleReportEnd } }]; #endif - - [self _notifyDelegateOfPrivateInternalPropertiesChanges]; } - (BOOL)_interestedPaths:(NSArray * _Nullable)interestedPaths includesAttributePath:(MTRAttributePath *)attributePath @@ -2395,8 +2404,10 @@ - (void)_setupSubscriptionWithReason:(NSString *)reason NSNumber * _Nullable retryDelay) { if (error != nil) { MTR_LOG_ERROR("%@ getSessionForNode error %@", self, error); - [self _handleSubscriptionError:error]; - [self _handleSubscriptionReset:retryDelay]; + [self->_deviceController asyncDispatchToMatterQueue:^{ + [self _handleSubscriptionError:error]; + [self _handleSubscriptionReset:retryDelay]; + } errorHandler:nil]; return; } @@ -2845,7 +2856,10 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) } }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx 0x%llx", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ 0x%llx (%@) 0x%llx (%@)", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue))]; } else { [self _readThroughSkipped]; } @@ -2975,7 +2989,11 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID completion(MTRAsyncWorkComplete); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue, value]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + attributeID.unsignedLongLongValue, MTRAttributeNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(attributeID.unsignedLongLongValue)), + value]; } - (NSArray *> *)readAttributePaths:(NSArray *)attributePaths @@ -3122,7 +3140,11 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID workDone(values, error); }]; }]; - [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx 0x%llx: %@", endpointID, clusterID.unsignedLongLongValue, commandID.unsignedLongLongValue, commandFields]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ 0x%llx (%@) 0x%llx (%@): %@", + endpointID, + clusterID.unsignedLongLongValue, MTRClusterNameForID(static_cast(clusterID.unsignedLongLongValue)), + commandID.unsignedLongLongValue, MTRRequestCommandNameForID(static_cast(clusterID.unsignedLongLongValue), static_cast(commandID.unsignedLongLongValue)), + commandFields]; } - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index d7a4574f91..aefa2fffc1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -49,7 +49,6 @@ #import "MTRLogging_Internal.h" #import "MTRMetricKeys.h" #import "MTRMetricsCollector.h" -#import "MTROperationalCredentialsDelegate.h" #import "MTRP256KeypairBridge.h" #import "MTRPersistentStorageDelegateBridge.h" #import "MTRServerEndpoint_Internal.h" @@ -251,7 +250,8 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID @try { [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { - MTR_LOG_ERROR("Error: %@", error); + MTR_LOG_ERROR("Invoke error: %@", error); + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); }] deviceController:[[self deviceController] uniqueIdentifier] nodeID:[self nodeID] invokeCommandWithEndpointID:endpointID @@ -263,8 +263,42 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID timedInvokeTimeout:timeout serverSideProcessingTimeout:serverSideProcessingTimeout completion:completion]; + } @catch (NSException * exception) { + MTR_LOG_ERROR("Exception sending XPC message: %@", exception); + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + } +} + +- (void)downloadLogOfType:(MTRDiagnosticLogType)type + timeout:(NSTimeInterval)timeout + queue:(dispatch_queue_t)queue + completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion +{ + NSXPCConnection * xpcConnection = [(MTRDeviceController_XPC *) [self deviceController] xpcConnection]; + + @try { + [[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { + MTR_LOG_ERROR("Error: %@", error); + dispatch_async(queue, ^{ + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + }); + }] deviceController:[[self deviceController] uniqueIdentifier] + nodeID:[self nodeID] + downloadLogOfType:type + timeout:timeout + completion:^(NSURL * _Nullable url, NSError * _Nullable error) { + dispatch_async(queue, ^{ + completion(url, error); + if (url) { + [[NSFileManager defaultManager] removeItemAtPath:url.path error:nil]; + } + }); + }]; } @catch (NSException * exception) { MTR_LOG_ERROR("Exception sending XPC messsage: %@", exception); + dispatch_async(queue, ^{ + completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + }); } } diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h index 63499f024b..928c80ba85 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.h @@ -20,7 +20,7 @@ #import #import -#import "MTRDeviceController.h" +#import "MTRDeviceController_Concrete.h" #import "MTRError_Internal.h" #import "MTRKeypair.h" #import "MTROperationalCertificateIssuer.h" @@ -38,7 +38,7 @@ class MTROperationalCredentialsDelegate : public chip::Controller::OperationalCr public: using ChipP256KeypairPtr = chip::Crypto::P256Keypair *; - MTROperationalCredentialsDelegate(MTRDeviceController * deviceController); + MTROperationalCredentialsDelegate(MTRDeviceController_Concrete * deviceController); ~MTROperationalCredentialsDelegate() {} CHIP_ERROR Init(ChipP256KeypairPtr nocSigner, NSData * ipk, NSData * rootCert, NSData * _Nullable icaCert); @@ -147,7 +147,7 @@ class MTROperationalCredentialsDelegate : public chip::Controller::OperationalCr NSData * _Nullable mRootCert; NSData * _Nullable mIntermediateCert; - MTRDeviceController * __weak mWeakController; + MTRDeviceController_Concrete * __weak mWeakController; chip::Controller::DeviceCommissioner * _Nullable mCppCommissioner = nullptr; id _Nullable mOperationalCertificateIssuer; dispatch_queue_t _Nullable mOperationalCertificateIssuerQueue; diff --git a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm index fa280c81e6..673e4df12b 100644 --- a/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm +++ b/src/darwin/Framework/CHIP/MTROperationalCredentialsDelegate.mm @@ -42,7 +42,7 @@ using namespace Credentials; using namespace Crypto; -MTROperationalCredentialsDelegate::MTROperationalCredentialsDelegate(MTRDeviceController * deviceController) +MTROperationalCredentialsDelegate::MTROperationalCredentialsDelegate(MTRDeviceController_Concrete * deviceController) : mWeakController(deviceController) { } @@ -129,7 +129,7 @@ VerifyOrReturnError(mCppCommissioner != nullptr, CHIP_ERROR_INCORRECT_STATE); - MTRDeviceController * strongController = mWeakController; + MTRDeviceController_Concrete * strongController = mWeakController; VerifyOrReturnError(strongController != nil, CHIP_ERROR_INCORRECT_STATE); mOnNOCCompletionCallback = onCompletion; @@ -168,14 +168,14 @@ certificationDeclaration:AsData(certificationDeclarationSpan) firmwareInfo:firmwareInfo]; - MTRDeviceController * __weak weakController = mWeakController; + MTRDeviceController_Concrete * __weak weakController = mWeakController; dispatch_async(mOperationalCertificateIssuerQueue, ^{ [mOperationalCertificateIssuer issueOperationalCertificateForRequest:csrInfo attestationInfo:attestationInfo controller:strongController completion:^(MTROperationalCertificateChain * _Nullable chain, NSError * _Nullable error) { - MTRDeviceController * strongController = weakController; + MTRDeviceController_Concrete * strongController = weakController; if (strongController == nil || !strongController.isRunning) { // No longer safe to touch "this" return; diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm index 98d9f2b342..c4694884ea 100644 --- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm +++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm @@ -607,7 +607,7 @@ + (NSUInteger)generateRandomPIN return setupPIN; } - // We got pretty unlikely with our random number generation. Just try + // We got pretty unlucky with our random number generation. Just try // again. The chance that this loop does not terminate in a reasonable // amount of time is astronomically low, assuming arc4random_uniform is not // broken. diff --git a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h index b404056c96..9ecec60ae5 100644 --- a/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h +++ b/src/darwin/Framework/CHIP/XPC Protocol/MTRXPCServerProtocol.h @@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationNodeIDsKey MTR_NEWLY_AVAILABLE; +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationNodeIDKey MTR_NEWLY_AVAILABLE; +MTR_EXTERN NSString * const MTRDeviceControllerRegistrationControllerContextKey MTR_NEWLY_AVAILABLE; + MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDevice @@ -37,11 +41,19 @@ MTR_NEWLY_AVAILABLE - (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode discriminator:(NSNumber *)discriminator duration:(NSNumber *)duration completion:(MTRDeviceOpenCommissioningWindowHandler)completion; - (oneway void)downloadLogOfType:(MTRDiagnosticLogType)type nodeID:(NSNumber *)nodeID timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + +@optional +/* Note: The consumer of the completion block should move the file that the url points to or open it for reading before the + * completion handler returns. Otherwise, the file will be deleted, and the data will be lost. + */ +- (oneway void)deviceController:(NSUUID *)controller nodeID:(NSNumber *)nodeID downloadLogOfType:(MTRDiagnosticLogType)type timeout:(NSTimeInterval)timeout completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; + @end MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol_MTRDeviceController +@optional - (oneway void)deviceController:(NSUUID *)controller getIsRunningWithReply:(void (^)(BOOL response))reply; - (oneway void)deviceController:(NSUUID *)controller getUniqueIdentifierWithReply:(void (^)(NSUUID *))reply; - (oneway void)deviceController:(NSUUID *)controller controllerNodeIDWithReply:(void (^)(NSNumber * nodeID))reply; @@ -66,7 +78,9 @@ MTR_NEWLY_AVAILABLE MTR_NEWLY_AVAILABLE @protocol MTRXPCServerProtocol +@optional - (oneway void)deviceController:(NSUUID *)controller checkInWithContext:(NSDictionary *)context; +- (oneway void)deviceController:(NSUUID *)controller updateControllerConfiguration:(NSDictionary *)controllerState; @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt index 59281604dc..3ec7fe0b8a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt @@ -23,7 +23,7 @@ NSString * MTRClusterNameForID(MTRClusterIDType clusterID) {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -72,7 +72,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -80,7 +80,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -119,7 +119,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{> commandIDs clusterName=label}} default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -127,7 +127,7 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -183,7 +183,7 @@ NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) {{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -191,7 +191,7 @@ NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) {{/zcl_clusters}} default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } diff --git a/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt b/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt index c3e594930d..7047fb21ac 100644 --- a/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRDeviceTypeMetadata-src.zapt @@ -21,9 +21,7 @@ struct DeviceTypeData { constexpr DeviceTypeData knownDeviceTypes[] = { {{#zcl_device_types}} {{#if class}} - {{! For now work around the "Dynamic Utility" thing on Aggregator by just - taking the last word. }} - { {{asHex code 8}}, DeviceTypeClass::{{asLastWord class}}, "{{caption}}" }, + { {{asHex code 8}}, DeviceTypeClass::{{class}}, "{{caption}}" }, {{/if}} {{/zcl_device_types}} }; diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3f65e9facf..fdf5c00538 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9753,6 +9753,9 @@ - WaterHeaterManagement - WaterHeaterMode - WiFiNetworkManagement + # Targeting Camera enablement + - Chime + - WebRTCTransportProvider attributes: AccessControl: # Targeting 1.4 @@ -9767,6 +9770,7 @@ - TCMinRequiredVersion - TCAcknowledgements - TCAcknowledgementsRequired + - TCUpdateDeadline OccupancySensing: # Targeting 1.4 - HoldTime @@ -9855,6 +9859,8 @@ - LandmarkTag - PositionTag - RelativePositionTag + # Targeting Camera enablement + - ThreeLevelAutoEnum enum values: ApplicationLauncher: StatusEnum: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index a2878cf511..31a1d57e3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -825,6 +825,9 @@ static BOOL AttributeIsSpecifiedInGeneralCommissioningCluster(AttributeId aAttri case Attributes::TCAcknowledgementsRequired::Id: { return YES; } + case Attributes::TCUpdateDeadline::Id: { + return YES; + } case Attributes::GeneratedCommandList::Id: { return YES; } @@ -5912,6 +5915,213 @@ static BOOL AttributeIsSpecifiedInContentAppObserverCluster(AttributeId aAttribu } } } +static BOOL AttributeIsSpecifiedInZoneManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ZoneManagement; + switch (aAttributeId) { + case Attributes::SupportedZoneSources::Id: { + return YES; + } + case Attributes::Zones::Id: { + return YES; + } + case Attributes::TimeControl::Id: { + return YES; + } + case Attributes::Sensitivity::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} +static BOOL AttributeIsSpecifiedInCameraAVStreamManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aAttributeId) { + case Attributes::MaxConcurrentVideoEncoders::Id: { + return YES; + } + case Attributes::MaxEncodedPixelRate::Id: { + return YES; + } + case Attributes::VideoSensorParams::Id: { + return YES; + } + case Attributes::NightVisionCapable::Id: { + return YES; + } + case Attributes::MinViewport::Id: { + return YES; + } + case Attributes::RateDistortionTradeOffPoints::Id: { + return YES; + } + case Attributes::MaxPreRollBufferSize::Id: { + return YES; + } + case Attributes::MicrophoneCapabilities::Id: { + return YES; + } + case Attributes::SpeakerCapabilities::Id: { + return YES; + } + case Attributes::TwoWayTalkSupport::Id: { + return YES; + } + case Attributes::SupportedSnapshotParams::Id: { + return YES; + } + case Attributes::MaxNetworkBandwidth::Id: { + return YES; + } + case Attributes::CurrentFrameRate::Id: { + return YES; + } + case Attributes::HDRModeEnabled::Id: { + return YES; + } + case Attributes::CurrentVideoCodecs::Id: { + return YES; + } + case Attributes::CurrentSnapshotConfig::Id: { + return YES; + } + case Attributes::FabricsUsingCamera::Id: { + return YES; + } + case Attributes::AllocatedVideoStreams::Id: { + return YES; + } + case Attributes::AllocatedAudioStreams::Id: { + return YES; + } + case Attributes::AllocatedSnapshotStreams::Id: { + return YES; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + return YES; + } + case Attributes::SoftRecordingPrivacyModeEnabled::Id: { + return YES; + } + case Attributes::SoftLivestreamPrivacyModeEnabled::Id: { + return YES; + } + case Attributes::HardPrivacyModeOn::Id: { + return YES; + } + case Attributes::NightVision::Id: { + return YES; + } + case Attributes::NightVisionIllum::Id: { + return YES; + } + case Attributes::AWBEnabled::Id: { + return YES; + } + case Attributes::AutoShutterSpeedEnabled::Id: { + return YES; + } + case Attributes::AutoISOEnabled::Id: { + return YES; + } + case Attributes::Viewport::Id: { + return YES; + } + case Attributes::SpeakerMuted::Id: { + return YES; + } + case Attributes::SpeakerVolumeLevel::Id: { + return YES; + } + case Attributes::SpeakerMaxLevel::Id: { + return YES; + } + case Attributes::SpeakerMinLevel::Id: { + return YES; + } + case Attributes::MicrophoneMuted::Id: { + return YES; + } + case Attributes::MicrophoneVolumeLevel::Id: { + return YES; + } + case Attributes::MicrophoneMaxLevel::Id: { + return YES; + } + case Attributes::MicrophoneMinLevel::Id: { + return YES; + } + case Attributes::MicrophoneAGCEnabled::Id: { + return YES; + } + case Attributes::ImageRotation::Id: { + return YES; + } + case Attributes::ImageFlipHorizontal::Id: { + return YES; + } + case Attributes::ImageFlipVertical::Id: { + return YES; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + return YES; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + return YES; + } + case Attributes::StatusLightEnabled::Id: { + return YES; + } + case Attributes::StatusLightBrightness::Id: { + return YES; + } + case Attributes::DepthSensorStatus::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -5942,6 +6152,36 @@ static BOOL AttributeIsSpecifiedInWebRTCTransportProviderCluster(AttributeId aAt } } } +static BOOL AttributeIsSpecifiedInWebRTCTransportRequestorCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + case Attributes::CurrentSessions::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -6711,9 +6951,18 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ContentAppObserver::Id: { return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId); } + case Clusters::ZoneManagement::Id: { + return AttributeIsSpecifiedInZoneManagementCluster(aAttributeId); + } + case Clusters::CameraAvStreamManagement::Id: { + return AttributeIsSpecifiedInCameraAVStreamManagementCluster(aAttributeId); + } case Clusters::WebRTCTransportProvider::Id: { return AttributeIsSpecifiedInWebRTCTransportProviderCluster(aAttributeId); } + case Clusters::WebRTCTransportRequestor::Id: { + return AttributeIsSpecifiedInWebRTCTransportRequestorCluster(aAttributeId); + } case Clusters::Chime::Id: { return AttributeIsSpecifiedInChimeCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index ae28957899..5e6e048660 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -2282,6 +2282,17 @@ static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster(Attribute value = [NSNumber numberWithBool:cppValue]; return value; } + case Attributes::TCUpdateDeadline::Id: { + using TypeInfo = Attributes::TCUpdateDeadline::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } default: { break; } @@ -16899,12 +16910,12 @@ static id _Nullable DecodeAttributeValueForContentAppObserverCluster(AttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForZoneManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::WebRTCTransportProvider; + using namespace Clusters::ZoneManagement; switch (aAttributeId) { - case Attributes::CurrentSessions::Id: { - using TypeInfo = Attributes::CurrentSessions::TypeInfo; + case Attributes::SupportedZoneSources::Id: { + using TypeInfo = Attributes::SupportedZoneSources::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16916,23 +16927,8 @@ static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(Attrib auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRWebRTCTransportProviderClusterWebRTCSessionStruct * newElement_0; - newElement_0 = [MTRWebRTCTransportProviderClusterWebRTCSessionStruct new]; - newElement_0.id = [NSNumber numberWithUnsignedShort:entry_0.id]; - newElement_0.peerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.peerNodeID]; - newElement_0.peerFabricIndex = [NSNumber numberWithUnsignedChar:entry_0.peerFabricIndex]; - newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; - if (entry_0.videoStreamID.IsNull()) { - newElement_0.videoStreamID = nil; - } else { - newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID.Value()]; - } - if (entry_0.audioStreamID.IsNull()) { - newElement_0.audioStreamID = nil; - } else { - newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID.Value()]; - } - newElement_0.metadataOptions = [NSNumber numberWithUnsignedChar:entry_0.metadataOptions.Raw()]; + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16944,20 +16940,8 @@ static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(Attrib } return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Chime; - switch (aAttributeId) { - case Attributes::InstalledChimeSounds::Id: { - using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo; + case Attributes::Zones::Id: { + using TypeInfo = Attributes::Zones::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16969,15 +16953,11 @@ static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRChimeClusterChimeSoundStruct * newElement_0; - newElement_0 = [MTRChimeClusterChimeSoundStruct new]; - newElement_0.chimeID = [NSNumber numberWithUnsignedChar:entry_0.chimeID]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + MTRZoneManagementClusterZoneInformationStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneInformationStruct new]; + newElement_0.zoneID = [NSNumber numberWithUnsignedShort:entry_0.zoneID]; + newElement_0.zoneType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.zoneType)]; + newElement_0.zoneSource = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.zoneSource)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16989,42 +16969,8 @@ static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId } return value; } - case Attributes::ActiveChimeID::Id: { - using TypeInfo = Attributes::ActiveChimeID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::Enabled::Id: { - using TypeInfo = Attributes::Enabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::EcosystemInformation; - switch (aAttributeId) { - case Attributes::DeviceDirectory::Id: { - using TypeInfo = Attributes::DeviceDirectory::TypeInfo; + case Attributes::TimeControl::Id: { + using TypeInfo = Attributes::TimeControl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17036,66 +16982,12 @@ static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(Attribute auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTREcosystemInformationClusterEcosystemDeviceStruct * newElement_0; - newElement_0 = [MTREcosystemInformationClusterEcosystemDeviceStruct new]; - if (entry_0.deviceName.HasValue()) { - newElement_0.deviceName = AsString(entry_0.deviceName.Value()); - if (newElement_0.deviceName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.deviceName = nil; - } - if (entry_0.deviceNameLastEdit.HasValue()) { - newElement_0.deviceNameLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.deviceNameLastEdit.Value()]; - } else { - newElement_0.deviceNameLastEdit = nil; - } - newElement_0.bridgedEndpoint = [NSNumber numberWithUnsignedShort:entry_0.bridgedEndpoint]; - newElement_0.originalEndpoint = [NSNumber numberWithUnsignedShort:entry_0.originalEndpoint]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.deviceTypes.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTREcosystemInformationClusterDeviceTypeStruct * newElement_2; - newElement_2 = [MTREcosystemInformationClusterDeviceTypeStruct new]; - newElement_2.deviceType = [NSNumber numberWithUnsignedInt:entry_2.deviceType]; - newElement_2.revision = [NSNumber numberWithUnsignedShort:entry_2.revision]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.deviceTypes = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.uniqueLocationIDs.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSString * newElement_2; - newElement_2 = AsString(entry_2); - if (newElement_2 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.uniqueLocationIDs = array_2; - } - newElement_0.uniqueLocationIDsLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.uniqueLocationIDsLastEdit]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; + newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; + newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; + newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -17107,55 +16999,15 @@ static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(Attribute } return value; } - case Attributes::LocationDirectory::Id: { - using TypeInfo = Attributes::LocationDirectory::TypeInfo; + case Attributes::Sensitivity::Id: { + using TypeInfo = Attributes::Sensitivity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTREcosystemInformationClusterEcosystemLocationStruct * newElement_0; - newElement_0 = [MTREcosystemInformationClusterEcosystemLocationStruct new]; - newElement_0.uniqueLocationID = AsString(entry_0.uniqueLocationID); - if (newElement_0.uniqueLocationID == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.locationDescriptor = [MTRDataTypeLocationDescriptorStruct new]; - newElement_0.locationDescriptor.locationName = AsString(entry_0.locationDescriptor.locationName); - if (newElement_0.locationDescriptor.locationName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (entry_0.locationDescriptor.floorNumber.IsNull()) { - newElement_0.locationDescriptor.floorNumber = nil; - } else { - newElement_0.locationDescriptor.floorNumber = [NSNumber numberWithShort:entry_0.locationDescriptor.floorNumber.Value()]; - } - if (entry_0.locationDescriptor.areaType.IsNull()) { - newElement_0.locationDescriptor.areaType = nil; - } else { - newElement_0.locationDescriptor.areaType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.locationDescriptor.areaType.Value())]; - } - newElement_0.locationDescriptorLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.locationDescriptorLastEdit]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -17166,101 +17018,1240 @@ static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(Attribute *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForCommissionerControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForCameraAVStreamManagementCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::CommissionerControl; + using namespace Clusters::CameraAvStreamManagement; switch (aAttributeId) { - case Attributes::SupportedDeviceCategories::Id: { - using TypeInfo = Attributes::SupportedDeviceCategories::TypeInfo; + case Attributes::MaxConcurrentVideoEncoders::Id: { + using TypeInfo = Attributes::MaxConcurrentVideoEncoders::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::UnitTesting; - switch (aAttributeId) { - case Attributes::Boolean::Id: { - using TypeInfo = Attributes::Boolean::TypeInfo; + case Attributes::MaxEncodedPixelRate::Id: { + using TypeInfo = Attributes::MaxEncodedPixelRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::Bitmap8::Id: { - using TypeInfo = Attributes::Bitmap8::TypeInfo; + case Attributes::VideoSensorParams::Id: { + using TypeInfo = Attributes::VideoSensorParams::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterVideoSensorParamsStruct new]; + value.sensorWidth = [NSNumber numberWithUnsignedShort:cppValue.sensorWidth]; + value.sensorHeight = [NSNumber numberWithUnsignedShort:cppValue.sensorHeight]; + value.hdrCapable = [NSNumber numberWithBool:cppValue.HDRCapable]; + value.maxFPS = [NSNumber numberWithUnsignedShort:cppValue.maxFPS]; + value.maxHDRFPS = [NSNumber numberWithUnsignedShort:cppValue.maxHDRFPS]; return value; } - case Attributes::Bitmap16::Id: { - using TypeInfo = Attributes::Bitmap16::TypeInfo; + case Attributes::NightVisionCapable::Id: { + using TypeInfo = Attributes::NightVisionCapable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::Bitmap32::Id: { - using TypeInfo = Attributes::Bitmap32::TypeInfo; + case Attributes::MinViewport::Id: { + using TypeInfo = Attributes::MinViewport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + value.width = [NSNumber numberWithUnsignedShort:cppValue.width]; + value.height = [NSNumber numberWithUnsignedShort:cppValue.height]; return value; } - case Attributes::Bitmap64::Id: { - using TypeInfo = Attributes::Bitmap64::TypeInfo; + case Attributes::RateDistortionTradeOffPoints::Id: { + using TypeInfo = Attributes::RateDistortionTradeOffPoints::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue.Raw()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct new]; + newElement_0.codec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.codec)]; + newElement_0.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.resolution.width = [NSNumber numberWithUnsignedShort:entry_0.resolution.width]; + newElement_0.resolution.height = [NSNumber numberWithUnsignedShort:entry_0.resolution.height]; + newElement_0.minBitRate = [NSNumber numberWithUnsignedInt:entry_0.minBitRate]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::Int8u::Id: { - using TypeInfo = Attributes::Int8u::TypeInfo; + case Attributes::MaxPreRollBufferSize::Id: { + using TypeInfo = Attributes::MaxPreRollBufferSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::Int16u::Id: { - using TypeInfo = Attributes::Int16u::TypeInfo; + case Attributes::MicrophoneCapabilities::Id: { + using TypeInfo = Attributes::MicrophoneCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct new]; + value.maxNumberOfChannels = [NSNumber numberWithUnsignedChar:cppValue.maxNumberOfChannels]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedCodecs.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedCodecs = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedSampleRates.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedSampleRates = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedBitDepths.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedBitDepths = array_1; + } + return value; + } + case Attributes::SpeakerCapabilities::Id: { + using TypeInfo = Attributes::SpeakerCapabilities::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct new]; + value.maxNumberOfChannels = [NSNumber numberWithUnsignedChar:cppValue.maxNumberOfChannels]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedCodecs.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedCodecs = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedSampleRates.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedInt:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedSampleRates = array_1; + } + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.supportedBitDepths.begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value.supportedBitDepths = array_1; + } + return value; + } + case Attributes::TwoWayTalkSupport::Id: { + using TypeInfo = Attributes::TwoWayTalkSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::SupportedSnapshotParams::Id: { + using TypeInfo = Attributes::SupportedSnapshotParams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRCameraAVStreamManagementClusterSnapshotParamsStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterSnapshotParamsStruct new]; + newElement_0.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.resolution.width = [NSNumber numberWithUnsignedShort:entry_0.resolution.width]; + newElement_0.resolution.height = [NSNumber numberWithUnsignedShort:entry_0.resolution.height]; + newElement_0.maxFrameRate = [NSNumber numberWithUnsignedShort:entry_0.maxFrameRate]; + newElement_0.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.imageCodec)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::MaxNetworkBandwidth::Id: { + using TypeInfo = Attributes::MaxNetworkBandwidth::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::CurrentFrameRate::Id: { + using TypeInfo = Attributes::CurrentFrameRate::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::HDRModeEnabled::Id: { + using TypeInfo = Attributes::HDRModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::CurrentVideoCodecs::Id: { + using TypeInfo = Attributes::CurrentVideoCodecs::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::CurrentSnapshotConfig::Id: { + using TypeInfo = Attributes::CurrentSnapshotConfig::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterSnapshotParamsStruct new]; + value.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + value.resolution.width = [NSNumber numberWithUnsignedShort:cppValue.resolution.width]; + value.resolution.height = [NSNumber numberWithUnsignedShort:cppValue.resolution.height]; + value.maxFrameRate = [NSNumber numberWithUnsignedShort:cppValue.maxFrameRate]; + value.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.imageCodec)]; + return value; + } + case Attributes::FabricsUsingCamera::Id: { + using TypeInfo = Attributes::FabricsUsingCamera::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AllocatedVideoStreams::Id: { + using TypeInfo = Attributes::AllocatedVideoStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRCameraAVStreamManagementClusterVideoStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterVideoStreamStruct new]; + newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + newElement_0.videoCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.videoCodec)]; + newElement_0.minFrameRate = [NSNumber numberWithUnsignedShort:entry_0.minFrameRate]; + newElement_0.maxFrameRate = [NSNumber numberWithUnsignedShort:entry_0.maxFrameRate]; + newElement_0.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.minResolution.width = [NSNumber numberWithUnsignedShort:entry_0.minResolution.width]; + newElement_0.minResolution.height = [NSNumber numberWithUnsignedShort:entry_0.minResolution.height]; + newElement_0.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.maxResolution.width = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.width]; + newElement_0.maxResolution.height = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.height]; + newElement_0.minBitRate = [NSNumber numberWithUnsignedInt:entry_0.minBitRate]; + newElement_0.maxBitRate = [NSNumber numberWithUnsignedInt:entry_0.maxBitRate]; + newElement_0.minFragmentLen = [NSNumber numberWithUnsignedShort:entry_0.minFragmentLen]; + newElement_0.maxFragmentLen = [NSNumber numberWithUnsignedShort:entry_0.maxFragmentLen]; + if (entry_0.watermarkEnabled.HasValue()) { + newElement_0.watermarkEnabled = [NSNumber numberWithBool:entry_0.watermarkEnabled.Value()]; + } else { + newElement_0.watermarkEnabled = nil; + } + if (entry_0.OSDEnabled.HasValue()) { + newElement_0.osdEnabled = [NSNumber numberWithBool:entry_0.OSDEnabled.Value()]; + } else { + newElement_0.osdEnabled = nil; + } + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AllocatedAudioStreams::Id: { + using TypeInfo = Attributes::AllocatedAudioStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRCameraAVStreamManagementClusterAudioStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterAudioStreamStruct new]; + newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + newElement_0.audioCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.audioCodec)]; + newElement_0.channelCount = [NSNumber numberWithUnsignedChar:entry_0.channelCount]; + newElement_0.sampleRate = [NSNumber numberWithUnsignedInt:entry_0.sampleRate]; + newElement_0.bitRate = [NSNumber numberWithUnsignedInt:entry_0.bitRate]; + newElement_0.bitDepth = [NSNumber numberWithUnsignedChar:entry_0.bitDepth]; + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::AllocatedSnapshotStreams::Id: { + using TypeInfo = Attributes::AllocatedSnapshotStreams::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRCameraAVStreamManagementClusterSnapshotStreamStruct * newElement_0; + newElement_0 = [MTRCameraAVStreamManagementClusterSnapshotStreamStruct new]; + newElement_0.snapshotStreamID = [NSNumber numberWithUnsignedShort:entry_0.snapshotStreamID]; + newElement_0.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.imageCodec)]; + newElement_0.frameRate = [NSNumber numberWithUnsignedShort:entry_0.frameRate]; + newElement_0.bitRate = [NSNumber numberWithUnsignedInt:entry_0.bitRate]; + newElement_0.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.minResolution.width = [NSNumber numberWithUnsignedShort:entry_0.minResolution.width]; + newElement_0.minResolution.height = [NSNumber numberWithUnsignedShort:entry_0.minResolution.height]; + newElement_0.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + newElement_0.maxResolution.width = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.width]; + newElement_0.maxResolution.height = [NSNumber numberWithUnsignedShort:entry_0.maxResolution.height]; + newElement_0.quality = [NSNumber numberWithUnsignedChar:entry_0.quality]; + newElement_0.referenceCount = [NSNumber numberWithUnsignedChar:entry_0.referenceCount]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::RankedVideoStreamPrioritiesList::Id: { + using TypeInfo = Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::SoftRecordingPrivacyModeEnabled::Id: { + using TypeInfo = Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::SoftLivestreamPrivacyModeEnabled::Id: { + using TypeInfo = Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::HardPrivacyModeOn::Id: { + using TypeInfo = Attributes::HardPrivacyModeOn::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::NightVision::Id: { + using TypeInfo = Attributes::NightVision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::NightVisionIllum::Id: { + using TypeInfo = Attributes::NightVisionIllum::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::AWBEnabled::Id: { + using TypeInfo = Attributes::AWBEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::AutoShutterSpeedEnabled::Id: { + using TypeInfo = Attributes::AutoShutterSpeedEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::AutoISOEnabled::Id: { + using TypeInfo = Attributes::AutoISOEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Viewport::Id: { + using TypeInfo = Attributes::Viewport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRCameraAVStreamManagementClusterViewportStruct * _Nonnull value; + value = [MTRCameraAVStreamManagementClusterViewportStruct new]; + value.x1 = [NSNumber numberWithUnsignedShort:cppValue.x1]; + value.y1 = [NSNumber numberWithUnsignedShort:cppValue.y1]; + value.x2 = [NSNumber numberWithUnsignedShort:cppValue.x2]; + value.y2 = [NSNumber numberWithUnsignedShort:cppValue.y2]; + return value; + } + case Attributes::SpeakerMuted::Id: { + using TypeInfo = Attributes::SpeakerMuted::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::SpeakerVolumeLevel::Id: { + using TypeInfo = Attributes::SpeakerVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeakerMaxLevel::Id: { + using TypeInfo = Attributes::SpeakerMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::SpeakerMinLevel::Id: { + using TypeInfo = Attributes::SpeakerMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicrophoneMuted::Id: { + using TypeInfo = Attributes::MicrophoneMuted::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::MicrophoneVolumeLevel::Id: { + using TypeInfo = Attributes::MicrophoneVolumeLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicrophoneMaxLevel::Id: { + using TypeInfo = Attributes::MicrophoneMaxLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicrophoneMinLevel::Id: { + using TypeInfo = Attributes::MicrophoneMinLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::MicrophoneAGCEnabled::Id: { + using TypeInfo = Attributes::MicrophoneAGCEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ImageRotation::Id: { + using TypeInfo = Attributes::ImageRotation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::ImageFlipHorizontal::Id: { + using TypeInfo = Attributes::ImageFlipHorizontal::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ImageFlipVertical::Id: { + using TypeInfo = Attributes::ImageFlipVertical::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::LocalVideoRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::LocalSnapshotRecordingEnabled::Id: { + using TypeInfo = Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::StatusLightEnabled::Id: { + using TypeInfo = Attributes::StatusLightEnabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::StatusLightBrightness::Id: { + using TypeInfo = Attributes::StatusLightBrightness::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::DepthSensorStatus::Id: { + using TypeInfo = Attributes::DepthSensorStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForWebRTCTransportProviderCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WebRTCTransportProvider; + switch (aAttributeId) { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRWebRTCTransportProviderClusterWebRTCSessionStruct * newElement_0; + newElement_0 = [MTRWebRTCTransportProviderClusterWebRTCSessionStruct new]; + newElement_0.id = [NSNumber numberWithUnsignedShort:entry_0.id]; + newElement_0.peerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.peerNodeID]; + newElement_0.peerFabricIndex = [NSNumber numberWithUnsignedChar:entry_0.peerFabricIndex]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + if (entry_0.videoStreamID.IsNull()) { + newElement_0.videoStreamID = nil; + } else { + newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID.Value()]; + } + if (entry_0.audioStreamID.IsNull()) { + newElement_0.audioStreamID = nil; + } else { + newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID.Value()]; + } + newElement_0.metadataOptions = [NSNumber numberWithUnsignedChar:entry_0.metadataOptions.Raw()]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForWebRTCTransportRequestorCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + case Attributes::CurrentSessions::Id: { + using TypeInfo = Attributes::CurrentSessions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRWebRTCTransportRequestorClusterWebRTCSessionStruct * newElement_0; + newElement_0 = [MTRWebRTCTransportRequestorClusterWebRTCSessionStruct new]; + newElement_0.id = [NSNumber numberWithUnsignedShort:entry_0.id]; + newElement_0.peerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.peerNodeID]; + newElement_0.peerFabricIndex = [NSNumber numberWithUnsignedChar:entry_0.peerFabricIndex]; + newElement_0.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.streamType)]; + if (entry_0.videoStreamID.IsNull()) { + newElement_0.videoStreamID = nil; + } else { + newElement_0.videoStreamID = [NSNumber numberWithUnsignedShort:entry_0.videoStreamID.Value()]; + } + if (entry_0.audioStreamID.IsNull()) { + newElement_0.audioStreamID = nil; + } else { + newElement_0.audioStreamID = [NSNumber numberWithUnsignedShort:entry_0.audioStreamID.Value()]; + } + newElement_0.metadataOptions = [NSNumber numberWithUnsignedChar:entry_0.metadataOptions.Raw()]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Chime; + switch (aAttributeId) { + case Attributes::InstalledChimeSounds::Id: { + using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRChimeClusterChimeSoundStruct * newElement_0; + newElement_0 = [MTRChimeClusterChimeSoundStruct new]; + newElement_0.chimeID = [NSNumber numberWithUnsignedChar:entry_0.chimeID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ActiveChimeID::Id: { + using TypeInfo = Attributes::ActiveChimeID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::EcosystemInformation; + switch (aAttributeId) { + case Attributes::DeviceDirectory::Id: { + using TypeInfo = Attributes::DeviceDirectory::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTREcosystemInformationClusterEcosystemDeviceStruct * newElement_0; + newElement_0 = [MTREcosystemInformationClusterEcosystemDeviceStruct new]; + if (entry_0.deviceName.HasValue()) { + newElement_0.deviceName = AsString(entry_0.deviceName.Value()); + if (newElement_0.deviceName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.deviceName = nil; + } + if (entry_0.deviceNameLastEdit.HasValue()) { + newElement_0.deviceNameLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.deviceNameLastEdit.Value()]; + } else { + newElement_0.deviceNameLastEdit = nil; + } + newElement_0.bridgedEndpoint = [NSNumber numberWithUnsignedShort:entry_0.bridgedEndpoint]; + newElement_0.originalEndpoint = [NSNumber numberWithUnsignedShort:entry_0.originalEndpoint]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.deviceTypes.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTREcosystemInformationClusterDeviceTypeStruct * newElement_2; + newElement_2 = [MTREcosystemInformationClusterDeviceTypeStruct new]; + newElement_2.deviceType = [NSNumber numberWithUnsignedInt:entry_2.deviceType]; + newElement_2.revision = [NSNumber numberWithUnsignedShort:entry_2.revision]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.deviceTypes = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.uniqueLocationIDs.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSString * newElement_2; + newElement_2 = AsString(entry_2); + if (newElement_2 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.uniqueLocationIDs = array_2; + } + newElement_0.uniqueLocationIDsLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.uniqueLocationIDsLastEdit]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::LocationDirectory::Id: { + using TypeInfo = Attributes::LocationDirectory::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTREcosystemInformationClusterEcosystemLocationStruct * newElement_0; + newElement_0 = [MTREcosystemInformationClusterEcosystemLocationStruct new]; + newElement_0.uniqueLocationID = AsString(entry_0.uniqueLocationID); + if (newElement_0.uniqueLocationID == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.locationDescriptor = [MTRDataTypeLocationDescriptorStruct new]; + newElement_0.locationDescriptor.locationName = AsString(entry_0.locationDescriptor.locationName); + if (newElement_0.locationDescriptor.locationName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (entry_0.locationDescriptor.floorNumber.IsNull()) { + newElement_0.locationDescriptor.floorNumber = nil; + } else { + newElement_0.locationDescriptor.floorNumber = [NSNumber numberWithShort:entry_0.locationDescriptor.floorNumber.Value()]; + } + if (entry_0.locationDescriptor.areaType.IsNull()) { + newElement_0.locationDescriptor.areaType = nil; + } else { + newElement_0.locationDescriptor.areaType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.locationDescriptor.areaType.Value())]; + } + newElement_0.locationDescriptorLastEdit = [NSNumber numberWithUnsignedLongLong:entry_0.locationDescriptorLastEdit]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForCommissionerControlCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CommissionerControl; + switch (aAttributeId) { + case Attributes::SupportedDeviceCategories::Id: { + using TypeInfo = Attributes::SupportedDeviceCategories::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::UnitTesting; + switch (aAttributeId) { + case Attributes::Boolean::Id: { + using TypeInfo = Attributes::Boolean::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Bitmap8::Id: { + using TypeInfo = Attributes::Bitmap8::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::Bitmap16::Id: { + using TypeInfo = Attributes::Bitmap16::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + return value; + } + case Attributes::Bitmap32::Id: { + using TypeInfo = Attributes::Bitmap32::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + return value; + } + case Attributes::Bitmap64::Id: { + using TypeInfo = Attributes::Bitmap64::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Raw()]; + return value; + } + case Attributes::Int8u::Id: { + using TypeInfo = Attributes::Int8u::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::Int16u::Id: { + using TypeInfo = Attributes::Int16u::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19128,9 +20119,18 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ContentAppObserver::Id: { return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::ZoneManagement::Id: { + return DecodeAttributeValueForZoneManagementCluster(aPath.mAttributeId, aReader, aError); + } + case Clusters::CameraAvStreamManagement::Id: { + return DecodeAttributeValueForCameraAVStreamManagementCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeAttributeValueForWebRTCTransportProviderCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::WebRTCTransportRequestor::Id: { + return DecodeAttributeValueForWebRTCTransportRequestorCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeAttributeValueForChimeCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 36c879b528..bba1180802 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -2091,6 +2091,12 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeTCAcknowledgementsRequiredWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeTCUpdateDeadlineWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTCUpdateDeadlineWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTCUpdateDeadlineWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -14756,6 +14762,590 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Zone Management + * + * This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterZoneManagement : MTRGenericBaseCluster + +/** + * Command CreateTwoDCartesianZone + * + * This command SHALL create and store a TwoD Cartesian Zone. + */ +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command UpdateTwoDCartesianZone + * + * The UpdateTwoDCartesianZone SHALL update a stored TwoD Cartesian Zone. + */ +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command GetTwoDCartesianZone + * + * The GetTwoDCartesianZone SHALL return the TwoD Cartesian Zone for the passed in ZoneID. + */ +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithCompletion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +/** + * Command RemoveZone + * + * This command SHALL remove the Zone mapped to the passed in ZoneID. + */ +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedZoneSourcesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedZoneSourcesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedZoneSourcesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeZonesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeZonesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSensitivityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSensitivityWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSensitivityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterZoneManagement (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + +/** + * Cluster Camera AV Stream Management + * + * The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterCameraAVStreamManagement : MTRGenericBaseCluster + +/** + * Command AudioStreamAllocate + * + * This command SHALL allocate an audio stream on the camera and return an allocated audio stream identifier. + */ +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AudioStreamDeallocate + * + * This command SHALL deallocate an audio stream on the camera, corresponding to the given audio stream identifier. + */ +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamAllocate + * + * This command SHALL allocate a video stream on the camera and return an allocated video stream identifier. + */ +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamModify + * + * This command SHALL be used to modify the resolution of a stream specified by the VideoStreamID. + */ +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command VideoStreamDeallocate + * + * This command SHALL deallocate a video stream on the camera, corresponding to the given video stream identifier. + */ +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SnapshotStreamAllocate + * + * This command SHALL allocate a snapshot stream on the device and return an allocated snapshot stream identifier. + */ +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SnapshotStreamDeallocate + * + * This command SHALL deallocate an snapshot stream on the camera, corresponding to the given snapshot stream identifier. + */ +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetStreamPriorities + * + * This command SHALL set the relative priorities of the various stream types on the camera. + */ +- (void)setStreamPrioritiesWithParams:(MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command CaptureSnapshot + * + * This command SHALL return a Snapshot from the camera. + */ +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetViewport + * + * This command sets the viewport in all video streams. + */ +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageRotation + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageFlipHorizontal + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command SetImageFlipVertical + * + * The data fields for this command SHALL be as follows: + */ +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxConcurrentVideoEncodersWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxConcurrentVideoEncodersWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxConcurrentVideoEncodersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxEncodedPixelRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxEncodedPixelRateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxEncodedPixelRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeVideoSensorParamsWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeVideoSensorParamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeVideoSensorParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionCapableWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMinViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMinViewportWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMinViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRateDistortionTradeOffPointsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRateDistortionTradeOffPointsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneCapabilitiesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerCapabilitiesWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeTwoWayTalkSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeTwoWayTalkSupportWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeTwoWayTalkSupportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSupportedSnapshotParamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSupportedSnapshotParamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSupportedSnapshotParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMaxNetworkBandwidthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMaxNetworkBandwidthWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMaxNetworkBandwidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentFrameRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentFrameRateWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentFrameRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHDRModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHDRModeEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHDRModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentVideoCodecsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentVideoCodecsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentVideoCodecsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentSnapshotConfigWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentSnapshotConfigWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentSnapshotConfigWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFabricsUsingCameraWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFabricsUsingCameraWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFabricsUsingCameraWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedVideoStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedVideoStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedVideoStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedAudioStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedAudioStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedAudioStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAllocatedSnapshotStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAllocatedSnapshotStreamsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAllocatedSnapshotStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeRankedVideoStreamPrioritiesListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeRankedVideoStreamPrioritiesListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeRankedVideoStreamPrioritiesListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSoftRecordingPrivacyModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSoftRecordingPrivacyModeEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSoftRecordingPrivacyModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSoftLivestreamPrivacyModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSoftLivestreamPrivacyModeEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSoftLivestreamPrivacyModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeHardPrivacyModeOnWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeHardPrivacyModeOnWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeHardPrivacyModeOnWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNightVisionIllumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNightVisionIllumWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNightVisionIllumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAWBEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAWBEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAWBEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAutoShutterSpeedEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAutoShutterSpeedEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAutoShutterSpeedEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAutoISOEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoISOEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoISOEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAutoISOEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAutoISOEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeViewportWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerMutedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerVolumeLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerMaxLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeSpeakerMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeSpeakerMinLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeSpeakerMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneMutedWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneVolumeLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneMaxLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneMinLevelWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeMicrophoneAGCEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeMicrophoneAGCEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeMicrophoneAGCEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageRotationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageRotationWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageRotationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageFlipHorizontalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageFlipHorizontalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageFlipHorizontalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeImageFlipVerticalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeImageFlipVerticalWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeImageFlipVerticalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeLocalVideoRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeLocalVideoRecordingEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeLocalVideoRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeLocalSnapshotRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeLocalSnapshotRecordingEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeLocalSnapshotRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStatusLightEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStatusLightEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStatusLightEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeStatusLightBrightnessWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeStatusLightBrightnessWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeStatusLightBrightnessWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeDepthSensorStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeDepthSensorStatusWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeDepthSensorStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterCameraAVStreamManagement (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster WebRTC Transport Provider * @@ -14854,6 +15444,98 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster WebRTC Transport Requestor + * + * The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterWebRTCTransportRequestor : MTRGenericBaseCluster + +/** + * Command Offer + * + * This command provides the stream requestor with WebRTC session details. It is sent following the receipt of a SolicitOffer command or a re-Offer initiated by the Provider. + */ +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command Answer + * + * This command provides the stream requestor with the WebRTC session details (i.e. Session ID and SDP answer). It is the next command in the Offer/Answer flow to the ProvideOffer command. + */ +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command ICECandidate + * + * This command provides an ICE candidate to the stream requestor in a WebRTC session. + */ +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command End + * + * This command notifies the stream requestor that the provider has ended the WebRTC session. + */ +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterWebRTCTransportRequestor (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * @@ -20272,6 +20954,86 @@ typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRZoneManagementStatusCode) { + MTRZoneManagementStatusCodeZoneNotFound MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRZoneManagementStatusCodeZoneInUse MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneEventStoppedReason) { + MTRZoneManagementZoneEventStoppedReasonActionStopped MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneEventStoppedReasonTimeout MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneEventTriggeredReason) { + MTRZoneManagementZoneEventTriggeredReasonMotion MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneSource) { + MTRZoneManagementZoneSourceMfg MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneSourceUser MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneType) { + MTRZoneManagementZoneTypeTwoDCARTZone MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRZoneManagementZoneUse) { + MTRZoneManagementZoneUseMotion MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRZoneManagementZoneUsePrivacy MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRZoneManagementZoneUseFocus MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRZoneManagementFeature) { + MTRZoneManagementFeatureTwoDimensionalCartesianZone MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementAudioCodec) { + MTRCameraAVStreamManagementAudioCodecOPUS MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementAudioCodecAACLC MTR_PROVISIONALLY_AVAILABLE = 0x01, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementImageCodec) { + MTRCameraAVStreamManagementImageCodecJPEG MTR_PROVISIONALLY_AVAILABLE = 0x00, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementStreamType) { + MTRCameraAVStreamManagementStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementStreamTypeAnalysis MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRCameraAVStreamManagementStreamTypeLiveView MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementTriStateAuto) { + MTRCameraAVStreamManagementTriStateAutoOff MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementTriStateAutoOn MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementTriStateAutoAuto MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementTwoWayTalkSupportType) { + MTRCameraAVStreamManagementTwoWayTalkSupportTypeNotSupported MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementTwoWayTalkSupportTypeHalfDuplex MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementTwoWayTalkSupportTypeFullDuplex MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRCameraAVStreamManagementVideoCodec) { + MTRCameraAVStreamManagementVideoCodecH264 MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRCameraAVStreamManagementVideoCodecHEVC MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRCameraAVStreamManagementVideoCodecVVC MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRCameraAVStreamManagementVideoCodecAV1 MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint32_t, MTRCameraAVStreamManagementFeature) { + MTRCameraAVStreamManagementFeaturePrivacy MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRCameraAVStreamManagementFeatureAudio MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRCameraAVStreamManagementFeatureSpeaker MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRCameraAVStreamManagementFeatureImageControl MTR_PROVISIONALLY_AVAILABLE = 0x8, + MTRCameraAVStreamManagementFeatureVideo MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRCameraAVStreamManagementFeatureSnapshot MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTRCameraAVStreamManagementFeatureWatermark MTR_PROVISIONALLY_AVAILABLE = 0x40, + MTRCameraAVStreamManagementFeatureOnScreenDisplay MTR_PROVISIONALLY_AVAILABLE = 0x80, + MTRCameraAVStreamManagementFeatureLocalStorage MTR_PROVISIONALLY_AVAILABLE = 0x100, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRWebRTCTransportProviderStreamType) { MTRWebRTCTransportProviderStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRWebRTCTransportProviderStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -20298,6 +21060,32 @@ typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportProviderWebRTCMetadataOptions) { MTRWebRTCTransportProviderWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorStreamType) { + MTRWebRTCTransportRequestorStreamTypeInternal MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRWebRTCTransportRequestorStreamTypeRecording MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRWebRTCTransportRequestorStreamTypeAnalysis MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRWebRTCTransportRequestorStreamTypeLiveView MTR_PROVISIONALLY_AVAILABLE = 0x03, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRWebRTCTransportRequestorWebRTCEndReason) { + MTRWebRTCTransportRequestorWebRTCEndReasonIceFailed MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRWebRTCTransportRequestorWebRTCEndReasonIceTimeout MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRWebRTCTransportRequestorWebRTCEndReasonUserHangup MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRWebRTCTransportRequestorWebRTCEndReasonUserBusy MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRWebRTCTransportRequestorWebRTCEndReasonReplaced MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRWebRTCTransportRequestorWebRTCEndReasonNoUserMedia MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRWebRTCTransportRequestorWebRTCEndReasonInviteTimeout MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRWebRTCTransportRequestorWebRTCEndReasonAnsweredElsewhere MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRWebRTCTransportRequestorWebRTCEndReasonOutOfResources MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRWebRTCTransportRequestorWebRTCEndReasonMediaTimeout MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRWebRTCTransportRequestorWebRTCEndReasonLowPower MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRWebRTCTransportRequestorWebRTCEndReasonUnknownReason MTR_PROVISIONALLY_AVAILABLE = 0x0B, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRWebRTCTransportRequestorWebRTCMetadataOptions) { + MTRWebRTCTransportRequestorWebRTCMetadataOptionsDataTLV MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint32_t, MTRCommissionerControlSupportedDeviceCategoryBitmap) { MTRCommissionerControlSupportedDeviceCategoryBitmapFabricSynchronization MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 5bee560bd0..cda854f0c8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -16644,6 +16644,42 @@ + (void)readAttributeTCAcknowledgementsRequiredWithClusterStateCache:(MTRCluster completion:completion]; } +- (void)readAttributeTCUpdateDeadlineWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTCUpdateDeadlineWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTCUpdateDeadlineWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = GeneralCommissioning::Attributes::TCUpdateDeadline::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = GeneralCommissioning::Attributes::GeneratedCommandList::TypeInfo; @@ -102085,12 +102121,12 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end -@implementation MTRBaseClusterWebRTCTransportProvider +@implementation MTRBaseClusterZoneManagement -- (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams + params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; } @@ -102100,69 +102136,73 @@ - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferPar auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::SolicitOffer::Type; + using RequestType = ZoneManagement::Commands::CreateTwoDCartesianZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) commandPayload:params timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRWebRTCTransportProviderClusterSolicitOfferResponseParams.class + responseClass:MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams.class queue:self.callbackQueue completion:responseHandler]; } -- (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideOfferParams + params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(response, error); + completion(error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideOffer::Type; + using RequestType = ZoneManagement::Commands::UpdateTwoDCartesianZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) commandPayload:params timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRWebRTCTransportProviderClusterProvideOfferResponseParams.class + responseClass:nil queue:self.callbackQueue completion:responseHandler]; } -- (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params completion:(MTRStatusCompletion)completion +- (void)getTwoDCartesianZoneWithCompletion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTwoDCartesianZoneWithParams:nil completion:completion]; +} +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams + params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideAnswer::Type; + using RequestType = ZoneManagement::Commands::GetTwoDCartesianZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) commandPayload:params timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams.class queue:self.callbackQueue completion:responseHandler]; } -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params completion:(MTRStatusCompletion)completion +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + params = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; } @@ -102172,7 +102212,7 @@ - (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideI auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + using RequestType = ZoneManagement::Commands::RemoveZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -102183,34 +102223,82 @@ - (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideI queue:self.callbackQueue completion:responseHandler]; } -- (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams *)params completion:(MTRStatusCompletion)completion + +- (void)readAttributeSupportedZoneSourcesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterEndSessionParams - alloc] init]; - } + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; +- (void)subscribeAttributeSupportedZoneSourcesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; ++ (void)readAttributeSupportedZoneSourcesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::SupportedZoneSources::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} - using RequestType = WebRTCTransportProvider::Commands::EndSession::Type; - [self.device _invokeKnownCommandWithEndpointID:self.endpointID - clusterID:@(RequestType::GetClusterId()) - commandID:@(RequestType::GetCommandId()) - commandPayload:params - timedInvokeTimeout:timedInvokeTimeoutMs - serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil +- (void)readAttributeZonesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil queue:self.callbackQueue - completion:responseHandler]; + completion:completion]; } -- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +- (void)subscribeAttributeZonesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeZonesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Zones::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTimeControlWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102219,11 +102307,63 @@ - (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable completion:completion]; } -- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion { - using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + [self writeAttributeTimeControlWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeTimeControlWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [MTRZoneManagementClusterZoneTriggeringTimeControlStruct class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (MTRZoneManagementClusterZoneTriggeringTimeControlStruct *)value[i_0]; + listHolder_0->mList[i_0].initialDuration = element_0.initialDuration.unsignedShortValue; + listHolder_0->mList[i_0].augmentationDuration = element_0.augmentationDuration.unsignedShortValue; + listHolder_0->mList[i_0].maxDuration = element_0.maxDuration.unsignedIntValue; + listHolder_0->mList[i_0].blindDuration = element_0.blindDuration.unsignedShortValue; + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeTimeControlWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102233,9 +102373,73 @@ - (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams * _Nonnu subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeTimeControlWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::TimeControl::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSensitivityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSensitivityWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSensitivityWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSensitivityWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSensitivityWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = ZoneManagement::Attributes::Sensitivity::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102246,7 +102450,7 @@ + (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheC - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102259,7 +102463,7 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102271,7 +102475,7 @@ - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::GeneratedCommandList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102282,7 +102486,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102295,7 +102499,7 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102307,7 +102511,7 @@ - (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _N + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AcceptedCommandList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102318,7 +102522,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa - (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102331,7 +102535,7 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102343,7 +102547,7 @@ - (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)par + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::EventList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102354,7 +102558,7 @@ + (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContain - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102367,7 +102571,7 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102379,7 +102583,7 @@ - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::AttributeList::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102390,7 +102594,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102403,7 +102607,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102415,7 +102619,7 @@ - (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)pa + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::FeatureMap::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -102426,7 +102630,7 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102439,7 +102643,7 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102451,7 +102655,3627 @@ - (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnu + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + using TypeInfo = ZoneManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + +@implementation MTRBaseClusterCameraAVStreamManagement + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamModify::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setStreamPrioritiesWithParams:(MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetStreamPriorities::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::CaptureSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetViewport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageRotation::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipVertical::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeMaxConcurrentVideoEncodersWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxConcurrentVideoEncodersWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxConcurrentVideoEncodersWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxEncodedPixelRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxEncodedPixelRateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxEncodedPixelRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeVideoSensorParamsWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeVideoSensorParamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeVideoSensorParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::VideoSensorParams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionCapableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeNightVisionCapableWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionCapableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionCapable::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMinViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewport::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMinViewportWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewport::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMinViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MinViewport::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRateDistortionTradeOffPointsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeRateDistortionTradeOffPointsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRateDistortionTradeOffPointsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxPreRollBufferSizeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxPreRollBufferSizeWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxPreRollBufferSizeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMicrophoneCapabilitiesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneCapabilities::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerCapabilitiesWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSpeakerCapabilitiesWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerCapabilitiesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerCapabilities::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeTwoWayTalkSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeTwoWayTalkSupportWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeTwoWayTalkSupportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::TwoWayTalkSupport::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSupportedSnapshotParamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeSupportedSnapshotParamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSupportedSnapshotParamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SupportedSnapshotParams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMaxNetworkBandwidthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeMaxNetworkBandwidthWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMaxNetworkBandwidthWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentFrameRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentFrameRateWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentFrameRateWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentFrameRate::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHDRModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeHDRModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeHDRModeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHDRModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HDRModeEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentVideoCodecsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentVideoCodecsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentVideoCodecsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentVideoCodecs::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeCurrentSnapshotConfigWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentSnapshotConfigWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentSnapshotConfigWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFabricsUsingCameraWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFabricsUsingCameraWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFabricsUsingCameraWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FabricsUsingCamera::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedVideoStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedVideoStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedVideoStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedVideoStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedAudioStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedAudioStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedAudioStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedAudioStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAllocatedSnapshotStreamsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAllocatedSnapshotStreamsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAllocatedSnapshotStreamsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeRankedVideoStreamPrioritiesListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + TypeInfo::Type cppValue; + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (value.count != 0) { + auto * listHolder_0 = new ListHolder(value.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < value.count; ++i_0) { + if ( ! [value[i_0] isKindOfClass: [NSNumber class]] ) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *)value[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>(element_0.unsignedCharValue); + } + cppValue = ListType_0(listHolder_0->mList, value.count); + } else { + cppValue = ListType_0(); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeRankedVideoStreamPrioritiesListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeRankedVideoStreamPrioritiesListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSoftRecordingPrivacyModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSoftRecordingPrivacyModeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSoftRecordingPrivacyModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSoftLivestreamPrivacyModeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSoftLivestreamPrivacyModeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSoftLivestreamPrivacyModeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeHardPrivacyModeOnWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyModeOn::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeHardPrivacyModeOnWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyModeOn::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeHardPrivacyModeOnWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::HardPrivacyModeOn::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNightVisionWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeNightVisionWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNightVisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNightVisionIllumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeNightVisionIllumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeNightVisionIllumWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNightVisionIllumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::NightVisionIllum::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAWBEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AWBEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeAWBEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeAWBEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeAWBEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::AWBEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeAWBEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AWBEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAWBEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AWBEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAutoShutterSpeedEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeAutoShutterSpeedEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeAutoShutterSpeedEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAutoShutterSpeedEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAutoISOEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoISOEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeAutoISOEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeAutoISOEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeAutoISOEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::AutoISOEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeAutoISOEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoISOEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAutoISOEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AutoISOEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeViewportWithCompletion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeViewportWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeViewportWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::Viewport::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerMutedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerMutedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMuted::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerVolumeLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerMaxLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMaxLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeSpeakerMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeSpeakerMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeSpeakerMinLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeSpeakerMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::SpeakerMinLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneMutedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicrophoneMutedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicrophoneMutedWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneMutedWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMuted::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneVolumeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicrophoneVolumeLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneVolumeLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicrophoneMaxLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicrophoneMaxLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneMaxLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMinLevel::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicrophoneMinLevelWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMinLevel::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicrophoneMinLevelWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMinLevel::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneMinLevelWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneMinLevel::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeMicrophoneAGCEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeMicrophoneAGCEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeMicrophoneAGCEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageRotationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageRotationWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageRotationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageRotation::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageFlipHorizontalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageFlipHorizontalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageFlipHorizontalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipHorizontal::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeImageFlipVerticalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeImageFlipVerticalWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeImageFlipVerticalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ImageFlipVertical::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeLocalVideoRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeLocalVideoRecordingEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeLocalVideoRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeLocalSnapshotRecordingEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeLocalSnapshotRecordingEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeLocalSnapshotRecordingEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStatusLightEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeStatusLightEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeStatusLightEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStatusLightEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightEnabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeStatusLightBrightnessWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeStatusLightBrightnessWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeStatusLightBrightnessWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeStatusLightBrightnessWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::StatusLightBrightness::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeDepthSensorStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeDepthSensorStatusWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(value.unsignedCharValue); + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeDepthSensorStatusWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeDepthSensorStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::DepthSensorStatus::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = CameraAvStreamManagement::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + +@implementation MTRBaseClusterWebRTCTransportProvider + +- (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::SolicitOffer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWebRTCTransportProviderClusterSolicitOfferResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferParams *)params completion:(void (^)(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideOffer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWebRTCTransportProviderClusterProvideOfferResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideAnswer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterEndSessionParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::EndSession::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::CurrentSessions::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportProvider::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + +@implementation MTRBaseClusterWebRTCTransportRequestor + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Offer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Answer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterEndParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::End::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeCurrentSessionsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeCurrentSessionsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeCurrentSessionsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::CurrentSessions::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = WebRTCTransportRequestor::Attributes::ClusterRevision::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 97e0c30e92..9decbec451 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -197,7 +197,10 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, + MTRClusterIDTypeZoneManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000550, + MTRClusterIDTypeCameraAVStreamManagementID MTR_PROVISIONALLY_AVAILABLE = 0x00000551, MTRClusterIDTypeWebRTCTransportProviderID MTR_PROVISIONALLY_AVAILABLE = 0x00000553, + MTRClusterIDTypeWebRTCTransportRequestorID MTR_PROVISIONALLY_AVAILABLE = 0x00000554, MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, MTRClusterIDTypeEcosystemInformationID MTR_PROVISIONALLY_AVAILABLE = 0x00000750, MTRClusterIDTypeCommissionerControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000751, @@ -1107,6 +1110,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCMinRequiredVersionID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsRequiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterGeneralCommissioningAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterGeneralCommissioningAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -4740,6 +4744,73 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ZoneManagement attributes + MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterZoneManagementAttributeZonesID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterZoneManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + + // Cluster CameraAVStreamManagement attributes + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewportID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID MTR_PROVISIONALLY_AVAILABLE = 0x0000000F, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID MTR_PROVISIONALLY_AVAILABLE = 0x00000010, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000011, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000012, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID MTR_PROVISIONALLY_AVAILABLE = 0x00000013, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID MTR_PROVISIONALLY_AVAILABLE = 0x00000014, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000015, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000016, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeOnID MTR_PROVISIONALLY_AVAILABLE = 0x00000017, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID MTR_PROVISIONALLY_AVAILABLE = 0x00000018, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID MTR_PROVISIONALLY_AVAILABLE = 0x00000019, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000001A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoShutterSpeedEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000001B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoISOEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000001C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID MTR_PROVISIONALLY_AVAILABLE = 0x0000001D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMutedID MTR_PROVISIONALLY_AVAILABLE = 0x0000001E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID MTR_PROVISIONALLY_AVAILABLE = 0x0000001F, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000020, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000021, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMutedID MTR_PROVISIONALLY_AVAILABLE = 0x00000022, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneVolumeLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000023, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMaxLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000024, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMinLevelID MTR_PROVISIONALLY_AVAILABLE = 0x00000025, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneAGCEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000026, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID MTR_PROVISIONALLY_AVAILABLE = 0x00000027, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID MTR_PROVISIONALLY_AVAILABLE = 0x00000028, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID MTR_PROVISIONALLY_AVAILABLE = 0x00000029, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000002A, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000002B, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x0000002C, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID MTR_PROVISIONALLY_AVAILABLE = 0x0000002D, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID MTR_PROVISIONALLY_AVAILABLE = 0x0000002E, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportProvider attributes MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -4749,6 +4820,15 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster WebRTCTransportRequestor attributes + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster Chime attributes MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -6953,6 +7033,33 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster ZoneManagement commands + MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterZoneManagementCommandUpdateTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterZoneManagementCommandRemoveZoneID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + + // Cluster CameraAVStreamManagement commands + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamModifyID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamDeallocateID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetStreamPrioritiesID MTR_PROVISIONALLY_AVAILABLE = 0x0000000A, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotID MTR_PROVISIONALLY_AVAILABLE = 0x0000000B, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000C, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetViewportID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageRotationID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipHorizontalID MTR_PROVISIONALLY_AVAILABLE = 0x0000000F, + MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipVerticalID MTR_PROVISIONALLY_AVAILABLE = 0x00000010, + // Cluster WebRTCTransportProvider commands MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterWebRTCTransportProviderCommandSolicitOfferResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, @@ -6962,6 +7069,12 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterWebRTCTransportProviderCommandProvideICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, MTRCommandIDTypeClusterWebRTCTransportProviderCommandEndSessionID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, + // Cluster WebRTCTransportRequestor commands + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandOfferID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandAnswerID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, + MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, + // Cluster Chime commands MTRCommandIDTypeClusterChimeCommandPlayChimeSoundID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, @@ -7546,6 +7659,15 @@ typedef NS_ENUM(uint32_t, MTREventIDType) { // Cluster ContentControl events MTREventIDTypeClusterContentControlEventRemainingScreenTimeExpiredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster ZoneManagement events + MTREventIDTypeClusterZoneManagementEventZoneTriggeredID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterZoneManagementEventZoneStoppedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + + // Cluster CameraAVStreamManagement events + MTREventIDTypeClusterCameraAVStreamManagementEventVideoStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTREventIDTypeClusterCameraAVStreamManagementEventAudioStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTREventIDTypeClusterCameraAVStreamManagementEventSnapshotStreamChangedID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + // Cluster CommissionerControl events MTREventIDTypeClusterCommissionerControlEventCommissioningRequestResultID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 46791f9c12..04f3350f75 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -369,9 +369,18 @@ case MTRClusterIDTypeContentAppObserverID: result = @"ContentAppObserver"; break; + case MTRClusterIDTypeZoneManagementID: + result = @"ZoneManagement"; + break; + case MTRClusterIDTypeCameraAVStreamManagementID: + result = @"CameraAVStreamManagement"; + break; case MTRClusterIDTypeWebRTCTransportProviderID: result = @"WebRTCTransportProvider"; break; + case MTRClusterIDTypeWebRTCTransportRequestorID: + result = @"WebRTCTransportRequestor"; + break; case MTRClusterIDTypeChimeID: result = @"Chime"; break; @@ -389,7 +398,7 @@ break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -442,7 +451,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -481,7 +490,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -536,7 +545,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -627,7 +636,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -662,7 +671,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -717,7 +726,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -756,7 +765,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -819,7 +828,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -866,7 +875,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -993,7 +1002,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1028,7 +1037,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1079,7 +1088,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1122,7 +1131,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1169,7 +1178,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1208,7 +1217,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1247,7 +1256,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1410,7 +1419,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1456,6 +1465,10 @@ result = @"TCAcknowledgementsRequired"; break; + case MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID: + result = @"TCUpdateDeadline"; + break; + case MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; @@ -1481,7 +1494,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1560,7 +1573,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1595,7 +1608,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1666,7 +1679,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -1717,7 +1730,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2004,7 +2017,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2091,7 +2104,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2162,7 +2175,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2249,7 +2262,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2352,7 +2365,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2399,7 +2412,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2446,7 +2459,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2505,7 +2518,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2556,7 +2569,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2595,7 +2608,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2634,7 +2647,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2673,7 +2686,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2748,7 +2761,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2795,7 +2808,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2854,7 +2867,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2905,7 +2918,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -2948,7 +2961,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3007,7 +3020,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3058,7 +3071,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3109,7 +3122,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3160,7 +3173,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3203,7 +3216,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3246,7 +3259,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3305,7 +3318,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3352,7 +3365,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3403,7 +3416,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3442,7 +3455,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3529,7 +3542,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3580,7 +3593,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3623,7 +3636,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3694,7 +3707,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3753,7 +3766,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3812,7 +3825,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3859,7 +3872,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3918,7 +3931,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -3977,7 +3990,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4044,7 +4057,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4123,7 +4136,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4234,7 +4247,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4293,7 +4306,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4352,7 +4365,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4419,7 +4432,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4462,7 +4475,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4529,7 +4542,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4656,7 +4669,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4711,7 +4724,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4754,7 +4767,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4805,7 +4818,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4856,7 +4869,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -4907,7 +4920,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5122,7 +5135,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5245,7 +5258,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5304,7 +5317,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5431,7 +5444,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5706,7 +5719,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5789,7 +5802,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -5836,7 +5849,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6079,7 +6092,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6170,7 +6183,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6225,7 +6238,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6276,7 +6289,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6347,7 +6360,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6398,7 +6411,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6449,7 +6462,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6540,7 +6553,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6619,7 +6632,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6698,7 +6711,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6777,7 +6790,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6856,7 +6869,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -6935,7 +6948,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7014,7 +7027,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7093,7 +7106,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7172,7 +7185,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7251,7 +7264,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7330,7 +7343,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7373,7 +7386,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7432,7 +7445,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7479,7 +7492,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7522,7 +7535,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7569,7 +7582,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7612,7 +7625,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7691,7 +7704,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7734,7 +7747,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7769,7 +7782,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7804,7 +7817,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7847,7 +7860,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7890,7 +7903,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -7933,7 +7946,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8000,7 +8013,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8035,7 +8048,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8102,7 +8115,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8137,7 +8150,281 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + + case MTRClusterIDTypeZoneManagementID: + + switch (attributeID) { + + // Cluster ZoneManagement attributes + case MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID: + result = @"SupportedZoneSources"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeZonesID: + result = @"Zones"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID: + result = @"TimeControl"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID: + result = @"Sensitivity"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (attributeID) { + + // Cluster CameraAVStreamManagement attributes + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID: + result = @"MaxConcurrentVideoEncoders"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID: + result = @"MaxEncodedPixelRate"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID: + result = @"VideoSensorParams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID: + result = @"NightVisionCapable"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewportID: + result = @"MinViewport"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID: + result = @"RateDistortionTradeOffPoints"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID: + result = @"MaxPreRollBufferSize"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID: + result = @"MicrophoneCapabilities"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID: + result = @"SpeakerCapabilities"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID: + result = @"TwoWayTalkSupport"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID: + result = @"SupportedSnapshotParams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID: + result = @"MaxNetworkBandwidth"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID: + result = @"CurrentFrameRate"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeEnabledID: + result = @"HDRModeEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID: + result = @"CurrentVideoCodecs"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID: + result = @"CurrentSnapshotConfig"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID: + result = @"FabricsUsingCamera"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID: + result = @"AllocatedVideoStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID: + result = @"AllocatedAudioStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID: + result = @"AllocatedSnapshotStreams"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID: + result = @"RankedVideoStreamPrioritiesList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeEnabledID: + result = @"SoftRecordingPrivacyModeEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeEnabledID: + result = @"SoftLivestreamPrivacyModeEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeOnID: + result = @"HardPrivacyModeOn"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID: + result = @"NightVision"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID: + result = @"NightVisionIllum"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBEnabledID: + result = @"AWBEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoShutterSpeedEnabledID: + result = @"AutoShutterSpeedEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoISOEnabledID: + result = @"AutoISOEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID: + result = @"Viewport"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMutedID: + result = @"SpeakerMuted"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID: + result = @"SpeakerVolumeLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID: + result = @"SpeakerMaxLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID: + result = @"SpeakerMinLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMutedID: + result = @"MicrophoneMuted"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneVolumeLevelID: + result = @"MicrophoneVolumeLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMaxLevelID: + result = @"MicrophoneMaxLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMinLevelID: + result = @"MicrophoneMinLevel"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneAGCEnabledID: + result = @"MicrophoneAGCEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID: + result = @"ImageRotation"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID: + result = @"ImageFlipHorizontal"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID: + result = @"ImageFlipVertical"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID: + result = @"LocalVideoRecordingEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID: + result = @"LocalSnapshotRecordingEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightEnabledID: + result = @"StatusLightEnabled"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID: + result = @"StatusLightBrightness"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID: + result = @"DepthSensorStatus"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8176,7 +8463,46 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (attributeID) { + + // Cluster WebRTCTransportRequestor attributes + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID: + result = @"CurrentSessions"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8223,7 +8549,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8266,7 +8592,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8305,7 +8631,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8696,7 +9022,7 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; @@ -8735,13 +9061,13 @@ break; default: - result = [NSString stringWithFormat:@"", attributeID]; + result = [NSString stringWithFormat:@"", attributeID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -8769,7 +9095,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8803,7 +9129,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8837,7 +9163,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8883,7 +9209,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8893,7 +9219,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8903,7 +9229,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8913,7 +9239,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8927,7 +9253,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8985,7 +9311,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -8995,7 +9321,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9017,7 +9343,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9031,7 +9357,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9041,7 +9367,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9051,7 +9377,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9061,7 +9387,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9071,7 +9397,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9081,7 +9407,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9107,7 +9433,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9145,7 +9471,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9159,7 +9485,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9181,7 +9507,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9195,7 +9521,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9209,7 +9535,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9223,7 +9549,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9237,7 +9563,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9267,7 +9593,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9281,7 +9607,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9291,7 +9617,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9313,7 +9639,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9355,7 +9681,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9381,7 +9707,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9391,7 +9717,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9401,7 +9727,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9411,7 +9737,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9433,7 +9759,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9459,7 +9785,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9485,7 +9811,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9499,7 +9825,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9509,7 +9835,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9523,7 +9849,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9537,7 +9863,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9551,7 +9877,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9561,7 +9887,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9575,7 +9901,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9589,7 +9915,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9603,7 +9929,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9613,7 +9939,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9627,7 +9953,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9637,7 +9963,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9651,7 +9977,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9669,7 +9995,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9679,7 +10005,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9697,7 +10023,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9723,7 +10049,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9745,7 +10071,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9787,7 +10113,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9801,7 +10127,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9815,7 +10141,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9833,7 +10159,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9851,7 +10177,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9861,7 +10187,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9871,7 +10197,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9889,7 +10215,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9919,7 +10245,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9937,7 +10263,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -9979,7 +10305,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10017,7 +10343,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10027,7 +10353,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10037,7 +10363,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10051,7 +10377,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10065,7 +10391,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10079,7 +10405,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10173,7 +10499,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10211,7 +10537,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10229,7 +10555,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10239,7 +10565,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10277,7 +10603,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10291,7 +10617,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10301,7 +10627,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10387,7 +10713,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10397,7 +10723,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10407,7 +10733,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10417,7 +10743,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10427,7 +10753,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10437,7 +10763,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10447,7 +10773,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10457,7 +10783,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10467,7 +10793,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10477,7 +10803,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10487,7 +10813,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10497,7 +10823,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10507,7 +10833,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10517,7 +10843,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10527,7 +10853,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10537,7 +10863,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10547,7 +10873,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10557,7 +10883,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10571,7 +10897,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10597,7 +10923,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10619,7 +10945,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10629,7 +10955,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10663,7 +10989,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10677,7 +11003,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10743,7 +11069,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10769,7 +11095,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10783,7 +11109,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10797,7 +11123,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10815,7 +11141,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10833,7 +11159,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10855,7 +11181,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10865,7 +11191,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10887,7 +11213,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10937,7 +11263,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10951,7 +11277,95 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeZoneManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneID: + result = @"CreateTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandUpdateTwoDCartesianZoneID: + result = @"UpdateTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneID: + result = @"GetTwoDCartesianZone"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandRemoveZoneID: + result = @"RemoveZone"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateID: + result = @"AudioStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamDeallocateID: + result = @"AudioStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateID: + result = @"VideoStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamModifyID: + result = @"VideoStreamModify"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamDeallocateID: + result = @"VideoStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateID: + result = @"SnapshotStreamAllocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamDeallocateID: + result = @"SnapshotStreamDeallocate"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetStreamPrioritiesID: + result = @"SetStreamPriorities"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotID: + result = @"CaptureSnapshot"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetViewportID: + result = @"SetViewport"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageRotationID: + result = @"SetImageRotation"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipHorizontalID: + result = @"SetImageFlipHorizontal"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSetImageFlipVerticalID: + result = @"SetImageFlipVertical"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10981,7 +11395,33 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (commandID) { + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandOfferID: + result = @"Offer"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandAnswerID: + result = @"Answer"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandICECandidateID: + result = @"ICECandidate"; + break; + + case MTRCommandIDTypeClusterWebRTCTransportRequestorCommandEndID: + result = @"End"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -10995,7 +11435,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11005,7 +11445,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11023,7 +11463,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11141,7 +11581,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11159,13 +11599,13 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -11183,7 +11623,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11209,7 +11649,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11219,7 +11659,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11229,7 +11669,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11239,7 +11679,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11249,7 +11689,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11259,7 +11699,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11273,7 +11713,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11283,7 +11723,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11293,7 +11733,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11311,7 +11751,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11321,7 +11761,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11331,7 +11771,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11341,7 +11781,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11351,7 +11791,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11361,7 +11801,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11371,7 +11811,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11397,7 +11837,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11423,7 +11863,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11437,7 +11877,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11455,7 +11895,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11465,7 +11905,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11475,7 +11915,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11485,7 +11925,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11495,7 +11935,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11509,7 +11949,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11519,7 +11959,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11529,7 +11969,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11539,7 +11979,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11565,7 +12005,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11583,7 +12023,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11593,7 +12033,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11603,7 +12043,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11613,7 +12053,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11631,7 +12071,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11641,7 +12081,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11655,7 +12095,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11669,7 +12109,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11679,7 +12119,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11689,7 +12129,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11703,7 +12143,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11717,7 +12157,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11727,7 +12167,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11741,7 +12181,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11755,7 +12195,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11765,7 +12205,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11775,7 +12215,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11789,7 +12229,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11799,7 +12239,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11809,7 +12249,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11819,7 +12259,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11829,7 +12269,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11839,7 +12279,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11853,7 +12293,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11867,7 +12307,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11905,7 +12345,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11915,7 +12355,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11925,7 +12365,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11935,7 +12375,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11945,7 +12385,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11955,7 +12395,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11965,7 +12405,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11975,7 +12415,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11985,7 +12425,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -11995,7 +12435,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12005,7 +12445,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12019,7 +12459,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12029,7 +12469,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12039,7 +12479,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12053,7 +12493,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12067,7 +12507,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12081,7 +12521,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12115,7 +12555,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12125,7 +12565,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12143,7 +12583,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12153,7 +12593,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12171,7 +12611,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12181,7 +12621,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12191,7 +12631,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12201,7 +12641,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12211,7 +12651,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12221,7 +12661,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12231,7 +12671,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12241,7 +12681,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12251,7 +12691,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12261,7 +12701,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12271,7 +12711,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12281,7 +12721,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12291,7 +12731,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12301,7 +12741,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12311,7 +12751,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12321,7 +12761,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12331,7 +12771,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12341,7 +12781,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12351,7 +12791,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12361,7 +12801,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12371,7 +12811,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12385,7 +12825,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12399,7 +12839,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12413,7 +12853,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12423,7 +12863,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12441,7 +12881,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12455,7 +12895,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12469,7 +12909,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12479,7 +12919,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12489,7 +12929,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12503,7 +12943,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12517,7 +12957,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12527,7 +12967,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12541,7 +12981,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12551,7 +12991,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12565,7 +13005,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12579,7 +13019,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12593,7 +13033,51 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeZoneManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterZoneManagementCommandCreateTwoDCartesianZoneResponseID: + result = @"CreateTwoDCartesianZoneResponse"; + break; + + case MTRCommandIDTypeClusterZoneManagementCommandGetTwoDCartesianZoneResponseID: + result = @"GetTwoDCartesianZoneResponse"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (commandID) { + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandAudioStreamAllocateResponseID: + result = @"AudioStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandVideoStreamAllocateResponseID: + result = @"VideoStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandSnapshotStreamAllocateResponseID: + result = @"SnapshotStreamAllocateResponse"; + break; + + case MTRCommandIDTypeClusterCameraAVStreamManagementCommandCaptureSnapshotResponseID: + result = @"CaptureSnapshotResponse"; + break; + + default: + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12611,7 +13095,17 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; + break; + } + break; + + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (commandID) { + + default: + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12621,7 +13115,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12631,7 +13125,7 @@ switch (commandID) { default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12645,7 +13139,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12719,7 +13213,7 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; @@ -12733,13 +13227,13 @@ break; default: - result = [NSString stringWithFormat:@"", commandID]; + result = [NSString stringWithFormat:@"", commandID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } @@ -12759,7 +13253,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12769,7 +13263,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12779,7 +13273,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12789,7 +13283,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12799,7 +13293,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12809,7 +13303,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12819,7 +13313,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12842,7 +13336,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12861,7 +13355,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12888,7 +13382,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12898,7 +13392,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12921,7 +13415,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12931,7 +13425,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12941,7 +13435,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12951,7 +13445,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12961,7 +13455,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12984,7 +13478,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -12994,7 +13488,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13004,7 +13498,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13014,7 +13508,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13041,7 +13535,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13056,7 +13550,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13075,7 +13569,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13098,7 +13592,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13108,7 +13602,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13139,7 +13633,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13170,7 +13664,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13209,7 +13703,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13219,7 +13713,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13229,7 +13723,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13239,7 +13733,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13249,7 +13743,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13259,7 +13753,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13274,7 +13768,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13284,7 +13778,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13294,7 +13788,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13313,7 +13807,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13323,7 +13817,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13333,7 +13827,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13343,7 +13837,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13353,7 +13847,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13363,7 +13857,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13373,7 +13867,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13383,7 +13877,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13393,7 +13887,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13403,7 +13897,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13418,7 +13912,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13428,7 +13922,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13438,7 +13932,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13493,7 +13987,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13508,7 +14002,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13518,7 +14012,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13528,7 +14022,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13547,7 +14041,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13566,7 +14060,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13576,7 +14070,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13586,7 +14080,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13596,7 +14090,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13615,7 +14109,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13634,7 +14128,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13649,7 +14143,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13668,7 +14162,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13687,7 +14181,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13702,7 +14196,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13725,7 +14219,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13752,7 +14246,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13787,7 +14281,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13797,7 +14291,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13807,7 +14301,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13817,7 +14311,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13827,7 +14321,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13837,7 +14331,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13868,7 +14362,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13878,7 +14372,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13888,7 +14382,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13967,7 +14461,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13977,7 +14471,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13987,7 +14481,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -13997,7 +14491,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14007,7 +14501,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14017,7 +14511,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14027,7 +14521,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14037,7 +14531,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14047,7 +14541,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14057,7 +14551,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14067,7 +14561,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14082,7 +14576,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14092,7 +14586,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14102,7 +14596,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14112,7 +14606,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14122,7 +14616,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14132,7 +14626,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14142,7 +14636,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14152,7 +14646,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14162,7 +14656,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14172,7 +14666,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14182,7 +14676,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14192,7 +14686,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14202,7 +14696,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14212,7 +14706,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14222,7 +14716,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14232,7 +14726,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14247,7 +14741,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14262,7 +14756,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14272,7 +14766,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14282,7 +14776,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14292,7 +14786,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14302,7 +14796,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14312,7 +14806,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14322,7 +14816,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14332,7 +14826,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14347,7 +14841,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14362,7 +14856,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14372,7 +14866,49 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeZoneManagementID: + + switch (eventID) { + + // Cluster ZoneManagement events + case MTREventIDTypeClusterZoneManagementEventZoneTriggeredID: + result = @"ZoneTriggered"; + break; + + case MTREventIDTypeClusterZoneManagementEventZoneStoppedID: + result = @"ZoneStopped"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeCameraAVStreamManagementID: + + switch (eventID) { + + // Cluster CameraAVStreamManagement events + case MTREventIDTypeClusterCameraAVStreamManagementEventVideoStreamChangedID: + result = @"VideoStreamChanged"; + break; + + case MTREventIDTypeClusterCameraAVStreamManagementEventAudioStreamChangedID: + result = @"AudioStreamChanged"; + break; + + case MTREventIDTypeClusterCameraAVStreamManagementEventSnapshotStreamChangedID: + result = @"SnapshotStreamChanged"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14382,7 +14918,17 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWebRTCTransportRequestorID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14392,7 +14938,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14402,7 +14948,7 @@ switch (eventID) { default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14417,7 +14963,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14440,7 +14986,7 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; @@ -14455,13 +15001,13 @@ break; default: - result = [NSString stringWithFormat:@"", eventID]; + result = [NSString stringWithFormat:@"", eventID]; break; } break; default: - result = [NSString stringWithFormat:@"", clusterID]; + result = [NSString stringWithFormat:@"", clusterID]; break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 43a909b7e4..217fe6c026 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -993,6 +993,8 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary * _Nullable)readAttributeTCAcknowledgementsRequiredWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeTCUpdateDeadlineWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -6824,6 +6826,251 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Zone Management + * This cluster provides an interface to manage regions of interest, or Zones, which can be either manufacturer or user defined. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterZoneManagement : MTRGenericCluster + +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)getTwoDCartesianZoneWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedZoneSourcesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeZonesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterZoneManagement (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + +/** + * Cluster Camera AV Stream Management + * The Camera AV Stream Management cluster is used to allow clients to manage, control, and configure various audio, video, and snapshot streams on a camera. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterCameraAVStreamManagement : MTRGenericCluster + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setStreamPrioritiesWithParams:(MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxConcurrentVideoEncodersWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxEncodedPixelRateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeVideoSensorParamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionCapableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMinViewportWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeRateDistortionTradeOffPointsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerCapabilitiesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeTwoWayTalkSupportWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSupportedSnapshotParamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMaxNetworkBandwidthWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentFrameRateWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHDRModeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeHDRModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentVideoCodecsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentSnapshotConfigWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFabricsUsingCameraWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedVideoStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedAudioStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAllocatedSnapshotStreamsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeRankedVideoStreamPrioritiesListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSoftRecordingPrivacyModeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSoftLivestreamPrivacyModeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeHardPrivacyModeOnWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNightVisionIllumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAWBEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAWBEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAutoShutterSpeedEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAutoISOEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoISOEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeAutoISOEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeViewportWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerMutedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerVolumeLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerMaxLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeSpeakerMinLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneMutedWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneVolumeLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneMaxLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneMinLevelWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeMicrophoneAGCEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageRotationWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageFlipHorizontalWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeImageFlipVerticalWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeLocalVideoRecordingEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeLocalSnapshotRecordingEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeStatusLightEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeStatusLightBrightnessWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeDepthSensorStatusWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterCameraAVStreamManagement (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster WebRTC Transport Provider * The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. @@ -6868,6 +7115,49 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster WebRTC Transport Requestor + * The WebRTC transport requestor cluster provides a way for stream consumers (e.g. Matter Stream Viewer) to establish a WebRTC connection with a stream provider. + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterWebRTCTransportRequestor : MTRGenericCluster + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterWebRTCTransportRequestor (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Chime * This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 5864634bb6..53d9aecae9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -3102,6 +3102,11 @@ - (void)writeAttributeBreadcrumbWithValue:(NSDictionary *)dataVa return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCAcknowledgementsRequiredID) params:params]; } +- (NSDictionary * _Nullable)readAttributeTCUpdateDeadlineWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeTCUpdateDeadlineID) params:params]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeGeneralCommissioningID) attributeID:@(MTRAttributeIDTypeClusterGeneralCommissioningAttributeGeneratedCommandListID) params:params]; @@ -19549,12 +19554,12 @@ - (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessa @end -@implementation MTRClusterWebRTCTransportProvider +@implementation MTRClusterZoneManagement -- (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)createTwoDCartesianZoneWithParams:(MTRZoneManagementClusterCreateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams + params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; } @@ -19564,7 +19569,7 @@ - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferPar auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::SolicitOffer::Type; + using RequestType = ZoneManagement::Commands::CreateTwoDCartesianZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -19573,15 +19578,46 @@ - (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferPar expectedValueInterval:expectedValueIntervalMs timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRWebRTCTransportProviderClusterSolicitOfferResponseParams.class + responseClass:MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams.class queue:self.callbackQueue completion:responseHandler]; } -- (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +- (void)updateTwoDCartesianZoneWithParams:(MTRZoneManagementClusterUpdateTwoDCartesianZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideOfferParams + params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = ZoneManagement::Commands::UpdateTwoDCartesianZone::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)getTwoDCartesianZoneWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + [self getTwoDCartesianZoneWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)getTwoDCartesianZoneWithParams:(MTRZoneManagementClusterGetTwoDCartesianZoneParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; } @@ -19591,7 +19627,7 @@ - (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferPar auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideOffer::Type; + using RequestType = ZoneManagement::Commands::GetTwoDCartesianZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -19600,15 +19636,15 @@ - (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferPar expectedValueInterval:expectedValueIntervalMs timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:MTRWebRTCTransportProviderClusterProvideOfferResponseParams.class + responseClass:MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams.class queue:self.callbackQueue completion:responseHandler]; } -- (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)removeZoneWithParams:(MTRZoneManagementClusterRemoveZoneParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams + params = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; } @@ -19618,7 +19654,7 @@ - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerP auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideAnswer::Type; + using RequestType = ZoneManagement::Commands::RemoveZone::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -19632,20 +19668,96 @@ - (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerP completion:responseHandler]; } -- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (NSDictionary * _Nullable)readAttributeSupportedZoneSourcesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSupportedZoneSourcesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeZonesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeZonesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTimeControlWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) params:params]; +} + +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeTimeControlWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeTimeControlWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeTimeControlID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSensitivityWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID) params:params]; +} + +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSensitivityWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSensitivityWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeSensitivityID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeZoneManagementID) attributeID:@(MTRAttributeIDTypeClusterZoneManagementAttributeClusterRevisionID) params:params]; +} + +@end + +@implementation MTRClusterCameraAVStreamManagement + +- (void)audioStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + using RequestType = CameraAvStreamManagement::Commands::AudioStreamAllocate::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -19654,15 +19766,15 @@ - (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideI expectedValueInterval:expectedValueIntervalMs timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams.class queue:self.callbackQueue completion:responseHandler]; } -- (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)audioStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { if (params == nil) { - params = [[MTRWebRTCTransportProviderClusterEndSessionParams + params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams alloc] init]; } @@ -19672,7 +19784,7 @@ - (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = WebRTCTransportProvider::Commands::EndSession::Type; + using RequestType = CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -19686,39 +19798,1140 @@ - (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params +- (void)videoStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +- (void)videoStreamModifyWithParams:(MTRCameraAVStreamManagementClusterVideoStreamModifyParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamModify::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +- (void)videoStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeAcceptedCommandListID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +- (void)snapshotStreamAllocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable data, NSError * _Nullable error))completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeEventListID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +- (void)snapshotStreamDeallocateWithParams:(MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeAttributeListID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +- (void)setStreamPrioritiesWithParams:(MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeFeatureMapID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetStreamPriorities::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; } -- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +- (void)captureSnapshotWithParams:(MTRCameraAVStreamManagementClusterCaptureSnapshotParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeClusterRevisionID) params:params]; + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::CaptureSnapshot::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setViewportWithParams:(MTRCameraAVStreamManagementClusterSetViewportParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetViewportParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetViewport::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setImageRotationWithParams:(MTRCameraAVStreamManagementClusterSetImageRotationParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageRotation::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setImageFlipHorizontalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)setImageFlipVerticalWithParams:(MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = CameraAvStreamManagement::Commands::SetImageFlipVertical::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeMaxConcurrentVideoEncodersWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxConcurrentVideoEncodersID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxEncodedPixelRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxEncodedPixelRateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeVideoSensorParamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeVideoSensorParamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionCapableWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionCapableID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMinViewportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMinViewportID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeRateDistortionTradeOffPointsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRateDistortionTradeOffPointsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxPreRollBufferSizeWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxPreRollBufferSizeID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneCapabilitiesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerCapabilitiesWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerCapabilitiesID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeTwoWayTalkSupportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeTwoWayTalkSupportID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSupportedSnapshotParamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSupportedSnapshotParamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeMaxNetworkBandwidthWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMaxNetworkBandwidthID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentFrameRateWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentFrameRateID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeHDRModeEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeEnabledID) params:params]; +} + +- (void)writeAttributeHDRModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeHDRModeEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeHDRModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHDRModeEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentVideoCodecsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentVideoCodecsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentSnapshotConfigWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeCurrentSnapshotConfigID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFabricsUsingCameraWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFabricsUsingCameraID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedVideoStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedVideoStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedAudioStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedAudioStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAllocatedSnapshotStreamsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAllocatedSnapshotStreamsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeRankedVideoStreamPrioritiesListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID) params:params]; +} + +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeRankedVideoStreamPrioritiesListWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeRankedVideoStreamPrioritiesListWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeRankedVideoStreamPrioritiesListID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSoftRecordingPrivacyModeEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeEnabledID) params:params]; +} + +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSoftRecordingPrivacyModeEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSoftRecordingPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftRecordingPrivacyModeEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSoftLivestreamPrivacyModeEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeEnabledID) params:params]; +} + +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSoftLivestreamPrivacyModeEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeHardPrivacyModeOnWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeHardPrivacyModeOnID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID) params:params]; +} + +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNightVisionWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNightVisionWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeNightVisionIllumWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID) params:params]; +} + +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNightVisionIllumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNightVisionIllumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeNightVisionIllumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeAWBEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBEnabledID) params:params]; +} + +- (void)writeAttributeAWBEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAWBEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAWBEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAWBEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeAutoShutterSpeedEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoShutterSpeedEnabledID) params:params]; +} + +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAutoShutterSpeedEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAutoShutterSpeedEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoShutterSpeedEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeAutoISOEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoISOEnabledID) params:params]; +} + +- (void)writeAttributeAutoISOEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeAutoISOEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeAutoISOEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAutoISOEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeViewportWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeViewportID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerMutedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMutedID) params:params]; +} + +- (void)writeAttributeSpeakerMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerMutedWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMutedID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerVolumeLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID) params:params]; +} + +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerVolumeLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerVolumeLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID) params:params]; +} + +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerMaxLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMaxLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeSpeakerMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID) params:params]; +} + +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeSpeakerMinLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeSpeakerMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeSpeakerMinLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneMutedWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMutedID) params:params]; +} + +- (void)writeAttributeMicrophoneMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicrophoneMutedWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicrophoneMutedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMutedID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneVolumeLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneVolumeLevelID) params:params]; +} + +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicrophoneVolumeLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicrophoneVolumeLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneVolumeLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneMaxLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMaxLevelID) params:params]; +} + +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicrophoneMaxLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicrophoneMaxLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMaxLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneMinLevelWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMinLevelID) params:params]; +} + +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicrophoneMinLevelWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicrophoneMinLevelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneMinLevelID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeMicrophoneAGCEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneAGCEnabledID) params:params]; +} + +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeMicrophoneAGCEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeMicrophoneAGCEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeMicrophoneAGCEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeImageRotationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageRotationID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeImageFlipHorizontalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipHorizontalID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeImageFlipVerticalWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeImageFlipVerticalID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeLocalVideoRecordingEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID) params:params]; +} + +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalVideoRecordingEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocalVideoRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalVideoRecordingEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeLocalSnapshotRecordingEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID) params:params]; +} + +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeLocalSnapshotRecordingEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeLocalSnapshotRecordingEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeLocalSnapshotRecordingEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeStatusLightEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightEnabledID) params:params]; +} + +- (void)writeAttributeStatusLightEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStatusLightEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStatusLightEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeStatusLightBrightnessWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID) params:params]; +} + +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeStatusLightBrightnessWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeStatusLightBrightnessWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeStatusLightBrightnessID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeDepthSensorStatusWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID) params:params]; +} + +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDepthSensorStatusWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDepthSensorStatusWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeDepthSensorStatusID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeCameraAVStreamManagementID) attributeID:@(MTRAttributeIDTypeClusterCameraAVStreamManagementAttributeClusterRevisionID) params:params]; +} + +@end + +@implementation MTRClusterWebRTCTransportProvider + +- (void)solicitOfferWithParams:(MTRWebRTCTransportProviderClusterSolicitOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::SolicitOffer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWebRTCTransportProviderClusterSolicitOfferResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)provideOfferWithParams:(MTRWebRTCTransportProviderClusterProvideOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideOffer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRWebRTCTransportProviderClusterProvideOfferResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)provideAnswerWithParams:(MTRWebRTCTransportProviderClusterProvideAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideAnswer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)provideICECandidateWithParams:(MTRWebRTCTransportProviderClusterProvideICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::ProvideICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)endSessionWithParams:(MTRWebRTCTransportProviderClusterEndSessionParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportProviderClusterEndSessionParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportProvider::Commands::EndSession::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeCurrentSessionsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportProviderID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportProviderAttributeClusterRevisionID) params:params]; +} + +@end + +@implementation MTRClusterWebRTCTransportRequestor + +- (void)offerWithParams:(MTRWebRTCTransportRequestorClusterOfferParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterOfferParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Offer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)answerWithParams:(MTRWebRTCTransportRequestorClusterAnswerParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterAnswerParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::Answer::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)ICECandidateWithParams:(MTRWebRTCTransportRequestorClusterICECandidateParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterICECandidateParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::ICECandidate::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)endWithParams:(MTRWebRTCTransportRequestorClusterEndParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRWebRTCTransportRequestorClusterEndParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = WebRTCTransportRequestor::Commands::End::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeCurrentSessionsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeCurrentSessionsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWebRTCTransportRequestorID) attributeID:@(MTRAttributeIDTypeClusterWebRTCTransportRequestorAttributeClusterRevisionID) params:params]; } @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 2aeb25d7a6..6a5580c95b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -10835,6 +10835,686 @@ MTR_PROVISIONALLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) MTRZoneManagementClusterTwoDCartesianZoneStruct * _Nonnull zone MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterUpdateTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRZoneManagementClusterTwoDCartesianZoneStruct * _Nonnull zone MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterGetTwoDCartesianZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nullable zoneID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams : NSObject + +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterRemoveZoneParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull audioCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull channelCount MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull sampleRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitDepth MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull videoCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minFrameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxBitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull minFragmentLen MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull maxFragmentLen MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable watermarkEnabled MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable osdEnabled MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamModifyParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable resolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable watermarkEnabled MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable osdEnabled MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull frameRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull quality MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams : NSObject + +@property (nonatomic, copy) NSArray * _Nonnull streamPriorities MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull requestedResolution MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams : NSObject + +@property (nonatomic, copy) NSData * _Nonnull data MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSetViewportParams : NSObject + +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterViewportStruct * _Nonnull viewport MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSetImageRotationParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull angle MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull enabled MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull enabled MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRWebRTCTransportProviderClusterSolicitOfferParams : NSObject @@ -11063,6 +11743,138 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterOfferParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull sdp MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nullable iceServers MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nullable iceTransportPolicy MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterAnswerParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull sdp MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterICECandidateParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSString * _Nonnull iceCandidate MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterEndParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull webRTCSessionID MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterPlayChimeSoundParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index a922f58315..2010627d89 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -31337,6 +31337,2148 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentA @end +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; + + other.zone = self.zone; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zone:%@; >", NSStringFromClass([self class]), _zone]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zone.name = AsCharSpan(self.zone.name); + encodableStruct.zone.use = static_cast>(self.zone.use.unsignedCharValue); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.zone.vertices.count != 0) { + auto * listHolder_1 = new ListHolder(self.zone.vertices.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.zone.vertices.count; ++i_1) { + if (![self.zone.vertices[i_1] isKindOfClass:[MTRZoneManagementClusterTwoDCartesianVertexStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRZoneManagementClusterTwoDCartesianVertexStruct *) self.zone.vertices[i_1]; + listHolder_1->mList[i_1].x = element_1.x.unsignedShortValue; + listHolder_1->mList[i_1].y = element_1.y.unsignedShortValue; + } + encodableStruct.zone.vertices = ListType_1(listHolder_1->mList, self.zone.vertices.count); + } else { + encodableStruct.zone.vertices = ListType_1(); + } + } + if (self.zone.color != nil) { + auto & definedValue_1 = encodableStruct.zone.color.Emplace(); + definedValue_1 = AsCharSpan(self.zone.color); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams alloc] init]; + + other.zoneID = self.zoneID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType &)decodableStruct +{ + { + self.zoneID = [NSNumber numberWithUnsignedShort:decodableStruct.zoneID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRZoneManagementClusterUpdateTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + + _zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.zone = self.zone; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; zone:%@; >", NSStringFromClass([self class]), _zoneID, _zone]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterUpdateTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zoneID = self.zoneID.unsignedShortValue; + } + { + encodableStruct.zone.name = AsCharSpan(self.zone.name); + encodableStruct.zone.use = static_cast>(self.zone.use.unsignedCharValue); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.zone.vertices.count != 0) { + auto * listHolder_1 = new ListHolder(self.zone.vertices.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.zone.vertices.count; ++i_1) { + if (![self.zone.vertices[i_1] isKindOfClass:[MTRZoneManagementClusterTwoDCartesianVertexStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRZoneManagementClusterTwoDCartesianVertexStruct *) self.zone.vertices[i_1]; + listHolder_1->mList[i_1].x = element_1.x.unsignedShortValue; + listHolder_1->mList[i_1].y = element_1.y.unsignedShortValue; + } + encodableStruct.zone.vertices = ListType_1(listHolder_1->mList, self.zone.vertices.count); + } else { + encodableStruct.zone.vertices = ListType_1(); + } + } + if (self.zone.color != nil) { + auto & definedValue_1 = encodableStruct.zone.color.Emplace(); + definedValue_1 = AsCharSpan(self.zone.color); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type encodableStruct; + ListFreer listFreer; + { + if (self.zoneID != nil) { + auto & definedValue_0 = encodableStruct.zoneID.Emplace(); + if (self.zoneID == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = self.zoneID.unsignedShortValue; + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams alloc] init]; + + other.zones = self.zones; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; >", NSStringFromClass([self class]), _zones]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType &)decodableStruct +{ + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRZoneManagementClusterTwoDCartesianZoneStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + newElement_0.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.use)]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.vertices.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_2; + newElement_2 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_2.x = [NSNumber numberWithUnsignedShort:entry_2.x]; + newElement_2.y = [NSNumber numberWithUnsignedShort:entry_2.y]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.vertices = array_2; + } + if (entry_0.color.HasValue()) { + newElement_0.color = AsString(entry_0.color.Value()); + if (newElement_0.color == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + } else { + newElement_0.color = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.zones = array_0; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRZoneManagementClusterRemoveZoneParams +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; + + other.zoneID = self.zoneID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; >", NSStringFromClass([self class]), _zoneID]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterRemoveZoneParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.zoneID = self.zoneID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _audioCodec = @(0); + + _channelCount = @(0); + + _sampleRate = @(0); + + _bitRate = @(0); + + _bitDepth = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams alloc] init]; + + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; >", NSStringFromClass([self class]), _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); + } + { + encodableStruct.audioCodec = static_cast>(self.audioCodec.unsignedCharValue); + } + { + encodableStruct.channelCount = self.channelCount.unsignedCharValue; + } + { + encodableStruct.sampleRate = self.sampleRate.unsignedIntValue; + } + { + encodableStruct.bitRate = self.bitRate.unsignedIntValue; + } + { + encodableStruct.bitDepth = self.bitDepth.unsignedCharValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams alloc] init]; + + other.audioStreamID = self.audioStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; >", NSStringFromClass([self class]), _audioStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; >", NSStringFromClass([self class]), _audioStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.audioStreamID = self.audioStreamID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamType = @(0); + + _videoCodec = @(0); + + _minFrameRate = @(0); + + _maxFrameRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + + _maxBitRate = @(0); + + _minFragmentLen = @(0); + + _maxFragmentLen = @(0); + + _watermarkEnabled = nil; + + _osdEnabled = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams alloc] init]; + + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + other.watermarkEnabled = self.watermarkEnabled; + other.osdEnabled = self.osdEnabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; watermarkEnabled:%@; osdEnabled:%@; >", NSStringFromClass([self class]), _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen, _watermarkEnabled, _osdEnabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); + } + { + encodableStruct.videoCodec = static_cast>(self.videoCodec.unsignedCharValue); + } + { + encodableStruct.minFrameRate = self.minFrameRate.unsignedShortValue; + } + { + encodableStruct.maxFrameRate = self.maxFrameRate.unsignedShortValue; + } + { + encodableStruct.minResolution.width = self.minResolution.width.unsignedShortValue; + encodableStruct.minResolution.height = self.minResolution.height.unsignedShortValue; + } + { + encodableStruct.maxResolution.width = self.maxResolution.width.unsignedShortValue; + encodableStruct.maxResolution.height = self.maxResolution.height.unsignedShortValue; + } + { + encodableStruct.minBitRate = self.minBitRate.unsignedIntValue; + } + { + encodableStruct.maxBitRate = self.maxBitRate.unsignedIntValue; + } + { + encodableStruct.minFragmentLen = self.minFragmentLen.unsignedShortValue; + } + { + encodableStruct.maxFragmentLen = self.maxFragmentLen.unsignedShortValue; + } + { + if (self.watermarkEnabled != nil) { + auto & definedValue_0 = encodableStruct.watermarkEnabled.Emplace(); + definedValue_0 = self.watermarkEnabled.boolValue; + } + } + { + if (self.osdEnabled != nil) { + auto & definedValue_0 = encodableStruct.OSDEnabled.Emplace(); + definedValue_0 = self.osdEnabled.boolValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; >", NSStringFromClass([self class]), _videoStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamModifyParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _resolution = nil; + + _watermarkEnabled = nil; + + _osdEnabled = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.resolution = self.resolution; + other.watermarkEnabled = self.watermarkEnabled; + other.osdEnabled = self.osdEnabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; resolution:%@; watermarkEnabled:%@; osdEnabled:%@; >", NSStringFromClass([self class]), _videoStreamID, _resolution, _watermarkEnabled, _osdEnabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamModifyParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + { + if (self.resolution != nil) { + auto & definedValue_0 = encodableStruct.resolution.Emplace(); + definedValue_0.width = self.resolution.width.unsignedShortValue; + definedValue_0.height = self.resolution.height.unsignedShortValue; + } + } + { + if (self.watermarkEnabled != nil) { + auto & definedValue_0 = encodableStruct.watermarkEnabled.Emplace(); + definedValue_0 = self.watermarkEnabled.boolValue; + } + } + { + if (self.osdEnabled != nil) { + auto & definedValue_0 = encodableStruct.OSDEnabled.Emplace(); + definedValue_0 = self.osdEnabled.boolValue; + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; >", NSStringFromClass([self class]), _videoStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.videoStreamID = self.videoStreamID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _imageCodec = @(0); + + _frameRate = @(0); + + _bitRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _quality = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams alloc] init]; + + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; >", NSStringFromClass([self class]), _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.imageCodec = static_cast>(self.imageCodec.unsignedCharValue); + } + { + encodableStruct.frameRate = self.frameRate.unsignedShortValue; + } + { + encodableStruct.bitRate = self.bitRate.unsignedIntValue; + } + { + encodableStruct.minResolution.width = self.minResolution.width.unsignedShortValue; + encodableStruct.minResolution.height = self.minResolution.height.unsignedShortValue; + } + { + encodableStruct.maxResolution.width = self.maxResolution.width.unsignedShortValue; + encodableStruct.maxResolution.height = self.maxResolution.height.unsignedShortValue; + } + { + encodableStruct.quality = self.quality.unsignedCharValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; >", NSStringFromClass([self class]), _snapshotStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType &)decodableStruct +{ + { + self.snapshotStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.snapshotStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; >", NSStringFromClass([self class]), _snapshotStreamID]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.snapshotStreamID = self.snapshotStreamID.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams +- (instancetype)init +{ + if (self = [super init]) { + + _streamPriorities = [NSArray array]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams alloc] init]; + + other.streamPriorities = self.streamPriorities; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamPriorities:%@; >", NSStringFromClass([self class]), _streamPriorities]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Type encodableStruct; + ListFreer listFreer; + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.streamPriorities.count != 0) { + auto * listHolder_0 = new ListHolder(self.streamPriorities.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.streamPriorities.count; ++i_0) { + if (![self.streamPriorities[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) self.streamPriorities[i_0]; + listHolder_0->mList[i_0] = static_castmList[i_0])>>(element_0.unsignedCharValue); + } + encodableStruct.streamPriorities = ListType_0(listHolder_0->mList, self.streamPriorities.count); + } else { + encodableStruct.streamPriorities = ListType_0(); + } + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterCaptureSnapshotParams +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _requestedResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.requestedResolution = self.requestedResolution; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; requestedResolution:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _requestedResolution]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterCaptureSnapshotParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.snapshotStreamID = self.snapshotStreamID.unsignedShortValue; + } + { + encodableStruct.requestedResolution.width = self.requestedResolution.width.unsignedShortValue; + encodableStruct.requestedResolution.height = self.requestedResolution.height.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _data = [NSData data]; + + _imageCodec = @(0); + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams alloc] init]; + + other.data = self.data; + other.imageCodec = self.imageCodec; + other.resolution = self.resolution; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: data:%@; imageCodec:%@; resolution:%@; >", NSStringFromClass([self class]), [_data base64EncodedStringWithOptions:0], _imageCodec, _resolution]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType &)decodableStruct +{ + { + self.data = AsData(decodableStruct.data); + } + { + self.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.imageCodec)]; + } + { + self.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + self.resolution.width = [NSNumber numberWithUnsignedShort:decodableStruct.resolution.width]; + self.resolution.height = [NSNumber numberWithUnsignedShort:decodableStruct.resolution.height]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetViewportParams +- (instancetype)init +{ + if (self = [super init]) { + + _viewport = [MTRCameraAVStreamManagementClusterViewportStruct new]; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetViewportParams alloc] init]; + + other.viewport = self.viewport; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: viewport:%@; >", NSStringFromClass([self class]), _viewport]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetViewportParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.viewport.x1 = self.viewport.x1.unsignedShortValue; + encodableStruct.viewport.y1 = self.viewport.y1.unsignedShortValue; + encodableStruct.viewport.x2 = self.viewport.x2.unsignedShortValue; + encodableStruct.viewport.y2 = self.viewport.y2.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageRotationParams +- (instancetype)init +{ + if (self = [super init]) { + + _angle = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageRotationParams alloc] init]; + + other.angle = self.angle; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: angle:%@; >", NSStringFromClass([self class]), _angle]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageRotationParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.angle = self.angle.unsignedShortValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams +- (instancetype)init +{ + if (self = [super init]) { + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams alloc] init]; + + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: enabled:%@; >", NSStringFromClass([self class]), _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.enabled = self.enabled.boolValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams +- (instancetype)init +{ + if (self = [super init]) { + + _enabled = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams alloc] init]; + + other.enabled = self.enabled; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: enabled:%@; >", NSStringFromClass([self class]), _enabled]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.enabled = self.enabled.boolValue; + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRWebRTCTransportProviderClusterSolicitOfferParams - (instancetype)init { @@ -31361,8 +33503,315 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterSolicitOfferParams alloc] init]; + auto other = [[MTRWebRTCTransportProviderClusterSolicitOfferParams alloc] init]; + + other.streamType = self.streamType; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + other.iceServers = self.iceServers; + other.iceTransportPolicy = self.iceTransportPolicy; + other.metadataOptions = self.metadataOptions; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoStreamID:%@; audioStreamID:%@; iceServers:%@; iceTransportPolicy:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _streamType, _videoStreamID, _audioStreamID, _iceServers, _iceTransportPolicy, _metadataOptions]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterSolicitOfferParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); + } + { + if (self.videoStreamID != nil) { + auto & definedValue_0 = encodableStruct.videoStreamID.Emplace(); + if (self.videoStreamID == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = self.videoStreamID.unsignedShortValue; + } + } + } + { + if (self.audioStreamID != nil) { + auto & definedValue_0 = encodableStruct.audioStreamID.Emplace(); + if (self.audioStreamID == nil) { + definedValue_0.SetNull(); + } else { + auto & nonNullValue_1 = definedValue_0.SetNonNull(); + nonNullValue_1 = self.audioStreamID.unsignedShortValue; + } + } + } + { + if (self.iceServers != nil) { + auto & definedValue_0 = encodableStruct.ICEServers.Emplace(); + { + using ListType_1 = std::remove_reference_t; + using ListMemberType_1 = ListMemberTypeGetter::Type; + if (self.iceServers.count != 0) { + auto * listHolder_1 = new ListHolder(self.iceServers.count); + if (listHolder_1 == nullptr || listHolder_1->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_1); + for (size_t i_1 = 0; i_1 < self.iceServers.count; ++i_1) { + if (![self.iceServers[i_1] isKindOfClass:[MTRWebRTCTransportProviderClusterICEServerStruct class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_1 = (MTRWebRTCTransportProviderClusterICEServerStruct *) self.iceServers[i_1]; + { + using ListType_3 = std::remove_reference_tmList[i_1].urls)>; + using ListMemberType_3 = ListMemberTypeGetter::Type; + if (element_1.urls.count != 0) { + auto * listHolder_3 = new ListHolder(element_1.urls.count); + if (listHolder_3 == nullptr || listHolder_3->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_3); + for (size_t i_3 = 0; i_3 < element_1.urls.count; ++i_3) { + if (![element_1.urls[i_3] isKindOfClass:[NSString class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_3 = (NSString *) element_1.urls[i_3]; + listHolder_3->mList[i_3] = AsCharSpan(element_3); + } + listHolder_1->mList[i_1].urls = ListType_3(listHolder_3->mList, element_1.urls.count); + } else { + listHolder_1->mList[i_1].urls = ListType_3(); + } + } + if (element_1.username != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].username.Emplace(); + definedValue_3 = AsCharSpan(element_1.username); + } + if (element_1.credential != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].credential.Emplace(); + definedValue_3 = AsCharSpan(element_1.credential); + } + if (element_1.caid != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].caid.Emplace(); + definedValue_3 = element_1.caid.unsignedShortValue; + } + } + definedValue_0 = ListType_1(listHolder_1->mList, self.iceServers.count); + } else { + definedValue_0 = ListType_1(); + } + } + } + } + { + if (self.iceTransportPolicy != nil) { + auto & definedValue_0 = encodableStruct.ICETransportPolicy.Emplace(); + definedValue_0 = AsCharSpan(self.iceTransportPolicy); + } + } + { + if (self.metadataOptions != nil) { + auto & definedValue_0 = encodableStruct.metadataOptions.Emplace(); + definedValue_0 = static_cast>(self.metadataOptions.unsignedCharValue); + } + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportProviderClusterSolicitOfferResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _deferredOffer = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportProviderClusterSolicitOfferResponseParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.deferredOffer = self.deferredOffer; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; deferredOffer:%@; videoStreamID:%@; audioStreamID:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _deferredOffer, _videoStreamID, _audioStreamID]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterSolicitOfferResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType &)decodableStruct +{ + { + self.webRTCSessionID = [NSNumber numberWithUnsignedShort:decodableStruct.webRTCSessionID]; + } + { + self.deferredOffer = [NSNumber numberWithBool:decodableStruct.deferredOffer]; + } + { + if (decodableStruct.videoStreamID.HasValue()) { + if (decodableStruct.videoStreamID.Value().IsNull()) { + self.videoStreamID = nil; + } else { + self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID.Value().Value()]; + } + } else { + self.videoStreamID = nil; + } + } + { + if (decodableStruct.audioStreamID.HasValue()) { + if (decodableStruct.audioStreamID.Value().IsNull()) { + self.audioStreamID = nil; + } else { + self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID.Value().Value()]; + } + } else { + self.audioStreamID = nil; + } + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterProvideOfferParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = nil; + + _sdp = @""; + + _streamType = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + + _iceServers = nil; + + _iceTransportPolicy = nil; + + _metadataOptions = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportProviderClusterProvideOfferParams alloc] init]; + other.webRTCSessionID = self.webRTCSessionID; + other.sdp = self.sdp; other.streamType = self.streamType; other.videoStreamID = self.videoStreamID; other.audioStreamID = self.audioStreamID; @@ -31377,18 +33826,29 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: streamType:%@; videoStreamID:%@; audioStreamID:%@; iceServers:%@; iceTransportPolicy:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _streamType, _videoStreamID, _audioStreamID, _iceServers, _iceTransportPolicy, _metadataOptions]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; streamType:%@; videoStreamID:%@; audioStreamID:%@; iceServers:%@; iceTransportPolicy:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp, _streamType, _videoStreamID, _audioStreamID, _iceServers, _iceTransportPolicy, _metadataOptions]; return descriptionString; } @end -@implementation MTRWebRTCTransportProviderClusterSolicitOfferParams (InternalMethods) +@implementation MTRWebRTCTransportProviderClusterProvideOfferParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Type encodableStruct; + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type encodableStruct; ListFreer listFreer; + { + if (self.webRTCSessionID == nil) { + encodableStruct.webRTCSessionID.SetNull(); + } else { + auto & nonNullValue_0 = encodableStruct.webRTCSessionID.SetNonNull(); + nonNullValue_0 = self.webRTCSessionID.unsignedShortValue; + } + } + { + encodableStruct.sdp = AsCharSpan(self.sdp); + } { encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); } @@ -31525,28 +33985,25 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportProviderClusterSolicitOfferResponseParams +@implementation MTRWebRTCTransportProviderClusterProvideOfferResponseParams - (instancetype)init { if (self = [super init]) { _webRTCSessionID = @(0); - _deferredOffer = @(0); - - _videoStreamID = nil; + _videoStreamID = @(0); - _audioStreamID = nil; + _audioStreamID = @(0); } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterSolicitOfferResponseParams alloc] init]; + auto other = [[MTRWebRTCTransportProviderClusterProvideOfferResponseParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; - other.deferredOffer = self.deferredOffer; other.videoStreamID = self.videoStreamID; other.audioStreamID = self.audioStreamID; @@ -31555,7 +34012,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; deferredOffer:%@; videoStreamID:%@; audioStreamID:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _deferredOffer, _videoStreamID, _audioStreamID]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; videoStreamID:%@; audioStreamID:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _videoStreamID, _audioStreamID]; return descriptionString; } @@ -31566,7 +34023,7 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - using DecodableType = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType; + using DecodableType = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType; chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue clusterID:DecodableType::GetClusterId() commandID:DecodableType::GetCommandId() @@ -31575,89 +34032,317 @@ - (nullable instancetype)initWithResponseValue:(NSDictionary *)r return nil; } - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterProvideOfferResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType &)decodableStruct +{ + { + self.webRTCSessionID = [NSNumber numberWithUnsignedShort:decodableStruct.webRTCSessionID]; + } + { + self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID]; + } + { + self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID]; + } + return CHIP_NO_ERROR; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterProvideAnswerParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _sdp = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportProviderClusterProvideAnswerParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.sdp = self.sdp; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterProvideAnswerParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.sdp = AsCharSpan(self.sdp); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportProviderClusterProvideICECandidateParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _iceCandidate = @""; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.iceCandidate = self.iceCandidate; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; iceCandidate:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _iceCandidate]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportProviderClusterProvideICECandidateParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; + } + { + encodableStruct.ICECandidate = AsCharSpan(self.iceCandidate); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + +@implementation MTRWebRTCTransportProviderClusterEndSessionParams +- (instancetype)init +{ + if (self = [super init]) { + + _webRTCSessionID = @(0); + + _reason = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRWebRTCTransportProviderClusterEndSessionParams alloc] init]; + + other.webRTCSessionID = self.webRTCSessionID; + other.reason = self.reason; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } + return other; +} - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; reason:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _reason]; + return descriptionString; } @end -@implementation MTRWebRTCTransportProviderClusterSolicitOfferResponseParams (InternalMethods) +@implementation MTRWebRTCTransportProviderClusterEndSessionParams (InternalMethods) -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType &)decodableStruct +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { + chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type encodableStruct; + ListFreer listFreer; { - self.webRTCSessionID = [NSNumber numberWithUnsignedShort:decodableStruct.webRTCSessionID]; + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; } { - self.deferredOffer = [NSNumber numberWithBool:decodableStruct.deferredOffer]; + encodableStruct.reason = static_cast>(self.reason.unsignedCharValue); } - { - if (decodableStruct.videoStreamID.HasValue()) { - if (decodableStruct.videoStreamID.Value().IsNull()) { - self.videoStreamID = nil; - } else { - self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID.Value().Value()]; - } - } else { - self.videoStreamID = nil; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; } + return nil; } - { - if (decodableStruct.audioStreamID.HasValue()) { - if (decodableStruct.audioStreamID.Value().IsNull()) { - self.audioStreamID = nil; - } else { - self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID.Value().Value()]; - } - } else { - self.audioStreamID = nil; + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; } } - return CHIP_NO_ERROR; + return decodedObj; } - @end -@implementation MTRWebRTCTransportProviderClusterProvideOfferParams +@implementation MTRWebRTCTransportRequestorClusterOfferParams - (instancetype)init { if (self = [super init]) { - _webRTCSessionID = nil; + _webRTCSessionID = @(0); _sdp = @""; - _streamType = @(0); - - _videoStreamID = nil; - - _audioStreamID = nil; - _iceServers = nil; _iceTransportPolicy = nil; - - _metadataOptions = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -31666,16 +34351,12 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterProvideOfferParams alloc] init]; + auto other = [[MTRWebRTCTransportRequestorClusterOfferParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; other.sdp = self.sdp; - other.streamType = self.streamType; - other.videoStreamID = self.videoStreamID; - other.audioStreamID = self.audioStreamID; other.iceServers = self.iceServers; other.iceTransportPolicy = self.iceTransportPolicy; - other.metadataOptions = self.metadataOptions; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -31684,54 +34365,24 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; streamType:%@; videoStreamID:%@; audioStreamID:%@; iceServers:%@; iceTransportPolicy:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp, _streamType, _videoStreamID, _audioStreamID, _iceServers, _iceTransportPolicy, _metadataOptions]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; sdp:%@; iceServers:%@; iceTransportPolicy:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _sdp, _iceServers, _iceTransportPolicy]; return descriptionString; } @end -@implementation MTRWebRTCTransportProviderClusterProvideOfferParams (InternalMethods) +@implementation MTRWebRTCTransportRequestorClusterOfferParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type encodableStruct; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type encodableStruct; ListFreer listFreer; { - if (self.webRTCSessionID == nil) { - encodableStruct.webRTCSessionID.SetNull(); - } else { - auto & nonNullValue_0 = encodableStruct.webRTCSessionID.SetNonNull(); - nonNullValue_0 = self.webRTCSessionID.unsignedShortValue; - } + encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; } { encodableStruct.sdp = AsCharSpan(self.sdp); } - { - encodableStruct.streamType = static_cast>(self.streamType.unsignedCharValue); - } - { - if (self.videoStreamID != nil) { - auto & definedValue_0 = encodableStruct.videoStreamID.Emplace(); - if (self.videoStreamID == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = self.videoStreamID.unsignedShortValue; - } - } - } - { - if (self.audioStreamID != nil) { - auto & definedValue_0 = encodableStruct.audioStreamID.Emplace(); - if (self.audioStreamID == nil) { - definedValue_0.SetNull(); - } else { - auto & nonNullValue_1 = definedValue_0.SetNonNull(); - nonNullValue_1 = self.audioStreamID.unsignedShortValue; - } - } - } { if (self.iceServers != nil) { auto & definedValue_0 = encodableStruct.ICEServers.Emplace(); @@ -31745,11 +34396,11 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } listFreer.add(listHolder_1); for (size_t i_1 = 0; i_1 < self.iceServers.count; ++i_1) { - if (![self.iceServers[i_1] isKindOfClass:[MTRWebRTCTransportProviderClusterICEServerStruct class]]) { + if (![self.iceServers[i_1] isKindOfClass:[MTRWebRTCTransportRequestorClusterICEServerStruct class]]) { // Wrong kind of value. return CHIP_ERROR_INVALID_ARGUMENT; } - auto element_1 = (MTRWebRTCTransportProviderClusterICEServerStruct *) self.iceServers[i_1]; + auto element_1 = (MTRWebRTCTransportRequestorClusterICEServerStruct *) self.iceServers[i_1]; { using ListType_3 = std::remove_reference_tmList[i_1].urls)>; using ListMemberType_3 = ListMemberTypeGetter::Type; @@ -31798,12 +34449,6 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader definedValue_0 = AsCharSpan(self.iceTransportPolicy); } } - { - if (self.metadataOptions != nil) { - auto & definedValue_0 = encodableStruct.metadataOptions.Emplace(); - definedValue_0 = static_cast>(self.metadataOptions.unsignedCharValue); - } - } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { @@ -31843,98 +34488,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportProviderClusterProvideOfferResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _webRTCSessionID = @(0); - - _videoStreamID = @(0); - - _audioStreamID = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRWebRTCTransportProviderClusterProvideOfferResponseParams alloc] init]; - - other.webRTCSessionID = self.webRTCSessionID; - other.videoStreamID = self.videoStreamID; - other.audioStreamID = self.audioStreamID; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: webRTCSessionID:%@; videoStreamID:%@; audioStreamID:%@; >", NSStringFromClass([self class]), _webRTCSessionID, _videoStreamID, _audioStreamID]; - return descriptionString; -} - -- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue - error:(NSError * __autoreleasing *)error -{ - if (!(self = [super init])) { - return nil; - } - - using DecodableType = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType; - chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue - clusterID:DecodableType::GetClusterId() - commandID:DecodableType::GetCommandId() - error:error]; - if (buffer.IsNull()) { - return nil; - } - - chip::TLV::TLVReader reader; - reader.Init(buffer->Start(), buffer->DataLength()); - - CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); - if (err == CHIP_NO_ERROR) { - DecodableType decodedStruct; - err = chip::app::DataModel::Decode(reader, decodedStruct); - if (err == CHIP_NO_ERROR) { - err = [self _setFieldsFromDecodableStruct:decodedStruct]; - if (err == CHIP_NO_ERROR) { - return self; - } - } - } - - NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; - MTR_LOG_ERROR("%s", errorStr.UTF8String); - if (error != nil) { - NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; - *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; - } - return nil; -} - -@end - -@implementation MTRWebRTCTransportProviderClusterProvideOfferResponseParams (InternalMethods) - -- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType &)decodableStruct -{ - { - self.webRTCSessionID = [NSNumber numberWithUnsignedShort:decodableStruct.webRTCSessionID]; - } - { - self.videoStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.videoStreamID]; - } - { - self.audioStreamID = [NSNumber numberWithUnsignedShort:decodableStruct.audioStreamID]; - } - return CHIP_NO_ERROR; -} - -@end - -@implementation MTRWebRTCTransportProviderClusterProvideAnswerParams +@implementation MTRWebRTCTransportRequestorClusterAnswerParams - (instancetype)init { if (self = [super init]) { @@ -31950,7 +34504,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterProvideAnswerParams alloc] init]; + auto other = [[MTRWebRTCTransportRequestorClusterAnswerParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; other.sdp = self.sdp; @@ -31968,11 +34522,11 @@ - (NSString *)description @end -@implementation MTRWebRTCTransportProviderClusterProvideAnswerParams (InternalMethods) +@implementation MTRWebRTCTransportRequestorClusterAnswerParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type encodableStruct; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type encodableStruct; ListFreer listFreer; { encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; @@ -32019,7 +34573,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportProviderClusterProvideICECandidateParams +@implementation MTRWebRTCTransportRequestorClusterICECandidateParams - (instancetype)init { if (self = [super init]) { @@ -32035,7 +34589,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + auto other = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; other.iceCandidate = self.iceCandidate; @@ -32053,11 +34607,11 @@ - (NSString *)description @end -@implementation MTRWebRTCTransportProviderClusterProvideICECandidateParams (InternalMethods) +@implementation MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type encodableStruct; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type encodableStruct; ListFreer listFreer; { encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; @@ -32104,7 +34658,7 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRWebRTCTransportProviderClusterEndSessionParams +@implementation MTRWebRTCTransportRequestorClusterEndParams - (instancetype)init { if (self = [super init]) { @@ -32120,7 +34674,7 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRWebRTCTransportProviderClusterEndSessionParams alloc] init]; + auto other = [[MTRWebRTCTransportRequestorClusterEndParams alloc] init]; other.webRTCSessionID = self.webRTCSessionID; other.reason = self.reason; @@ -32138,11 +34692,11 @@ - (NSString *)description @end -@implementation MTRWebRTCTransportProviderClusterEndSessionParams (InternalMethods) +@implementation MTRWebRTCTransportRequestorClusterEndParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type encodableStruct; + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type encodableStruct; ListFreer listFreer; { encodableStruct.webRTCSessionID = self.webRTCSessionID.unsignedShortValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 144ee696af..70d8a461c6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2032,6 +2032,144 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRZoneManagementClusterUpdateTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterGetTwoDCartesianZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRZoneManagementClusterRemoveZoneParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamModifyParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterCaptureSnapshotResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRCameraAVStreamManagementClusterSetViewportParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageRotationParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRWebRTCTransportProviderClusterSolicitOfferParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; @@ -2074,6 +2212,30 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRWebRTCTransportRequestorClusterOfferParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterAnswerParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterICECandidateParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + +@interface MTRWebRTCTransportRequestorClusterEndParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRChimeClusterPlayChimeSoundParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 91f69fd4e1..f45fd6f3cc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1124,6 +1124,24 @@ static BOOL CommandNeedsTimedInvokeInContentAppObserverCluster(AttributeId aAttr } } } +static BOOL CommandNeedsTimedInvokeInZoneManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::ZoneManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} +static BOOL CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(AttributeId aAttributeId) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId aAttributeId) { using namespace Clusters::WebRTCTransportProvider; @@ -1133,6 +1151,15 @@ static BOOL CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(AttributeId } } } +static BOOL CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(AttributeId aAttributeId) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInChimeCluster(AttributeId aAttributeId) { using namespace Clusters::Chime; @@ -1530,9 +1557,18 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ContentAppObserver::Id: { return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID); } + case Clusters::ZoneManagement::Id: { + return CommandNeedsTimedInvokeInZoneManagementCluster(commandID); + } + case Clusters::CameraAvStreamManagement::Id: { + return CommandNeedsTimedInvokeInCameraAVStreamManagementCluster(commandID); + } case Clusters::WebRTCTransportProvider::Id: { return CommandNeedsTimedInvokeInWebRTCTransportProviderCluster(commandID); } + case Clusters::WebRTCTransportRequestor::Id: { + return CommandNeedsTimedInvokeInWebRTCTransportRequestorCluster(commandID); + } case Clusters::Chime::Id: { return CommandNeedsTimedInvokeInChimeCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm index 7bab05ab23..cadfa6ab33 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRDeviceTypeMetadata.mm @@ -34,75 +34,76 @@ }; constexpr DeviceTypeData knownDeviceTypes[] = { - { 0x0000000A, DeviceTypeClass::Simple, "Matter Door Lock" }, - { 0x0000000B, DeviceTypeClass::Simple, "Matter Door Lock Controller" }, - { 0x0000000E, DeviceTypeClass::Utility, "Matter Aggregator" }, - { 0x0000000F, DeviceTypeClass::Simple, "Matter Generic Switch" }, - { 0x00000011, DeviceTypeClass::Utility, "Matter Power Source" }, - { 0x00000012, DeviceTypeClass::Utility, "Matter OTA Requestor" }, - { 0x00000013, DeviceTypeClass::Utility, "Matter Bridged Device" }, - { 0x00000014, DeviceTypeClass::Utility, "Matter OTA Provider" }, - { 0x00000015, DeviceTypeClass::Simple, "Matter Contact Sensor" }, - { 0x00000016, DeviceTypeClass::Node, "Matter Root Node" }, - { 0x00000019, DeviceTypeClass::Utility, "Matter Secondary Network Interface Device Type" }, - { 0x00000022, DeviceTypeClass::Simple, "Matter Speaker" }, - { 0x00000023, DeviceTypeClass::Simple, "Matter Casting Video Player" }, - { 0x00000024, DeviceTypeClass::Simple, "Matter Content App" }, - { 0x00000027, DeviceTypeClass::Simple, "Matter Mode Select" }, - { 0x00000028, DeviceTypeClass::Simple, "Matter Basic Video Player" }, - { 0x00000029, DeviceTypeClass::Simple, "Matter Casting Video Client" }, - { 0x0000002A, DeviceTypeClass::Simple, "Matter Video Remote Control" }, - { 0x0000002B, DeviceTypeClass::Simple, "Matter Fan" }, - { 0x0000002C, DeviceTypeClass::Simple, "Matter Air Quality Sensor" }, - { 0x0000002D, DeviceTypeClass::Simple, "Matter Air Purifier" }, - { 0x00000041, DeviceTypeClass::Simple, "Matter Water Freeze Detector" }, - { 0x00000042, DeviceTypeClass::Simple, "Matter Water Valve" }, - { 0x00000043, DeviceTypeClass::Simple, "Matter Water Leak Detector" }, - { 0x00000044, DeviceTypeClass::Simple, "Matter Rain Sensor" }, - { 0x00000070, DeviceTypeClass::Simple, "Matter Refrigerator" }, - { 0x00000071, DeviceTypeClass::Simple, "Matter Temperature Controlled Cabinet" }, - { 0x00000072, DeviceTypeClass::Simple, "Matter Room Air Conditioner" }, - { 0x00000073, DeviceTypeClass::Simple, "Matter Laundry Washer" }, - { 0x00000074, DeviceTypeClass::Simple, "Matter Robotic Vacuum Cleaner" }, - { 0x00000075, DeviceTypeClass::Simple, "Matter Dishwasher" }, - { 0x00000076, DeviceTypeClass::Simple, "Matter Smoke CO Alarm" }, - { 0x00000077, DeviceTypeClass::Simple, "Matter Cook Surface" }, - { 0x00000078, DeviceTypeClass::Simple, "Matter Cooktop" }, - { 0x00000079, DeviceTypeClass::Simple, "Matter Microwave Oven" }, - { 0x0000007A, DeviceTypeClass::Simple, "Matter Extractor Hood" }, - { 0x0000007B, DeviceTypeClass::Simple, "Matter Oven" }, - { 0x0000007C, DeviceTypeClass::Simple, "Matter Laundry Dryer" }, - { 0x00000090, DeviceTypeClass::Simple, "Matter Network Infrastructure Manager" }, - { 0x00000091, DeviceTypeClass::Simple, "Matter Thread Border Router" }, - { 0x00000100, DeviceTypeClass::Simple, "Matter On/Off Light" }, - { 0x00000101, DeviceTypeClass::Simple, "Matter Dimmable Light" }, - { 0x00000103, DeviceTypeClass::Simple, "Matter On/Off Light Switch" }, - { 0x00000104, DeviceTypeClass::Simple, "Matter Dimmer Switch" }, - { 0x00000105, DeviceTypeClass::Simple, "Matter Color Dimmer Switch" }, - { 0x00000106, DeviceTypeClass::Simple, "Matter Light Sensor" }, - { 0x00000107, DeviceTypeClass::Simple, "Matter Occupancy Sensor" }, - { 0x0000010A, DeviceTypeClass::Simple, "Matter On/Off Plug-in Unit" }, - { 0x0000010B, DeviceTypeClass::Simple, "Matter Dimmable Plug-in Unit" }, - { 0x0000010C, DeviceTypeClass::Simple, "Matter Color Temperature Light" }, - { 0x0000010D, DeviceTypeClass::Simple, "Matter Extended Color Light" }, - { 0x00000202, DeviceTypeClass::Simple, "Matter Window Covering" }, - { 0x00000203, DeviceTypeClass::Simple, "Matter Window Covering Controller" }, - { 0x00000300, DeviceTypeClass::Simple, "Matter Heating/Cooling Unit" }, - { 0x00000301, DeviceTypeClass::Simple, "Matter Thermostat" }, - { 0x00000302, DeviceTypeClass::Simple, "Matter Temperature Sensor" }, - { 0x00000303, DeviceTypeClass::Simple, "Matter Pump" }, - { 0x00000304, DeviceTypeClass::Simple, "Matter Pump Controller" }, - { 0x00000305, DeviceTypeClass::Simple, "Matter Pressure Sensor" }, - { 0x00000306, DeviceTypeClass::Simple, "Matter Flow Sensor" }, - { 0x00000307, DeviceTypeClass::Simple, "Matter Humidity Sensor" }, - { 0x0000050C, DeviceTypeClass::Simple, "Matter EVSE" }, - { 0x00000510, DeviceTypeClass::Utility, "Matter Electrical Sensor" }, - { 0x00000840, DeviceTypeClass::Simple, "Matter Control Bridge" }, - { 0x00000850, DeviceTypeClass::Simple, "Matter On/Off Sensor" }, + { 0x0000000A, DeviceTypeClass::Simple, "Door Lock" }, + { 0x0000000B, DeviceTypeClass::Simple, "Door Lock Controller" }, + { 0x0000000E, DeviceTypeClass::Simple, "Aggregator" }, + { 0x0000000F, DeviceTypeClass::Simple, "Generic Switch" }, + { 0x00000011, DeviceTypeClass::Utility, "Power Source" }, + { 0x00000012, DeviceTypeClass::Utility, "OTA Requestor" }, + { 0x00000013, DeviceTypeClass::Utility, "Bridged Node" }, + { 0x00000014, DeviceTypeClass::Utility, "OTA Provider" }, + { 0x00000015, DeviceTypeClass::Simple, "Contact Sensor" }, + { 0x00000016, DeviceTypeClass::Node, "Root Node" }, + { 0x00000019, DeviceTypeClass::Utility, "Secondary Network Interface" }, + { 0x00000022, DeviceTypeClass::Simple, "Speaker" }, + { 0x00000023, DeviceTypeClass::Simple, "Casting Video Player" }, + { 0x00000024, DeviceTypeClass::Simple, "Content App" }, + { 0x00000027, DeviceTypeClass::Simple, "Mode Select" }, + { 0x00000028, DeviceTypeClass::Simple, "Basic Video Player" }, + { 0x00000029, DeviceTypeClass::Simple, "Casting Video Client" }, + { 0x0000002A, DeviceTypeClass::Simple, "Video Remote Control" }, + { 0x0000002B, DeviceTypeClass::Simple, "Fan" }, + { 0x0000002C, DeviceTypeClass::Simple, "Air Quality Sensor" }, + { 0x0000002D, DeviceTypeClass::Simple, "Air Purifier" }, + { 0x00000041, DeviceTypeClass::Simple, "Water Freeze Detector" }, + { 0x00000042, DeviceTypeClass::Simple, "Water Valve" }, + { 0x00000043, DeviceTypeClass::Simple, "Water Leak Detector" }, + { 0x00000044, DeviceTypeClass::Simple, "Rain Sensor" }, + { 0x00000070, DeviceTypeClass::Simple, "Refrigerator" }, + { 0x00000071, DeviceTypeClass::Simple, "Temperature Controlled Cabinet" }, + { 0x00000072, DeviceTypeClass::Simple, "Room Air Conditioner" }, + { 0x00000073, DeviceTypeClass::Simple, "Laundry Washer" }, + { 0x00000074, DeviceTypeClass::Simple, "Robotic Vacuum Cleaner" }, + { 0x00000075, DeviceTypeClass::Simple, "Dishwasher" }, + { 0x00000076, DeviceTypeClass::Simple, "Smoke CO Alarm" }, + { 0x00000077, DeviceTypeClass::Simple, "Cook Surface" }, + { 0x00000078, DeviceTypeClass::Simple, "Cooktop" }, + { 0x00000079, DeviceTypeClass::Simple, "Microwave Oven" }, + { 0x0000007A, DeviceTypeClass::Simple, "Extractor Hood" }, + { 0x0000007B, DeviceTypeClass::Simple, "Oven" }, + { 0x0000007C, DeviceTypeClass::Simple, "Laundry Dryer" }, + { 0x00000090, DeviceTypeClass::Simple, "Network Infrastructure Manager" }, + { 0x00000091, DeviceTypeClass::Simple, "Thread Border Router" }, + { 0x00000100, DeviceTypeClass::Simple, "On/Off Light" }, + { 0x00000101, DeviceTypeClass::Simple, "Dimmable Light" }, + { 0x00000103, DeviceTypeClass::Simple, "On/Off Light Switch" }, + { 0x00000104, DeviceTypeClass::Simple, "Dimmer Switch" }, + { 0x00000105, DeviceTypeClass::Simple, "Color Dimmer Switch" }, + { 0x00000106, DeviceTypeClass::Simple, "Light Sensor" }, + { 0x00000107, DeviceTypeClass::Simple, "Occupancy Sensor" }, + { 0x0000010A, DeviceTypeClass::Simple, "On/Off Plug-in Unit" }, + { 0x0000010B, DeviceTypeClass::Simple, "Dimmable Plug-in Unit" }, + { 0x0000010C, DeviceTypeClass::Simple, "Color Temperature Light" }, + { 0x0000010D, DeviceTypeClass::Simple, "Extended Color Light" }, + { 0x00000202, DeviceTypeClass::Simple, "Window Covering" }, + { 0x00000203, DeviceTypeClass::Simple, "Window Covering Controller" }, + { 0x00000300, DeviceTypeClass::Simple, "Heating/Cooling Unit" }, + { 0x00000301, DeviceTypeClass::Simple, "Thermostat" }, + { 0x00000302, DeviceTypeClass::Simple, "Temperature Sensor" }, + { 0x00000303, DeviceTypeClass::Simple, "Pump" }, + { 0x00000304, DeviceTypeClass::Simple, "Pump Controller" }, + { 0x00000305, DeviceTypeClass::Simple, "Pressure Sensor" }, + { 0x00000306, DeviceTypeClass::Simple, "Flow Sensor" }, + { 0x00000307, DeviceTypeClass::Simple, "Humidity Sensor" }, + { 0x0000050C, DeviceTypeClass::Simple, "EVSE" }, + { 0x0000050D, DeviceTypeClass::Simple, "Device Energy Management" }, + { 0x00000510, DeviceTypeClass::Utility, "Electrical Sensor" }, + { 0x00000840, DeviceTypeClass::Simple, "Control Bridge" }, + { 0x00000850, DeviceTypeClass::Simple, "On/Off Sensor" }, }; -static_assert(ExtractVendorFromMEI(0xFFF10001) != 0, "Must have class defined for \"Matter Orphan Clusters\" if it's a standard device type"); -static_assert(ExtractVendorFromMEI(0xFFF10003) != 0, "Must have class defined for \"Matter All-clusters-app Server Example\" if it's a standard device type"); +static_assert(ExtractVendorFromMEI(0xFFF10001) != 0, "Must have class defined for \"Orphan Clusters\" if it's a standard device type"); +static_assert(ExtractVendorFromMEI(0xFFF10003) != 0, "Must have class defined for \"All-clusters-app Server Example\" if it's a standard device type"); } // anonymous namespace diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 5a10da85b1..0a04add54f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4543,6 +4543,361 @@ static id _Nullable DecodeEventPayloadForContentAppObserverCluster(EventId aEven *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForZoneManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ZoneManagement; + switch (aEventId) { + case Events::ZoneTriggered::Id: { + Events::ZoneTriggered::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRZoneManagementClusterZoneTriggeredEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.zones = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.reason)]; + value.reason = memberValue; + } while (0); + + return value; + } + case Events::ZoneStopped::Id: { + Events::ZoneStopped::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRZoneManagementClusterZoneStoppedEvent new]; + + do { + NSArray * _Nonnull memberValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.zones.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + memberValue = array_0; + } + value.zones = memberValue; + } while (0); + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.reason)]; + value.reason = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} +static id _Nullable DecodeEventPayloadForCameraAVStreamManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::CameraAvStreamManagement; + switch (aEventId) { + case Events::VideoStreamChanged::Id: { + Events::VideoStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterVideoStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.videoStreamID]; + value.videoStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.streamType.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.streamType.Value())]; + } else { + memberValue = nil; + } + value.streamType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.videoCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.videoCodec.Value())]; + } else { + memberValue = nil; + } + value.videoCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minFrameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.minFrameRate.Value()]; + } else { + memberValue = nil; + } + value.minFrameRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxFrameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.maxFrameRate.Value()]; + } else { + memberValue = nil; + } + value.maxFrameRate = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.minResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().height]; + } else { + memberValue = nil; + } + value.minResolution = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.maxResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().height]; + } else { + memberValue = nil; + } + value.maxResolution = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minBitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.minBitRate.Value()]; + } else { + memberValue = nil; + } + value.minBitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxBitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.maxBitRate.Value()]; + } else { + memberValue = nil; + } + value.maxBitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.minFragmentLen.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.minFragmentLen.Value()]; + } else { + memberValue = nil; + } + value.minFragmentLen = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.maxFragmentLen.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.maxFragmentLen.Value()]; + } else { + memberValue = nil; + } + value.maxFragmentLen = memberValue; + } while (0); + + return value; + } + case Events::AudioStreamChanged::Id: { + Events::AudioStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterAudioStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.audioStreamID]; + value.audioStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.streamType.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.streamType.Value())]; + } else { + memberValue = nil; + } + value.streamType = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.audioCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.audioCodec.Value())]; + } else { + memberValue = nil; + } + value.audioCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.channelCount.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.channelCount.Value()]; + } else { + memberValue = nil; + } + value.channelCount = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.sampleRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.sampleRate.Value()]; + } else { + memberValue = nil; + } + value.sampleRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.bitRate.Value()]; + } else { + memberValue = nil; + } + value.bitRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitDepth.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.bitDepth.Value()]; + } else { + memberValue = nil; + } + value.bitDepth = memberValue; + } while (0); + + return value; + } + case Events::SnapshotStreamChanged::Id: { + Events::SnapshotStreamChanged::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + + __auto_type * value = [MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent new]; + + do { + NSNumber * _Nonnull memberValue; + memberValue = [NSNumber numberWithUnsignedShort:cppValue.snapshotStreamID]; + value.snapshotStreamID = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.imageCodec.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.imageCodec.Value())]; + } else { + memberValue = nil; + } + value.imageCodec = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.frameRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedShort:cppValue.frameRate.Value()]; + } else { + memberValue = nil; + } + value.frameRate = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.bitRate.HasValue()) { + memberValue = [NSNumber numberWithUnsignedInt:cppValue.bitRate.Value()]; + } else { + memberValue = nil; + } + value.bitRate = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.minResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.minResolution.Value().height]; + } else { + memberValue = nil; + } + value.minResolution = memberValue; + } while (0); + do { + MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable memberValue; + if (cppValue.maxResolution.HasValue()) { + memberValue = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + memberValue.width = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().width]; + memberValue.height = [NSNumber numberWithUnsignedShort:cppValue.maxResolution.Value().height]; + } else { + memberValue = nil; + } + value.maxResolution = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.quality.HasValue()) { + memberValue = [NSNumber numberWithUnsignedChar:cppValue.quality.Value()]; + } else { + memberValue = nil; + } + value.quality = memberValue; + } while (0); + + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForWebRTCTransportProviderCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::WebRTCTransportProvider; @@ -4555,6 +4910,18 @@ static id _Nullable DecodeEventPayloadForWebRTCTransportProviderCluster(EventId *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForWebRTCTransportRequestorCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WebRTCTransportRequestor; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForChimeCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::Chime; @@ -5157,9 +5524,18 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ContentAppObserver::Id: { return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError); } + case Clusters::ZoneManagement::Id: { + return DecodeEventPayloadForZoneManagementCluster(aPath.mEventId, aReader, aError); + } + case Clusters::CameraAvStreamManagement::Id: { + return DecodeEventPayloadForCameraAVStreamManagementCluster(aPath.mEventId, aReader, aError); + } case Clusters::WebRTCTransportProvider::Id: { return DecodeEventPayloadForWebRTCTransportProviderCluster(aPath.mEventId, aReader, aError); } + case Clusters::WebRTCTransportRequestor::Id: { + return DecodeEventPayloadForWebRTCTransportRequestorCluster(aPath.mEventId, aReader, aError); + } case Clusters::Chime::Id: { return DecodeEventPayloadForChimeCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index bb93511dbf..02d36a82d7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2117,6 +2117,171 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterTwoDCartesianVertexStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull x MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterTwoDCartesianZoneStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull use MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull vertices MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable color MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneInformationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull zoneID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull zoneType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull zoneSource MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneTriggeringTimeControlStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull initialDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull augmentationDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxDuration MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull blindDuration MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneTriggeredEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRZoneManagementClusterZoneStoppedEvent : NSObject +@property (nonatomic, copy) NSArray * _Nonnull zones MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull reason MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoResolutionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull width MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull height MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull videoCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable watermarkEnabled MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable osdEnabled MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull frameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull quality MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotParamsStruct : NSObject +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull imageCodec MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull codec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nonnull resolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull minBitRate MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull maxNumberOfChannels MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedCodecs MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedSampleRates MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSArray * _Nonnull supportedBitDepths MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull audioCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull channelCount MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sampleRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull bitDepth MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull referenceCount MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoSensorParamsStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull sensorWidth MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull sensorHeight MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull hdrCapable MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxFPS MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull maxHDRFPS MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterViewportStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull x1 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y1 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull x2 MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull y2 MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterVideoStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxFrameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxBitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable minFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable maxFragmentLen MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterAudioStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable channelCount MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable sampleRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitDepth MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull snapshotStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable imageCodec MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable frameRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable bitRate MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable minResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable maxResolution MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable quality MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRWebRTCTransportProviderClusterICEServerStruct : NSObject @property (nonatomic, copy) NSArray * _Nonnull urls MTR_PROVISIONALLY_AVAILABLE; @@ -2136,6 +2301,25 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterICEServerStruct : NSObject +@property (nonatomic, copy) NSArray * _Nonnull urls MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable username MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable credential MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable caid MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRWebRTCTransportRequestorClusterWebRTCSessionStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull id MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull peerNodeID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull peerFabricIndex MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull streamType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable videoStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable audioStreamID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull metadataOptions MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterChimeSoundStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull chimeID MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 6ba439eb02..e38df78931 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8768,6 +8768,717 @@ - (NSString *)description @end +@implementation MTRZoneManagementClusterTwoDCartesianVertexStruct +- (instancetype)init +{ + if (self = [super init]) { + + _x = @(0); + + _y = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterTwoDCartesianVertexStruct alloc] init]; + + other.x = self.x; + other.y = self.y; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: x:%@; y:%@; >", NSStringFromClass([self class]), _x, _y]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterTwoDCartesianZoneStruct +- (instancetype)init +{ + if (self = [super init]) { + + _name = @""; + + _use = @(0); + + _vertices = [NSArray array]; + + _color = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterTwoDCartesianZoneStruct alloc] init]; + + other.name = self.name; + other.use = self.use; + other.vertices = self.vertices; + other.color = self.color; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; use:%@; vertices:%@; color:%@; >", NSStringFromClass([self class]), _name, _use, _vertices, _color]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneInformationStruct +- (instancetype)init +{ + if (self = [super init]) { + + _zoneID = @(0); + + _zoneType = @(0); + + _zoneSource = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneInformationStruct alloc] init]; + + other.zoneID = self.zoneID; + other.zoneType = self.zoneType; + other.zoneSource = self.zoneSource; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zoneID:%@; zoneType:%@; zoneSource:%@; >", NSStringFromClass([self class]), _zoneID, _zoneType, _zoneSource]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneTriggeringTimeControlStruct +- (instancetype)init +{ + if (self = [super init]) { + + _initialDuration = @(0); + + _augmentationDuration = @(0); + + _maxDuration = @(0); + + _blindDuration = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneTriggeringTimeControlStruct alloc] init]; + + other.initialDuration = self.initialDuration; + other.augmentationDuration = self.augmentationDuration; + other.maxDuration = self.maxDuration; + other.blindDuration = self.blindDuration; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: initialDuration:%@; augmentationDuration:%@; maxDuration:%@; blindDuration:%@; >", NSStringFromClass([self class]), _initialDuration, _augmentationDuration, _maxDuration, _blindDuration]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneTriggeredEvent +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + + _reason = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneTriggeredEvent alloc] init]; + + other.zones = self.zones; + other.reason = self.reason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; reason:%@; >", NSStringFromClass([self class]), _zones, _reason]; + return descriptionString; +} + +@end + +@implementation MTRZoneManagementClusterZoneStoppedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _zones = [NSArray array]; + + _reason = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRZoneManagementClusterZoneStoppedEvent alloc] init]; + + other.zones = self.zones; + other.reason = self.reason; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: zones:%@; reason:%@; >", NSStringFromClass([self class]), _zones, _reason]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoResolutionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _width = @(0); + + _height = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoResolutionStruct alloc] init]; + + other.width = self.width; + other.height = self.height; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: width:%@; height:%@; >", NSStringFromClass([self class]), _width, _height]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _streamType = @(0); + + _videoCodec = @(0); + + _minFrameRate = @(0); + + _maxFrameRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + + _maxBitRate = @(0); + + _minFragmentLen = @(0); + + _maxFragmentLen = @(0); + + _watermarkEnabled = nil; + + _osdEnabled = nil; + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamStruct alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + other.watermarkEnabled = self.watermarkEnabled; + other.osdEnabled = self.osdEnabled; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; watermarkEnabled:%@; osdEnabled:%@; referenceCount:%@; >", NSStringFromClass([self class]), _videoStreamID, _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen, _watermarkEnabled, _osdEnabled, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _imageCodec = @(0); + + _frameRate = @(0); + + _bitRate = @(0); + + _minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _quality = @(0); + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamStruct alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; referenceCount:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotParamsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _maxFrameRate = @(0); + + _imageCodec = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotParamsStruct alloc] init]; + + other.resolution = self.resolution; + other.maxFrameRate = self.maxFrameRate; + other.imageCodec = self.imageCodec; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: resolution:%@; maxFrameRate:%@; imageCodec:%@; >", NSStringFromClass([self class]), _resolution, _maxFrameRate, _imageCodec]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _codec = @(0); + + _resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + + _minBitRate = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterRateDistortionTradeOffPointsStruct alloc] init]; + + other.codec = self.codec; + other.resolution = self.resolution; + other.minBitRate = self.minBitRate; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: codec:%@; resolution:%@; minBitRate:%@; >", NSStringFromClass([self class]), _codec, _resolution, _minBitRate]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct +- (instancetype)init +{ + if (self = [super init]) { + + _maxNumberOfChannels = @(0); + + _supportedCodecs = [NSArray array]; + + _supportedSampleRates = [NSArray array]; + + _supportedBitDepths = [NSArray array]; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct alloc] init]; + + other.maxNumberOfChannels = self.maxNumberOfChannels; + other.supportedCodecs = self.supportedCodecs; + other.supportedSampleRates = self.supportedSampleRates; + other.supportedBitDepths = self.supportedBitDepths; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: maxNumberOfChannels:%@; supportedCodecs:%@; supportedSampleRates:%@; supportedBitDepths:%@; >", NSStringFromClass([self class]), _maxNumberOfChannels, _supportedCodecs, _supportedSampleRates, _supportedBitDepths]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamStruct +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + + _streamType = @(0); + + _audioCodec = @(0); + + _channelCount = @(0); + + _sampleRate = @(0); + + _bitRate = @(0); + + _bitDepth = @(0); + + _referenceCount = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamStruct alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + other.referenceCount = self.referenceCount; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; referenceCount:%@; >", NSStringFromClass([self class]), _audioStreamID, _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth, _referenceCount]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoSensorParamsStruct +- (instancetype)init +{ + if (self = [super init]) { + + _sensorWidth = @(0); + + _sensorHeight = @(0); + + _hdrCapable = @(0); + + _maxFPS = @(0); + + _maxHDRFPS = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoSensorParamsStruct alloc] init]; + + other.sensorWidth = self.sensorWidth; + other.sensorHeight = self.sensorHeight; + other.hdrCapable = self.hdrCapable; + other.maxFPS = self.maxFPS; + other.maxHDRFPS = self.maxHDRFPS; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: sensorWidth:%@; sensorHeight:%@; hdrCapable:%@; maxFPS:%@; maxHDRFPS:%@; >", NSStringFromClass([self class]), _sensorWidth, _sensorHeight, _hdrCapable, _maxFPS, _maxHDRFPS]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterViewportStruct +- (instancetype)init +{ + if (self = [super init]) { + + _x1 = @(0); + + _y1 = @(0); + + _x2 = @(0); + + _y2 = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterViewportStruct alloc] init]; + + other.x1 = self.x1; + other.y1 = self.y1; + other.x2 = self.x2; + other.y2 = self.y2; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: x1:%@; y1:%@; x2:%@; y2:%@; >", NSStringFromClass([self class]), _x1, _y1, _x2, _y2]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterVideoStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _videoStreamID = @(0); + + _streamType = nil; + + _videoCodec = nil; + + _minFrameRate = nil; + + _maxFrameRate = nil; + + _minResolution = nil; + + _maxResolution = nil; + + _minBitRate = nil; + + _maxBitRate = nil; + + _minFragmentLen = nil; + + _maxFragmentLen = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterVideoStreamChangedEvent alloc] init]; + + other.videoStreamID = self.videoStreamID; + other.streamType = self.streamType; + other.videoCodec = self.videoCodec; + other.minFrameRate = self.minFrameRate; + other.maxFrameRate = self.maxFrameRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.minBitRate = self.minBitRate; + other.maxBitRate = self.maxBitRate; + other.minFragmentLen = self.minFragmentLen; + other.maxFragmentLen = self.maxFragmentLen; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: videoStreamID:%@; streamType:%@; videoCodec:%@; minFrameRate:%@; maxFrameRate:%@; minResolution:%@; maxResolution:%@; minBitRate:%@; maxBitRate:%@; minFragmentLen:%@; maxFragmentLen:%@; >", NSStringFromClass([self class]), _videoStreamID, _streamType, _videoCodec, _minFrameRate, _maxFrameRate, _minResolution, _maxResolution, _minBitRate, _maxBitRate, _minFragmentLen, _maxFragmentLen]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterAudioStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _audioStreamID = @(0); + + _streamType = nil; + + _audioCodec = nil; + + _channelCount = nil; + + _sampleRate = nil; + + _bitRate = nil; + + _bitDepth = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterAudioStreamChangedEvent alloc] init]; + + other.audioStreamID = self.audioStreamID; + other.streamType = self.streamType; + other.audioCodec = self.audioCodec; + other.channelCount = self.channelCount; + other.sampleRate = self.sampleRate; + other.bitRate = self.bitRate; + other.bitDepth = self.bitDepth; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: audioStreamID:%@; streamType:%@; audioCodec:%@; channelCount:%@; sampleRate:%@; bitRate:%@; bitDepth:%@; >", NSStringFromClass([self class]), _audioStreamID, _streamType, _audioCodec, _channelCount, _sampleRate, _bitRate, _bitDepth]; + return descriptionString; +} + +@end + +@implementation MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent +- (instancetype)init +{ + if (self = [super init]) { + + _snapshotStreamID = @(0); + + _imageCodec = nil; + + _frameRate = nil; + + _bitRate = nil; + + _minResolution = nil; + + _maxResolution = nil; + + _quality = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRCameraAVStreamManagementClusterSnapshotStreamChangedEvent alloc] init]; + + other.snapshotStreamID = self.snapshotStreamID; + other.imageCodec = self.imageCodec; + other.frameRate = self.frameRate; + other.bitRate = self.bitRate; + other.minResolution = self.minResolution; + other.maxResolution = self.maxResolution; + other.quality = self.quality; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: snapshotStreamID:%@; imageCodec:%@; frameRate:%@; bitRate:%@; minResolution:%@; maxResolution:%@; quality:%@; >", NSStringFromClass([self class]), _snapshotStreamID, _imageCodec, _frameRate, _bitRate, _minResolution, _maxResolution, _quality]; + return descriptionString; +} + +@end + @implementation MTRWebRTCTransportProviderClusterICEServerStruct - (instancetype)init { @@ -8849,6 +9560,87 @@ - (NSString *)description @end +@implementation MTRWebRTCTransportRequestorClusterICEServerStruct +- (instancetype)init +{ + if (self = [super init]) { + + _urls = [NSArray array]; + + _username = nil; + + _credential = nil; + + _caid = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWebRTCTransportRequestorClusterICEServerStruct alloc] init]; + + other.urls = self.urls; + other.username = self.username; + other.credential = self.credential; + other.caid = self.caid; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: urls:%@; username:%@; credential:%@; caid:%@; >", NSStringFromClass([self class]), _urls, _username, _credential, _caid]; + return descriptionString; +} + +@end + +@implementation MTRWebRTCTransportRequestorClusterWebRTCSessionStruct +- (instancetype)init +{ + if (self = [super init]) { + + _id = @(0); + + _peerNodeID = @(0); + + _peerFabricIndex = @(0); + + _streamType = @(0); + + _videoStreamID = nil; + + _audioStreamID = nil; + + _metadataOptions = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRWebRTCTransportRequestorClusterWebRTCSessionStruct alloc] init]; + + other.id = self.id; + other.peerNodeID = self.peerNodeID; + other.peerFabricIndex = self.peerFabricIndex; + other.streamType = self.streamType; + other.videoStreamID = self.videoStreamID; + other.audioStreamID = self.audioStreamID; + other.metadataOptions = self.metadataOptions; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: id:%@; peerNodeID:%@; peerFabricIndex:%@; streamType:%@; videoStreamID:%@; audioStreamID:%@; metadataOptions:%@; >", NSStringFromClass([self class]), _id, _peerNodeID, _peerFabricIndex, _streamType, _videoStreamID, _audioStreamID, _metadataOptions]; + return descriptionString; +} + +@end + @implementation MTRChimeClusterChimeSoundStruct - (instancetype)init { diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index afc1df1933..e19178531c 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -329,6 +329,17 @@ B2E0D7B7245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7AE245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm */; }; B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */; }; + B43B39EA2CB859A5006AA284 /* DumpMemoryGraphCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */; }; + B43B39EB2CB859A5006AA284 /* LeaksTool.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39E82CB859A5006AA284 /* LeaksTool.mm */; }; + B43B39EC2CB859A5006AA284 /* DumpMemoryGraphCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */; }; + B43B39ED2CB859A5006AA284 /* Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E42CB859A5006AA284 /* Commands.h */; }; + B43B39EE2CB859A5006AA284 /* LeaksTool.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39E72CB859A5006AA284 /* LeaksTool.h */; }; + B43B39F52CB99090006AA284 /* ControllerStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39F22CB99090006AA284 /* ControllerStorage.mm */; }; + B43B39F62CB99090006AA284 /* CertificateIssuer.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39F02CB99090006AA284 /* CertificateIssuer.mm */; }; + B43B39F72CB99090006AA284 /* PreferencesStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = B43B39F42CB99090006AA284 /* PreferencesStorage.mm */; }; + B43B39F82CB99090006AA284 /* CertificateIssuer.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39EF2CB99090006AA284 /* CertificateIssuer.h */; }; + B43B39F92CB99090006AA284 /* PreferencesStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39F32CB99090006AA284 /* PreferencesStorage.h */; }; + B43B39FA2CB99090006AA284 /* ControllerStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = B43B39F12CB99090006AA284 /* ControllerStorage.h */; }; B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B45373A92A9FE73400807602 /* WebSocketServer.cpp */; }; B45373BD2A9FEA9100807602 /* service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B22A9FEA9000807602 /* service.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; B45373BE2A9FEA9100807602 /* network.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B32A9FEA9000807602 /* network.c */; settings = {COMPILER_FLAGS = "-Wno-error -Wno-unreachable-code -Wno-conversion -Wno-format-nonliteral"; }; }; @@ -373,6 +384,8 @@ B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */; }; B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */; }; B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */; }; + B4F773CA2CB54B61008C6B23 /* LeakChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = B4F773C72CB54B61008C6B23 /* LeakChecker.h */; }; + B4F773CB2CB54B61008C6B23 /* LeakChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4F773C82CB54B61008C6B23 /* LeakChecker.mm */; }; B4FCD56A2B5EDBD300832859 /* MTRDiagnosticLogsType.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD5692B5EDBD300832859 /* MTRDiagnosticLogsType.h */; settings = {ATTRIBUTES = (Public, ); }; }; B4FCD5702B603A6300832859 /* Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD56D2B603A6300832859 /* Commands.h */; }; B4FCD5712B603A6300832859 /* DownloadLogCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B4FCD56E2B603A6300832859 /* DownloadLogCommand.h */; }; @@ -773,6 +786,17 @@ B2E0D7AE245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRQRCodeSetupPayloadParser.mm; sourceTree = ""; }; B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRSetupPayload.h; sourceTree = ""; }; B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRSetupPayload.mm; sourceTree = ""; }; + B43B39E42CB859A5006AA284 /* Commands.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Commands.h; sourceTree = ""; }; + B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DumpMemoryGraphCommand.h; sourceTree = ""; }; + B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DumpMemoryGraphCommand.mm; sourceTree = ""; }; + B43B39E72CB859A5006AA284 /* LeaksTool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LeaksTool.h; sourceTree = ""; }; + B43B39E82CB859A5006AA284 /* LeaksTool.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LeaksTool.mm; sourceTree = ""; }; + B43B39EF2CB99090006AA284 /* CertificateIssuer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CertificateIssuer.h; sourceTree = ""; }; + B43B39F02CB99090006AA284 /* CertificateIssuer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateIssuer.mm; sourceTree = ""; }; + B43B39F12CB99090006AA284 /* ControllerStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ControllerStorage.h; sourceTree = ""; }; + B43B39F22CB99090006AA284 /* ControllerStorage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ControllerStorage.mm; sourceTree = ""; }; + B43B39F32CB99090006AA284 /* PreferencesStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PreferencesStorage.h; sourceTree = ""; }; + B43B39F42CB99090006AA284 /* PreferencesStorage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PreferencesStorage.mm; sourceTree = ""; }; B45373A92A9FE73400807602 /* WebSocketServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketServer.cpp; sourceTree = ""; }; B45373B22A9FEA9000807602 /* service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = service.c; path = "repo/lib/core-net/service.c"; sourceTree = ""; }; B45373B32A9FEA9000807602 /* network.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = network.c; path = "repo/lib/core-net/network.c"; sourceTree = ""; }; @@ -818,6 +842,8 @@ B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteDataModelLogger.h; sourceTree = ""; }; B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SleepCommand.mm; sourceTree = ""; }; B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WaitForCommissioneeCommand.mm; sourceTree = ""; }; + B4F773C72CB54B61008C6B23 /* LeakChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LeakChecker.h; sourceTree = ""; }; + B4F773C82CB54B61008C6B23 /* LeakChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LeakChecker.mm; sourceTree = ""; }; B4FCD5692B5EDBD300832859 /* MTRDiagnosticLogsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDiagnosticLogsType.h; sourceTree = ""; }; B4FCD56D2B603A6300832859 /* Commands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Commands.h; sourceTree = ""; }; B4FCD56E2B603A6300832859 /* DownloadLogCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadLogCommand.h; sourceTree = ""; }; @@ -874,6 +900,7 @@ 037C3CA82991A44B00B7EEE2 /* darwin-framework-tool */ = { isa = PBXGroup; children = ( + B4F773C92CB54B61008C6B23 /* debug */, 039145E02993102B00257B3E /* main.mm */, 03F430A52994100000166449 /* controller */, 039547092992DB02006D42A8 /* editline */, @@ -892,6 +919,7 @@ 037C3D7B2991BD4F00B7EEE2 /* commands */ = { isa = PBXGroup; children = ( + B43B39E92CB859A5006AA284 /* memory */, 5124311D2BA0C09A000BC136 /* configuration */, B4FCD56C2B603A6300832859 /* bdx */, B4E262182AA0CFFE00DBA5BC /* delay */, @@ -971,6 +999,12 @@ 037C3D9B2991BD4F00B7EEE2 /* common */ = { isa = PBXGroup; children = ( + B43B39EF2CB99090006AA284 /* CertificateIssuer.h */, + B43B39F02CB99090006AA284 /* CertificateIssuer.mm */, + B43B39F12CB99090006AA284 /* ControllerStorage.h */, + B43B39F22CB99090006AA284 /* ControllerStorage.mm */, + B43B39F32CB99090006AA284 /* PreferencesStorage.h */, + B43B39F42CB99090006AA284 /* PreferencesStorage.mm */, B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */, B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */, 037C3D9C2991BD4F00B7EEE2 /* CHIPCommandBridge.mm */, @@ -1479,6 +1513,18 @@ path = CHIPTests; sourceTree = ""; }; + B43B39E92CB859A5006AA284 /* memory */ = { + isa = PBXGroup; + children = ( + B43B39E42CB859A5006AA284 /* Commands.h */, + B43B39E52CB859A5006AA284 /* DumpMemoryGraphCommand.h */, + B43B39E62CB859A5006AA284 /* DumpMemoryGraphCommand.mm */, + B43B39E72CB859A5006AA284 /* LeaksTool.h */, + B43B39E82CB859A5006AA284 /* LeaksTool.mm */, + ); + path = memory; + sourceTree = ""; + }; B45373AD2A9FE9BF00807602 /* libwebsockets */ = { isa = PBXGroup; children = ( @@ -1543,6 +1589,15 @@ path = delay; sourceTree = ""; }; + B4F773C92CB54B61008C6B23 /* debug */ = { + isa = PBXGroup; + children = ( + B4F773C72CB54B61008C6B23 /* LeakChecker.h */, + B4F773C82CB54B61008C6B23 /* LeakChecker.mm */, + ); + path = debug; + sourceTree = ""; + }; B4FCD56C2B603A6300832859 /* bdx */ = { isa = PBXGroup; children = ( @@ -1594,6 +1649,10 @@ 037C3DAF2991BD4F00B7EEE2 /* DeviceControllerDelegateBridge.h in Headers */, B4FCD5712B603A6300832859 /* DownloadLogCommand.h in Headers */, 037C3DC32991BD5100B7EEE2 /* Commands.h in Headers */, + B4F773CA2CB54B61008C6B23 /* LeakChecker.h in Headers */, + B43B39F82CB99090006AA284 /* CertificateIssuer.h in Headers */, + B43B39F92CB99090006AA284 /* PreferencesStorage.h in Headers */, + B43B39FA2CB99090006AA284 /* ControllerStorage.h in Headers */, 037C3DB82991BD5000B7EEE2 /* ClusterCommandBridge.h in Headers */, 037C3DC82991BD5100B7EEE2 /* CHIPToolKeypair.h in Headers */, 037C3DB52991BD5000B7EEE2 /* WriteAttributeCommandBridge.h in Headers */, @@ -1604,6 +1663,9 @@ 037C3DD12991BD5200B7EEE2 /* Commands.h in Headers */, 037C3DB92991BD5000B7EEE2 /* ReportCommandBridge.h in Headers */, 037C3DBE2991BD5000B7EEE2 /* OTASoftwareUpdateInteractive.h in Headers */, + B43B39EC2CB859A5006AA284 /* DumpMemoryGraphCommand.h in Headers */, + B43B39ED2CB859A5006AA284 /* Commands.h in Headers */, + B43B39EE2CB859A5006AA284 /* LeaksTool.h in Headers */, 037C3DBD2991BD5000B7EEE2 /* OTAProviderDelegate.h in Headers */, B4FCD5702B603A6300832859 /* Commands.h in Headers */, 037C3DB02991BD4F00B7EEE2 /* Commands.h in Headers */, @@ -1900,6 +1962,7 @@ 03F430A82994112B00166449 /* editline.c in Sources */, 03F430AA2994113500166449 /* sysunix.c in Sources */, B45373BF2A9FEA9100807602 /* adopt.c in Sources */, + B4F773CB2CB54B61008C6B23 /* LeakChecker.mm in Sources */, B45373D12A9FEB0C00807602 /* alloc.c in Sources */, B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */, B45373D22A9FEB0C00807602 /* buflist.c in Sources */, @@ -1929,6 +1992,11 @@ B45373DF2A9FEB6F00807602 /* system.c in Sources */, B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */, + B43B39F52CB99090006AA284 /* ControllerStorage.mm in Sources */, + B43B39F62CB99090006AA284 /* CertificateIssuer.mm in Sources */, + B43B39F72CB99090006AA284 /* PreferencesStorage.mm in Sources */, + B43B39EA2CB859A5006AA284 /* DumpMemoryGraphCommand.mm in Sources */, + B43B39EB2CB859A5006AA284 /* LeaksTool.mm in Sources */, B45374002A9FEC4F00807602 /* unix-init.c in Sources */, B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */, E04AC67E2BEEA17F00BA409B /* ember-io-storage.cpp in Sources */, @@ -2198,7 +2266,12 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + "OTHER_CFLAGS[sdk=iphoneos*]" = ( + "-DLWS_PLAT_UNIX", + "-DLWS_DETECTED_PLAT_IOS", + ); OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; + "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; @@ -2271,7 +2344,12 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + "OTHER_CFLAGS[sdk=iphoneos*]" = ( + "-DLWS_PLAT_UNIX", + "-DLWS_DETECTED_PLAT_IOS", + ); OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; + "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 209d7484b9..cac22ed0da 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -52,6 +52,8 @@ namespace Internal { template class GenericPlatformManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericPlatformManagerImpl_POSIX; @@ -249,6 +251,8 @@ class ConnectivityManager template friend class Internal::GenericPlatformManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericPlatformManagerImpl_POSIX; diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index 4ce673ec41..c5fc1f1c08 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -53,6 +53,8 @@ class GenericConfigurationManagerImpl; template class GenericPlatformManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericPlatformManagerImpl_POSIX; @@ -261,6 +263,8 @@ class PlatformManager template friend class Internal::GenericPlatformManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericPlatformManagerImpl_POSIX; diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index f9f7aed04e..9498ad894c 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -55,6 +55,8 @@ class GenericPlatformManagerImpl; template class GenericConfigurationManagerImpl; template +class GenericPlatformManagerImpl_CMSISOS; +template class GenericPlatformManagerImpl_FreeRTOS; template class GenericConnectivityManagerImpl_Thread; @@ -168,6 +170,8 @@ class ThreadStackManager template friend class Internal::GenericConfigurationManagerImpl; template + friend class Internal::GenericPlatformManagerImpl_CMSISOS; + template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; template friend class Internal::GenericConnectivityManagerImpl_Thread; diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h new file mode 100644 index 0000000000..e40281527a --- /dev/null +++ b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h @@ -0,0 +1,182 @@ +/* + * + * Copyright (c) 2021-2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an generic implementation of PlatformManager features + * for platform using CMSISOS 2 OS Abstraction APIs. + */ + +#pragma once + +#include +#include + +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +/** + * Provides a generic implementation of PlatformManager features for platforms using CMSISOS 2 OS Abstraction APIs + * + * This template contains implementations of select features from the PlatformManager abstract + * interface that are suitable for use on CMSISOS-based platforms. It is intended to be inherited + * (directly or indirectly) by the PlatformManagerImpl class, which also appears as the template's + * ImplClass parameter. + */ +template +class GenericPlatformManagerImpl_CMSISOS : public GenericPlatformManagerImpl +{ + +protected: + osMutexId_t mChipStackLock = nullptr; + osMessageQueueId_t mChipEventQueue = nullptr; + osThreadId_t mEventLoopTask = nullptr; + bool mChipTimerActive; + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + osMessageQueueId_t mBackgroundEventQueue = nullptr; + osThreadId_t mBackgroundEventLoopTask = nullptr; +#endif + + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR _InitChipStack(); + + void _LockChipStack(void); + bool _TryLockChipStack(void); + void _UnlockChipStack(void); + + CHIP_ERROR _PostEvent(const ChipDeviceEvent * event); + void _RunEventLoop(void); + CHIP_ERROR _StartEventLoopTask(void); + CHIP_ERROR _StopEventLoopTask(); + CHIP_ERROR _StartChipTimer(System::Clock::Timeout duration); + void _Shutdown(void); + +#if CHIP_STACK_LOCK_TRACKING_ENABLED + bool _IsChipStackLockedByCurrentThread() const; +#endif + + CHIP_ERROR _PostBackgroundEvent(const ChipDeviceEvent * event); + void _RunBackgroundEventLoop(void); + CHIP_ERROR _StartBackgroundEventLoopTask(void); + CHIP_ERROR _StopBackgroundEventLoopTask(); + + // ===== Methods available to the implementation subclass. + +private: + // ===== Private members for use by this class only. + + inline ImplClass * Impl() { return static_cast(this); } + + static void EventLoopTaskMain(void * pvParameter); + uint32_t SyncNextChipTimerHandling(); + uint32_t mNextTimerBaseTime = 0; + uint32_t mNextTimerDurationTicks = 0; + std::atomic mShouldRunEventLoop; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE) && CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + uint8_t mEventQueueBuffer[CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)]; + osMessageQueue_t mEventQueueStruct; + const osMessageQueueAttr_t mEventQueueAttr = { .cb_mem = &mEventQueueStruct, + .cb_size = osMessageQueueCbSize, + .mq_mem = mEventQueueBuffer, + .mq_size = sizeof(mEventQueueBuffer) }; + + const osMessageQueueAttr_t * mEventQueueAttrPtr = &mEventQueueAttr; +#else + // Nothing to configure for queues, Just use this to avoid #ifdef in the class implementation + const osMessageQueueAttr_t * mEventQueueAttrPtr = nullptr; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + uint8_t mEventLoopStack[CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE]; + osThread_t mEventLoopTaskControlBlock; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + + const osThreadAttr_t mEventLoopTaskAttr = { + .name = CHIP_DEVICE_CONFIG_CHIP_TASK_NAME, + .attr_bits = osThreadDetached, +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .cb_mem = &mEventLoopTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = mEventLoopStack, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .stack_size = CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE, + .priority = CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY + }; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX) && CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + osMutexCbSize uint8_t mMutexControlBlock[osMutexCbSize]; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + const osMutexAttr_t mChipStackMutexAttr = { + .name = "", +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX) && CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + .cb_mem = &mMutexControlBlock, + .cb_size = osMutexCbSize, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_MUTEX + .attr_bits = osMutexRecursive | osMutexPrioInherit, + }; + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + static void BackgroundEventLoopTaskMain(void * pvParameter); + std::atomic mShouldRunBackgroundEventLoop; + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE) && CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + uint8_t mBackgroundQueueBuffer[CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE * sizeof(ChipDeviceEvent)]; + osMessageQueue_t mBackgroundQueueStruct; + const osMessageQueueAttr_t mBgQueueAttr = { .cb_mem = &mBackgroundQueueStruct, + .cb_size = osMessageQueueCbSize, + .mq_mem = mBackgroundQueueBuffer, + .mq_size = sizeof(mBackgroundQueueBuffer) }; + + const osMessageQueueAttr_t * mBgQueueAttrPtr = &mBgQueueAttr; +#else + // Nothing to configure for queues, Just use this to avoid #ifdef in the class implementation + const osMessageQueueAttr_t * mBgQueueAttrPtr = nullptr; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE + +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + uint8_t mBackgroundEventLoopStack[CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE]; + osThread_t mBackgroundEventLoopTaskControlBlock; +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + + const osThreadAttr_t mBgEventLoopTaskAttr = { + .name = CHIP_DEVICE_CONFIG_BG_TASK_NAME, + .attr_bits = osThreadDetached, +#if defined(CHIP_CONFIG_CMSISOS_USE_STATIC_TASK) && CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .cb_mem = &mBackgroundEventLoopTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = mBackgroundEventLoopStack, +#endif // CHIP_CONFIG_CMSISOS_USE_STATIC_TASK + .stack_size = CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE, + .priority = CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY + }; +#endif // CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING +}; + +// Instruct the compiler to instantiate the template only when explicitly told to do so. +extern template class GenericPlatformManagerImpl_CMSISOS; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp new file mode 100644 index 0000000000..b75fcbe0c2 --- /dev/null +++ b/src/include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp @@ -0,0 +1,375 @@ +/* + * + * Copyright (c) 2021-2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Contains non-inline method definitions for the + * GenericPlatformManagerImpl_CMSISOS<> template. + */ + +#ifndef GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP +#define GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP + +#include +#include +#include + +#include + +// Include the non-inline definitions for the GenericPlatformManagerImpl<> template, +// from which the GenericPlatformManagerImpl_CMSISOS<> template inherits. +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_InitChipStack(void) +{ + mNextTimerBaseTime = osKernelGetTickCount(); + mNextTimerDurationTicks = 0; + mChipTimerActive = false; + + // We support calling Shutdown followed by InitChipStack, because some tests + // do that. To keep things simple for existing consumers, we do not + // destroy our lock and queue at shutdown, but rather check whether they + // already exist here before trying to create them. + if (mChipStackLock == nullptr) + { + mChipStackLock = osMutexNew(&mChipStackMutexAttr); + VerifyOrReturnError(mChipStackLock != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to create CHIP stack lock")); + } + + if (mChipEventQueue == nullptr) + { + mChipEventQueue = osMessageQueueNew(CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE, sizeof(ChipDeviceEvent), mEventQueueAttrPtr); + VerifyOrReturnError(mChipEventQueue != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to allocate CHIP main event queue")); + } + else + { + // Clear out any events that might be stuck in the queue, so we start + // with a clean slate, as if we had just re-created the queue. + osMessageQueueReset(mChipEventQueue); + } + + mShouldRunEventLoop.store(false); + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + if (mBackgroundEventQueue == nullptr) + { + mBackgroundEventQueue = + osMessageQueueNew(CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE, sizeof(ChipDeviceEvent), mBgQueueAttrPtr); + VerifyOrReturnError(mBackgroundEventQueue != nullptr, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to allocate CHIP background event queue")); + } + else + { + osMessageQueueReset(mBackgroundEventQueue); + } + + mShouldRunBackgroundEventLoop.store(false); +#endif + + // Call up to the base class _InitChipStack() to perform the bulk of the initialization. + return GenericPlatformManagerImpl::_InitChipStack(); +} + +template +void GenericPlatformManagerImpl_CMSISOS::_LockChipStack(void) +{ + osMutexAcquire(mChipStackLock, osWaitForever); +} + +template +bool GenericPlatformManagerImpl_CMSISOS::_TryLockChipStack(void) +{ + return osMutexAcquire(mChipStackLock, 0) == osOK; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_UnlockChipStack(void) +{ + osMutexRelease(mChipStackLock); +} + +#if CHIP_STACK_LOCK_TRACKING_ENABLED +template +bool GenericPlatformManagerImpl_CMSISOS::_IsChipStackLockedByCurrentThread() const +{ + // If we have not started our event loop yet, return true because in that + // case we can't be racing against the (not yet started) event loop. + // + // Similarly, if mChipStackLock has not been created yet, might as well + // return true. + return (mEventLoopTask == nullptr) || (mChipStackLock == nullptr) || (osMutexGetOwner(mChipStackLock) == osThreadGetId()); +} +#endif // CHIP_STACK_LOCK_TRACKING_ENABLED + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_PostEvent(const ChipDeviceEvent * event) +{ + VerifyOrReturnError(mChipEventQueue != nullptr, CHIP_ERROR_UNINITIALIZED); + + osStatus_t status = osMessageQueuePut(mChipEventQueue, event, osPriorityNormal, 1); + if (status != osOK) + { + ChipLogError(DeviceLayer, "Failed to post event to CHIP Platform event queue"); + return CHIP_ERROR(chip::ChipError::Range::kOS, status); + } + return CHIP_NO_ERROR; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_RunEventLoop(void) +{ + // Lock the CHIP stack. + StackLock lock; + + bool oldShouldRunEventLoop = false; + if (!mShouldRunEventLoop.compare_exchange_strong(oldShouldRunEventLoop /* expected */, true /* desired */)) + { + ChipLogError(DeviceLayer, "Error trying to run the event loop while it is already running"); + return; + } + + while (mShouldRunEventLoop.load()) + { + uint32_t waitTimeInTicks; + + // If one or more CHIP timers are active... + if (mChipTimerActive) + { + // Adjust the base time and remaining duration for the next scheduled timer based on the + // amount of time that has elapsed since it was started. + // When the timer's expiration time elapses, Handle the platform Timer + // else wait for a queue event for timer remaining time. + waitTimeInTicks = SyncNextChipTimerHandling(); + if (waitTimeInTicks == 0) + { + // Reset the 'timer active' flag. This will be set to true again by _StartChipTimer() + // if there are further timers beyond the expired one that are still active. + mChipTimerActive = false; + + // Call into the system layer to dispatch the callback functions for all timers + // that have expired. + // TODO We use the same SystemLayer implementation as FreeRTOS, Nothing in it is freeRTOS specific. We should + // it. + CHIP_ERROR err = static_cast(DeviceLayer::SystemLayer()).HandlePlatformTimer(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error handling CHIP timers: %" CHIP_ERROR_FORMAT, err.Format()); + } + } + } + else + { + // No CHIP timers are active, so we wait indefinitely for an event to arrive on the event + // queue. + waitTimeInTicks = osWaitForever; + } + + // Unlock the CHIP stack, allowing other threads to enter CHIP while + // the event loop thread is sleeping. + StackUnlock unlock; + ChipDeviceEvent event; + osStatus_t eventReceived = osMessageQueueGet(mChipEventQueue, &event, nullptr, waitTimeInTicks); + + // If an event was received, dispatch it and continue until the queue is empty. + while (eventReceived == osOK) + { + StackLock lock; + Impl()->DispatchEvent(&event); + StackUnlock unlock; + eventReceived = osMessageQueueGet(mChipEventQueue, &event, nullptr, 0); + } + } +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartEventLoopTask(void) +{ + mEventLoopTask = osThreadNew(EventLoopTaskMain, this, &mEventLoopTaskAttr); + return (mEventLoopTask != nullptr) ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; +} + +template +void GenericPlatformManagerImpl_CMSISOS::EventLoopTaskMain(void * pvParameter) +{ + ChipLogDetail(DeviceLayer, "CHIP event task running"); + static_cast *>(pvParameter)->Impl()->RunEventLoop(); +} + +/** + * @brief Calculate the elapsed time of the active chip platform timer since it has been started, + * as set in mNextTimerBaseTime, and adjust its remaining time with the mNextTimerDurationTicks member + * + * @return The next Timer remaining time in ticks + */ +template +uint32_t GenericPlatformManagerImpl_CMSISOS::SyncNextChipTimerHandling() +{ + uint32_t elapsedTime = 0; + uint32_t timerBaseTime = mNextTimerBaseTime; + uint32_t currentTime = osKernelGetTickCount(); + if (currentTime < timerBaseTime) + { + // TickCount has wrapped around + elapsedTime = (UINT32_MAX - timerBaseTime) + currentTime; + } + else + { + elapsedTime = currentTime - timerBaseTime; + } + + if (elapsedTime < mNextTimerDurationTicks) + { + // We didn't timeout yet, adjust the remaining time + mNextTimerDurationTicks -= elapsedTime; + mNextTimerBaseTime = osKernelGetTickCount(); + } + else + { + mNextTimerDurationTicks = 0; + } + return mNextTimerDurationTicks; +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_PostBackgroundEvent(const ChipDeviceEvent * event) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + VerifyOrReturnError(mBackgroundEventQueue != nullptr, CHIP_ERROR_UNINITIALIZED); + if (!(event->Type == DeviceEventType::kCallWorkFunct || event->Type == DeviceEventType::kNoOp)) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + osStatus_t status = osMessageQueuePut(mBackgroundEventQueue, event, osPriorityNormal, 1); + VerifyOrReturnError(status == osOk, CHIP_ERROR_NO_MEMORY, + ChipLogError(DeviceLayer, "Failed to post event to CHIP background event queue")); + return CHIP_NO_ERROR; +#else + // Use foreground event loop for background events + return _PostEvent(event); +#endif +} + +template +void GenericPlatformManagerImpl_CMSISOS::_RunBackgroundEventLoop(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + bool oldShouldRunBackgroundEventLoop = false; + VerifyOrReturn( + mShouldRunBackgroundEventLoop.compare_exchange_strong(oldShouldRunBackgroundEventLoop /* expected */, true /* desired */), + ChipLogError(DeviceLayer, "Error trying to run the background event loop while it is already running")); + + while (mShouldRunBackgroundEventLoop.load()) + { + ChipDeviceEvent event; + osStatus_t eventReceived = osMessageQueueGet(mBackgroundEventQueue, &event, NULL, osWaitForever); + while (eventReceived == osOK) + { + Impl()->DispatchEvent(&event); + eventReceived = osMessageQueueGet(mBackgroundEventQueue, &event, portMAX_DELAY); + } + } +#endif +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartBackgroundEventLoopTask(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + mBackgroundEventLoopTask = osThreadNew(BackgroundEventLoopTaskMain, this, &mBgEventLoopTaskAttr); + return (mBackgroundEventLoopTask != NULL) ? CHIP_NO_ERROR : CHIP_ERROR_NO_MEMORY; +#else + // Use foreground event loop for background events + return CHIP_NO_ERROR; +#endif +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StopBackgroundEventLoopTask(void) +{ +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING + bool oldShouldRunBackgroundEventLoop = true; + if (mShouldRunBackgroundEventLoop.compare_exchange_strong(oldShouldRunBackgroundEventLoop /* expected */, false /* desired */)) + { + ChipDeviceEvent noop{ .Type = DeviceEventType::kNoOp }; + osMessageQueuePut(mBackgroundEventQueue, &noop, osPriorityNormal, 0); + } + return CHIP_NO_ERROR; +#else + // Use foreground event loop for background events + return CHIP_NO_ERROR; +#endif +} + +#if defined(CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING) && CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING +template +void GenericPlatformManagerImpl_CMSISOS::BackgroundEventLoopTaskMain(void * pvParameter) +{ + ChipLogDetail(DeviceLayer, "CHIP background task running"); + static_cast *>(pvParameter)->Impl()->RunBackgroundEventLoop(); +} +#endif + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StartChipTimer(System::Clock::Timeout delay) +{ + mChipTimerActive = true; + mNextTimerBaseTime = osKernelGetTickCount(); + mNextTimerDurationTicks = (System::Clock::Milliseconds64(delay).count() * osKernelGetTickFreq()) / 1000; + + // If the platform timer is being updated by a thread other than the event loop thread, + // trigger the event loop thread to recalculate its wait time by posting a no-op event + // to the event queue. + if (osThreadGetId() != mEventLoopTask) + { + ChipDeviceEvent noop{ .Type = DeviceEventType::kNoOp }; + ReturnErrorOnFailure(Impl()->PostEvent(&noop)); + } + + return CHIP_NO_ERROR; +} + +template +void GenericPlatformManagerImpl_CMSISOS::_Shutdown(void) +{ + GenericPlatformManagerImpl::_Shutdown(); +} + +template +CHIP_ERROR GenericPlatformManagerImpl_CMSISOS::_StopEventLoopTask(void) +{ + mShouldRunEventLoop.store(false); + return CHIP_NO_ERROR; +} + +// Fully instantiate the generic implementation class in whatever compilation unit includes this file. +// NB: This must come after all templated class members are defined. +template class GenericPlatformManagerImpl_CMSISOS; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip + +#endif // GENERIC_PLATFORM_MANAGER_IMPL_CMSISOS_CPP diff --git a/src/inet/IPAddress-StringFuncts.cpp b/src/inet/IPAddress-StringFuncts.cpp index 13bbb4e0f8..7022b44a6a 100644 --- a/src/inet/IPAddress-StringFuncts.cpp +++ b/src/inet/IPAddress-StringFuncts.cpp @@ -23,6 +23,7 @@ * */ +#include #include #include #include @@ -57,8 +58,8 @@ char * IPAddress::ToString(char * buf, uint32_t bufSize) const // socklen_t is sometimes signed, sometimes not, so the only safe way to do // this is to promote everything to an unsigned type that's known to be big // enough for everything, then cast back to uint32_t after taking the min. - bufSize = - static_cast(min(static_cast(std::numeric_limits::max()), static_cast(bufSize))); + bufSize = static_cast( + std::min(static_cast(std::numeric_limits::max()), static_cast(bufSize))); #if INET_CONFIG_ENABLE_IPV4 if (IsIPv4()) { diff --git a/src/inet/InetFaultInjection.cpp b/src/inet/InetFaultInjection.cpp index faf0b42176..7b21e06c33 100644 --- a/src/inet/InetFaultInjection.cpp +++ b/src/inet/InetFaultInjection.cpp @@ -23,8 +23,6 @@ #include "InetFaultInjection.h" -#include - namespace chip { namespace Inet { namespace FaultInjection { diff --git a/src/inet/tests/TestInetLayerCommon.cpp b/src/inet/tests/TestInetLayerCommon.cpp index b1f0172bea..6f8545ba39 100644 --- a/src/inet/tests/TestInetLayerCommon.cpp +++ b/src/inet/tests/TestInetLayerCommon.cpp @@ -164,7 +164,7 @@ static PacketBufferHandle MakeDataBuffer(size_t aDesiredLength, size_t aPatternS PacketBufferHandle lBuffer = PacketBufferHandle::New(aDesiredLength); VerifyOrReturnError(!lBuffer.IsNull(), lBuffer); - aDesiredLength = min(lBuffer->MaxDataLength(), aDesiredLength); + aDesiredLength = std::min(lBuffer->MaxDataLength(), aDesiredLength); FillDataBufferPattern(lBuffer->Start(), aDesiredLength, aPatternStartOffset, aFirstValue); diff --git a/src/inet/tests/inet-layer-test-tool.cpp b/src/inet/tests/inet-layer-test-tool.cpp index 0c1158a9ed..ff0eae8941 100644 --- a/src/inet/tests/inet-layer-test-tool.cpp +++ b/src/inet/tests/inet-layer-test-tool.cpp @@ -777,7 +777,7 @@ void DriveSend() if (sTestState.mStats.mTransmit.mActual < sTestState.mStats.mTransmit.mExpected) { const uint32_t lRemaining = (sTestState.mStats.mTransmit.mExpected - sTestState.mStats.mTransmit.mActual); - const uint32_t lSendSize = chip::min(lRemaining, static_cast(gSendSize)); + const uint32_t lSendSize = std::min(lRemaining, static_cast(gSendSize)); // gSendSize is uint16_t, so this cast is safe: the value has to be // in the uint16_t range. diff --git a/src/lib/core/CHIPSafeCasts.h b/src/lib/core/CHIPSafeCasts.h index 9d189feeb6..872080415d 100644 --- a/src/lib/core/CHIPSafeCasts.h +++ b/src/lib/core/CHIPSafeCasts.h @@ -26,7 +26,6 @@ #pragma once #include -#include #include namespace chip { @@ -42,7 +41,7 @@ namespace Uint8 { */ inline uint8_t * from_uchar(unsigned char * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast unsigned char array as uint8_t array"); + static_assert(CHAR_BIT == 8, "Can't type cast unsigned char array as uint8_t array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -59,7 +58,7 @@ inline uint8_t * from_uchar(unsigned char * in) */ inline const uint8_t * from_const_uchar(const unsigned char * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast unsigned char array as uint8_t array"); + static_assert(CHAR_BIT == 8, "Can't type cast unsigned char array as uint8_t array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -76,7 +75,7 @@ inline const uint8_t * from_const_uchar(const unsigned char * in) */ inline uint8_t * from_char(char * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast char array as uint8_t array"); + static_assert(CHAR_BIT == 8, "Can't type cast char array as uint8_t array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -93,7 +92,7 @@ inline uint8_t * from_char(char * in) */ inline const uint8_t * from_const_char(const char * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast char array as uint8_t array"); + static_assert(CHAR_BIT == 8, "Can't type cast char array as uint8_t array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -110,7 +109,7 @@ inline const uint8_t * from_const_char(const char * in) */ inline unsigned char * to_uchar(uint8_t * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast uint8_t array to unsigned char array"); + static_assert(CHAR_BIT == 8, "Can't type cast uint8_t array to unsigned char array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -127,7 +126,7 @@ inline unsigned char * to_uchar(uint8_t * in) */ inline const unsigned char * to_const_uchar(const uint8_t * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast uint8_t array to unsigned char array"); + static_assert(CHAR_BIT == 8, "Can't type cast uint8_t array to unsigned char array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -144,7 +143,7 @@ inline const unsigned char * to_const_uchar(const uint8_t * in) */ inline char * to_char(uint8_t * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast uint8_t array to char array"); + static_assert(CHAR_BIT == 8, "Can't type cast uint8_t array to char array"); #ifdef __cplusplus return reinterpret_cast(in); #else @@ -161,7 +160,7 @@ inline char * to_char(uint8_t * in) */ inline const char * to_const_char(const uint8_t * in) { - nlSTATIC_ASSERT_PRINT(CHAR_BIT == 8, "Can't type cast uint8_t array to char array"); + static_assert(CHAR_BIT == 8, "Can't type cast uint8_t array to char array"); #ifdef __cplusplus return reinterpret_cast(in); #else diff --git a/src/lib/core/OTAImageHeader.cpp b/src/lib/core/OTAImageHeader.cpp index 68942d919a..ab4b65635b 100644 --- a/src/lib/core/OTAImageHeader.cpp +++ b/src/lib/core/OTAImageHeader.cpp @@ -102,7 +102,7 @@ CHIP_ERROR OTAImageHeaderParser::AccumulateAndDecode(ByteSpan & buffer, OTAImage void OTAImageHeaderParser::Append(ByteSpan & buffer, uint32_t numBytes) { - numBytes = chip::min(numBytes, static_cast(buffer.size())); + numBytes = std::min(numBytes, static_cast(buffer.size())); memcpy(&mBuffer[mBufferOffset], buffer.data(), numBytes); mBufferOffset += numBytes; buffer = buffer.SubSpan(numBytes); diff --git a/src/lib/core/tests/TestOTAImageHeader.cpp b/src/lib/core/tests/TestOTAImageHeader.cpp index bee9da3978..03bee0dbb7 100644 --- a/src/lib/core/tests/TestOTAImageHeader.cpp +++ b/src/lib/core/tests/TestOTAImageHeader.cpp @@ -167,7 +167,7 @@ TEST_F(TestOTAImageHeader, TestSmallBlocks) for (size_t offset = 0; offset < kImageSize && error == CHIP_ERROR_BUFFER_TOO_SMALL; offset += blockSize) { - ByteSpan block(&kOtaImage[offset], chip::min(kImageSize - offset, blockSize)); + ByteSpan block(&kOtaImage[offset], std::min(kImageSize - offset, blockSize)); error = parser.AccumulateAndDecode(block, header); } diff --git a/src/lib/dnssd/ServiceNaming.cpp b/src/lib/dnssd/ServiceNaming.cpp index 8ec86a1bfb..405e10a69c 100644 --- a/src/lib/dnssd/ServiceNaming.cpp +++ b/src/lib/dnssd/ServiceNaming.cpp @@ -63,7 +63,7 @@ CHIP_ERROR ExtractIdFromInstanceName(const char * name, PeerId * peerId) // Check what we have a separator where we expect. ReturnErrorCodeIf(name[fabricIdStringLength] != '-', CHIP_ERROR_WRONG_NODE_ID); - static constexpr size_t bufferSize = max(fabricIdByteLength, nodeIdByteLength); + static constexpr size_t bufferSize = std::max(fabricIdByteLength, nodeIdByteLength); uint8_t buf[bufferSize]; ReturnErrorCodeIf(Encoding::HexToBytes(name, fabricIdStringLength, buf, bufferSize) == 0, CHIP_ERROR_WRONG_NODE_ID); diff --git a/src/lib/support/BufferReader.h b/src/lib/support/BufferReader.h index f37667453e..ac9c714535 100644 --- a/src/lib/support/BufferReader.h +++ b/src/lib/support/BufferReader.h @@ -302,7 +302,7 @@ class Reader */ Reader & Skip(size_t len) { - len = ::chip::min(len, mAvailable); + len = std::min(len, mAvailable); mReadPtr += len; mAvailable = static_cast(mAvailable - len); return *this; diff --git a/src/lib/support/BytesCircularBuffer.cpp b/src/lib/support/BytesCircularBuffer.cpp index b0eba36430..89e89f1770 100644 --- a/src/lib/support/BytesCircularBuffer.cpp +++ b/src/lib/support/BytesCircularBuffer.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include diff --git a/src/lib/support/CHIPFaultInjection.cpp b/src/lib/support/CHIPFaultInjection.cpp index b7ac95eea1..8b7df7ace9 100644 --- a/src/lib/support/CHIPFaultInjection.cpp +++ b/src/lib/support/CHIPFaultInjection.cpp @@ -22,8 +22,6 @@ */ #include "CHIPFaultInjection.h" -#include - #include namespace chip { diff --git a/src/lib/support/CodeUtils.h b/src/lib/support/CodeUtils.h index fb659c4793..0142bc8544 100644 --- a/src/lib/support/CodeUtils.h +++ b/src/lib/support/CodeUtils.h @@ -131,30 +131,6 @@ #include -namespace chip { - -// Generic min() and max() functions -// -template -constexpr inline const _T & min(const _T & a, const _T & b) -{ - if (b < a) - return b; - - return a; -} - -template -constexpr inline const _T & max(const _T & a, const _T & b) -{ - if (a < b) - return b; - - return a; -} - -} // namespace chip - /** * @def ReturnErrorOnFailure(expr) * diff --git a/src/lib/support/PersistentStorageMacros.h b/src/lib/support/PersistentStorageMacros.h index 986686d9fa..91e3b61e67 100644 --- a/src/lib/support/PersistentStorageMacros.h +++ b/src/lib/support/PersistentStorageMacros.h @@ -33,10 +33,10 @@ namespace chip { do \ { \ constexpr size_t len = std::extent::value; \ - nlSTATIC_ASSERT_PRINT(len > 0, "keyPrefix length must be known at compile time"); \ + static_assert(len > 0, "keyPrefix length must be known at compile time"); \ /* 2 * sizeof(chip::NodeId) to accommodate 2 character for each byte in Node Id */ \ char key[len + 2 * sizeof(chip::NodeId) + 1]; \ - nlSTATIC_ASSERT_PRINT(sizeof(node) <= sizeof(uint64_t), "Node ID size is greater than expected"); \ + static_assert(sizeof(node) <= sizeof(uint64_t), "Node ID size is greater than expected"); \ /* Be careful about switching to ChipLogFormatX64: it would change the storage keys! */ \ snprintf(key, sizeof(key), "%s%" PRIx64, keyPrefix, node); \ action; \ diff --git a/src/lib/support/SafeString.h b/src/lib/support/SafeString.h index 4d85280804..cf75ba5563 100644 --- a/src/lib/support/SafeString.h +++ b/src/lib/support/SafeString.h @@ -23,9 +23,11 @@ #pragma once -#include +#include #include +#include + namespace chip { /** @@ -48,7 +50,7 @@ template constexpr size_t MaxStringLength(const char (&)[FirstLength], RestOfTypes &&... aArgs) { // Subtract 1 because we are not counting the null-terminator. - return max(FirstLength - 1, MaxStringLength(std::forward(aArgs)...)); + return std::max(FirstLength - 1, MaxStringLength(std::forward(aArgs)...)); } /** diff --git a/src/lib/support/ZclString.cpp b/src/lib/support/ZclString.cpp index 3482cd4303..3bbdb25179 100644 --- a/src/lib/support/ZclString.cpp +++ b/src/lib/support/ZclString.cpp @@ -34,7 +34,7 @@ CHIP_ERROR MakeZclCharString(MutableByteSpan & buffer, const char * cString) return CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG; } size_t len = strlen(cString); - size_t availableStorage = min(buffer.size() - 1, kBufferMaximumSize); + size_t availableStorage = std::min(buffer.size() - 1, kBufferMaximumSize); if (len > availableStorage) { buffer.data()[0] = 0; diff --git a/src/platform/ASR/ASRUtils.cpp b/src/platform/ASR/ASRUtils.cpp index f65c6ecb11..5095d22f62 100644 --- a/src/platform/ASR/ASRUtils.cpp +++ b/src/platform/ASR/ASRUtils.cpp @@ -235,7 +235,7 @@ CHIP_ERROR ASRUtils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & netIn netInfo.NetworkId = kWiFiStationNetworkId; netInfo.FieldPresent.NetworkId = true; memcpy(netInfo.WiFiSSID, stationConfig.wifi_ssid, - min(strlen(reinterpret_cast(stationConfig.wifi_ssid)) + 1, sizeof(netInfo.WiFiSSID))); + std::min(strlen(reinterpret_cast(stationConfig.wifi_ssid)) + 1, sizeof(netInfo.WiFiSSID))); // Enforce that netInfo wifiSSID is null terminated netInfo.WiFiSSID[kMaxWiFiSSIDLength] = '\0'; @@ -243,7 +243,7 @@ CHIP_ERROR ASRUtils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & netIn if (includeCredentials) { static_assert(sizeof(netInfo.WiFiKey) < 255, "Our min might not fit in netInfo.WiFiKeyLen"); - netInfo.WiFiKeyLen = static_cast(min(strlen((char *) stationConfig.wifi_key), sizeof(netInfo.WiFiKey))); + netInfo.WiFiKeyLen = static_cast(std::min(strlen((char *) stationConfig.wifi_key), sizeof(netInfo.WiFiKey))); memcpy(netInfo.WiFiKey, stationConfig.wifi_key, netInfo.WiFiKeyLen); } diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index d379bd0e1f..7f0b7ff87a 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -496,6 +496,8 @@ if (chip_device_platform != "none") { "../include/platform/internal/GenericDeviceInstanceInfoProvider.ipp", "../include/platform/internal/GenericPlatformManagerImpl.h", "../include/platform/internal/GenericPlatformManagerImpl.ipp", + "../include/platform/internal/GenericPlatformManagerImpl_CMSISOS.h", + "../include/platform/internal/GenericPlatformManagerImpl_CMSISOS.ipp", "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.h", "../include/platform/internal/GenericPlatformManagerImpl_FreeRTOS.ipp", "../include/platform/internal/GenericPlatformManagerImpl_POSIX.h", diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp index e6b590d09e..de8048035f 100644 --- a/src/platform/Darwin/DnssdContexts.cpp +++ b/src/platform/Darwin/DnssdContexts.cpp @@ -722,7 +722,7 @@ void ResolveContext::OnNewInterface(uint32_t interfaceId, const char * fullname, size_t len = *txtRecordIter; ++txtRecordIter; --remainingLen; - len = min(len, remainingLen); + len = std::min(len, remainingLen); chip::Span bytes(txtRecordIter, len); if (txtString.size() > 0) { diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index fc2992f20d..9be535fb61 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -260,7 +260,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** } else { - ipv6_addr_count = static_cast(min(addr_count, static_cast(kMaxIPv6AddrCount))); + ipv6_addr_count = static_cast(std::min(addr_count, static_cast(kMaxIPv6AddrCount))); } for (uint8_t idx = 0; idx < ipv6_addr_count; ++idx) { diff --git a/src/platform/ESP32/ESP32Utils.cpp b/src/platform/ESP32/ESP32Utils.cpp index ffa45ee722..e66007a0a8 100644 --- a/src/platform/ESP32/ESP32Utils.cpp +++ b/src/platform/ESP32/ESP32Utils.cpp @@ -241,7 +241,7 @@ CHIP_ERROR ESP32Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & net netInfo.NetworkId = kWiFiStationNetworkId; netInfo.FieldPresent.NetworkId = true; memcpy(netInfo.WiFiSSID, stationConfig.sta.ssid, - min(strlen(reinterpret_cast(stationConfig.sta.ssid)) + 1, sizeof(netInfo.WiFiSSID))); + std::min(strlen(reinterpret_cast(stationConfig.sta.ssid)) + 1, sizeof(netInfo.WiFiSSID))); // Enforce that netInfo wifiSSID is null terminated netInfo.WiFiSSID[kMaxWiFiSSIDLength] = '\0'; @@ -249,7 +249,7 @@ CHIP_ERROR ESP32Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & net if (includeCredentials) { static_assert(sizeof(netInfo.WiFiKey) < 255, "Our min might not fit in netInfo.WiFiKeyLen"); - netInfo.WiFiKeyLen = static_cast(min(strlen((char *) stationConfig.sta.password), sizeof(netInfo.WiFiKey))); + netInfo.WiFiKeyLen = static_cast(std::min(strlen((char *) stationConfig.sta.password), sizeof(netInfo.WiFiKey))); memcpy(netInfo.WiFiKey, stationConfig.sta.password, netInfo.WiFiKeyLen); } @@ -268,7 +268,7 @@ CHIP_ERROR ESP32Utils::SetWiFiStationProvision(const Internal::DeviceNetworkInfo ReturnErrorOnFailure(ESP32Utils::EnableStationMode()); // Enforce that wifiSSID is null terminated before copying it - memcpy(wifiSSID, netInfo.WiFiSSID, min(netInfoSSIDLen + 1, sizeof(wifiSSID))); + memcpy(wifiSSID, netInfo.WiFiSSID, std::min(netInfoSSIDLen + 1, sizeof(wifiSSID))); if (netInfoSSIDLen + 1 < sizeof(wifiSSID)) { wifiSSID[netInfoSSIDLen] = '\0'; @@ -280,8 +280,8 @@ CHIP_ERROR ESP32Utils::SetWiFiStationProvision(const Internal::DeviceNetworkInfo // Initialize an ESP wifi_config_t structure based on the new provision information. memset(&wifiConfig, 0, sizeof(wifiConfig)); - memcpy(wifiConfig.sta.ssid, wifiSSID, min(strlen(wifiSSID) + 1, sizeof(wifiConfig.sta.ssid))); - memcpy(wifiConfig.sta.password, netInfo.WiFiKey, min((size_t) netInfo.WiFiKeyLen, sizeof(wifiConfig.sta.password))); + memcpy(wifiConfig.sta.ssid, wifiSSID, std::min(strlen(wifiSSID) + 1, sizeof(wifiConfig.sta.ssid))); + memcpy(wifiConfig.sta.password, netInfo.WiFiKey, std::min((size_t) netInfo.WiFiKeyLen, sizeof(wifiConfig.sta.password))); wifiConfig.sta.scan_method = WIFI_ALL_CHANNEL_SCAN; wifiConfig.sta.sort_method = WIFI_CONNECT_AP_BY_SIGNAL; diff --git a/src/platform/ESP32/Logging.cpp b/src/platform/ESP32/Logging.cpp index e8e53aa9e6..9ad98db789 100644 --- a/src/platform/ESP32/Logging.cpp +++ b/src/platform/ESP32/Logging.cpp @@ -25,6 +25,9 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) snprintf(tag, sizeof(tag), "chip[%s]", module); tag[sizeof(tag) - 1] = 0; + // We intentionally added the printf statements to ensure we could apply colors to logs redirected to the console. + // The printf statements are not bypassing the log level, rather, they are intentionally designed to print the + // initial and later parts of the log. switch (category) { case kLogCategory_Error: { diff --git a/src/platform/FreeRTOS/SystemTimeSupport.cpp b/src/platform/FreeRTOS/SystemTimeSupport.cpp index a14c0527b4..12fa8e636d 100644 --- a/src/platform/FreeRTOS/SystemTimeSupport.cpp +++ b/src/platform/FreeRTOS/SystemTimeSupport.cpp @@ -28,6 +28,7 @@ #include #include "FreeRTOS.h" +#include "task.h" namespace chip { namespace System { diff --git a/src/platform/Infineon/PSOC6/ConnectivityManagerImpl.cpp b/src/platform/Infineon/PSOC6/ConnectivityManagerImpl.cpp index a2f7fae9f3..6d0a1907a8 100644 --- a/src/platform/Infineon/PSOC6/ConnectivityManagerImpl.cpp +++ b/src/platform/Infineon/PSOC6/ConnectivityManagerImpl.cpp @@ -229,9 +229,9 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() wifi_config_t wifiConfig; memset(&wifiConfig, 0, sizeof(wifiConfig)); memcpy(wifiConfig.sta.ssid, CHIP_DEVICE_CONFIG_DEFAULT_STA_SSID, - min(strlen(CHIP_DEVICE_CONFIG_DEFAULT_STA_SSID), sizeof(wifiConfig.sta.ssid))); + std::min(strlen(CHIP_DEVICE_CONFIG_DEFAULT_STA_SSID), sizeof(wifiConfig.sta.ssid))); memcpy(wifiConfig.sta.password, CHIP_DEVICE_CONFIG_DEFAULT_STA_PASSWORD, - min(strlen(CHIP_DEVICE_CONFIG_DEFAULT_STA_PASSWORD), sizeof(wifiConfig.sta.password))); + std::min(strlen(CHIP_DEVICE_CONFIG_DEFAULT_STA_PASSWORD), sizeof(wifiConfig.sta.password))); wifiConfig.sta.security = CHIP_DEVICE_CONFIG_DEFAULT_STA_SECURITY; err = Internal::PSOC6Utils::p6_wifi_set_config(WIFI_IF_STA, &wifiConfig); SuccessOrExit(err); diff --git a/src/platform/Infineon/PSOC6/PSOC6Utils.cpp b/src/platform/Infineon/PSOC6/PSOC6Utils.cpp index c65a29f6a9..3b1b906aa6 100644 --- a/src/platform/Infineon/PSOC6/PSOC6Utils.cpp +++ b/src/platform/Infineon/PSOC6/PSOC6Utils.cpp @@ -335,7 +335,7 @@ CHIP_ERROR PSOC6Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & net netInfo.NetworkId = kWiFiStationNetworkId; netInfo.FieldPresent.NetworkId = true; memcpy(netInfo.WiFiSSID, stationConfig.sta.ssid, - min(strlen(reinterpret_cast(stationConfig.sta.ssid)) + 1, sizeof(netInfo.WiFiSSID))); + std::min(strlen(reinterpret_cast(stationConfig.sta.ssid)) + 1, sizeof(netInfo.WiFiSSID))); // Enforce that netInfo wifiSSID is null terminated netInfo.WiFiSSID[kMaxWiFiSSIDLength] = '\0'; @@ -343,7 +343,7 @@ CHIP_ERROR PSOC6Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & net if (includeCredentials) { static_assert(sizeof(netInfo.WiFiKey) < 255, "Our min might not fit in netInfo.WiFiKeyLen"); - netInfo.WiFiKeyLen = static_cast(min(strlen((char *) stationConfig.sta.password), sizeof(netInfo.WiFiKey))); + netInfo.WiFiKeyLen = static_cast(std::min(strlen((char *) stationConfig.sta.password), sizeof(netInfo.WiFiKey))); memcpy(netInfo.WiFiKey, stationConfig.sta.password, netInfo.WiFiKeyLen); } @@ -365,7 +365,7 @@ CHIP_ERROR PSOC6Utils::SetWiFiStationProvision(const Internal::DeviceNetworkInfo SuccessOrExit(err); // Enforce that wifiSSID is null terminated before copying it - memcpy(wifiSSID, netInfo.WiFiSSID, min(netInfoSSIDLen + 1, sizeof(wifiSSID))); + memcpy(wifiSSID, netInfo.WiFiSSID, std::min(netInfoSSIDLen + 1, sizeof(wifiSSID))); if (netInfoSSIDLen + 1 < sizeof(wifiSSID)) { wifiSSID[netInfoSSIDLen] = '\0'; @@ -505,16 +505,16 @@ void PSOC6Utils::populate_wifi_config_t(wifi_config_t * wifi_config, wifi_interf if (interface == WIFI_IF_STA || interface == WIFI_IF_STA_AP) { memset(&wifi_config->sta, 0, sizeof(wifi_config_sta_t)); - memcpy(wifi_config->sta.ssid, ssid, chip::min(strlen((char *) ssid) + 1, sizeof(cy_wcm_ssid_t))); - memcpy(wifi_config->sta.password, password, chip::min(strlen((char *) password) + 1, sizeof(cy_wcm_ssid_t))); + memcpy(wifi_config->sta.ssid, ssid, std::min(strlen((char *) ssid) + 1, sizeof(cy_wcm_ssid_t))); + memcpy(wifi_config->sta.password, password, std::min(strlen((char *) password) + 1, sizeof(cy_wcm_ssid_t))); wifi_config->sta.security = security; } if (interface == WIFI_IF_AP || interface == WIFI_IF_STA_AP) { memset(&wifi_config->ap, 0, sizeof(wifi_config_ap_t)); - memcpy(wifi_config->ap.ssid, ssid, chip::min(strlen((char *) ssid) + 1, sizeof(cy_wcm_ssid_t))); - memcpy(wifi_config->ap.password, password, chip::min(strlen((char *) password) + 1, sizeof(cy_wcm_ssid_t))); + memcpy(wifi_config->ap.ssid, ssid, std::min(strlen((char *) ssid) + 1, sizeof(cy_wcm_ssid_t))); + memcpy(wifi_config->ap.password, password, std::min(strlen((char *) password) + 1, sizeof(cy_wcm_ssid_t))); wifi_config->ap.security = security; } } diff --git a/src/platform/Tizen/BLEManagerImpl.cpp b/src/platform/Tizen/BLEManagerImpl.cpp index 046d687c50..8bf2fa63ff 100644 --- a/src/platform/Tizen/BLEManagerImpl.cpp +++ b/src/platform/Tizen/BLEManagerImpl.cpp @@ -507,7 +507,7 @@ void BLEManagerImpl::OnDeviceScanned(const bt_adapter_le_device_scan_result_info /* Initiate Connect */ auto params = std::make_pair(this, scanInfo.remote_address); PlatformMgrImpl().GLibMatterContextInvokeSync( - +[](typeof(params) * aParams) { return aParams->first->ConnectChipThing(aParams->second); }, ¶ms); + +[](decltype(params) * aParams) { return aParams->first->ConnectChipThing(aParams->second); }, ¶ms); } void BLEManagerImpl::OnScanComplete() diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index afca2b43f3..510008f441 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -280,7 +280,7 @@ CHIP_ERROR AndroidConfig::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufS } outLen = static_cast(env->GetArrayLength(javaValue)); - memcpy(buf, elements, min(outLen, bufSize)); + memcpy(buf, elements, std::min(outLen, bufSize)); env->ReleaseByteArrayElements(javaValue, elements, 0); diff --git a/src/platform/mt793x/DnssdContexts.cpp b/src/platform/mt793x/DnssdContexts.cpp index c554c01916..5c0e6a0405 100644 --- a/src/platform/mt793x/DnssdContexts.cpp +++ b/src/platform/mt793x/DnssdContexts.cpp @@ -451,7 +451,7 @@ void ResolveContext::OnNewInterface(uint32_t interfaceId, const char * fullname, size_t len = *txtRecordIter; ++txtRecordIter; --remainingLen; - len = min(len, remainingLen); + len = std::min(len, remainingLen); chip::Span bytes(txtRecordIter, len); if (txtString.size() > 0) { diff --git a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h index 0c263fc6ae..c90619bddd 100644 --- a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h +++ b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h @@ -253,3 +253,8 @@ */ #define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS 10 #endif + +#ifndef NXP_USE_MML +/* Do not use Memory Manager Light for dynamic memory allocation by default. */ +#define NXP_USE_MML 0 +#endif // NXP_USE_MML diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp index dd10221748..09d8a7d266 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp @@ -42,6 +42,17 @@ extern "C" { } #endif +#if NXP_USE_MML +#include "fsl_component_mem_manager.h" +#define GetFreeHeapSize MEM_GetFreeHeapSize +#define HEAP_SIZE MinimalHeapSize_c +#define GetMinimumEverFreeHeapSize MEM_GetFreeHeapSizeLowWaterMark +#else +#define GetFreeHeapSize xPortGetFreeHeapSize +#define HEAP_SIZE configTOTAL_HEAP_SIZE +#define GetMinimumEverFreeHeapSize xPortGetMinimumEverFreeHeapSize +#endif // NXP_USE_MML + // Not implement into the SDK // extern "C" void xPortResetHeapMinimumEverFreeHeapSize(void); @@ -57,8 +68,8 @@ DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) { size_t freeHeapSize; + freeHeapSize = GetFreeHeapSize(); - freeHeapSize = xPortGetFreeHeapSize(); currentHeapFree = static_cast(freeHeapSize); return CHIP_NO_ERROR; } @@ -68,8 +79,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap size_t freeHeapSize; size_t usedHeapSize; - freeHeapSize = xPortGetFreeHeapSize(); - usedHeapSize = configTOTAL_HEAP_SIZE - freeHeapSize; + freeHeapSize = GetFreeHeapSize(); + usedHeapSize = HEAP_SIZE - freeHeapSize; currentHeapUsed = static_cast(usedHeapSize); return CHIP_NO_ERROR; @@ -79,7 +90,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu { size_t highWatermarkHeapSize; - highWatermarkHeapSize = configTOTAL_HEAP_SIZE - xPortGetMinimumEverFreeHeapSize(); + highWatermarkHeapSize = HEAP_SIZE - GetMinimumEverFreeHeapSize(); + currentHeapHighWatermark = static_cast(highWatermarkHeapSize); return CHIP_NO_ERROR; } @@ -89,12 +101,16 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() // If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the // value of the CurrentHeapUsed. +#if NXP_USE_MML + MEM_ResetFreeHeapSizeLowWaterMark(); + + return CHIP_NO_ERROR; +#else // Not implement into the SDK // xPortResetHeapMinimumEverFreeHeapSize(); - // return CHIP_NO_ERROR; - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif } CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.h b/src/platform/nxp/common/DiagnosticDataProviderImpl.h index 5b9fc4c9ae..27b2e35365 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.h +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.h @@ -39,6 +39,10 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider static DiagnosticDataProviderImpl & GetDefaultInstance(); // ===== Methods that implement the PlatformManager abstract interface. + +#if NXP_USE_MML + bool SupportsWatermarks() override { return true; } +#endif CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; diff --git a/src/platform/nxp/common/ota/OTATlvProcessor.cpp b/src/platform/nxp/common/ota/OTATlvProcessor.cpp index 66a080135b..ad41d0f42e 100644 --- a/src/platform/nxp/common/ota/OTATlvProcessor.cpp +++ b/src/platform/nxp/common/ota/OTATlvProcessor.cpp @@ -40,7 +40,7 @@ CHIP_ERROR OTATlvProcessor::ApplyAction() CHIP_ERROR OTATlvProcessor::Process(ByteSpan & block) { CHIP_ERROR status = CHIP_NO_ERROR; - uint32_t bytes = chip::min(mLength - mProcessedLength, static_cast(block.size())); + uint32_t bytes = std::min(mLength - mProcessedLength, static_cast(block.size())); ByteSpan relevantData = block.SubSpan(0, bytes); status = ProcessInternal(relevantData); @@ -96,7 +96,7 @@ void OTADataAccumulator::Clear() CHIP_ERROR OTADataAccumulator::Accumulate(ByteSpan & block) { - uint32_t numBytes = chip::min(mThreshold - mBufferOffset, static_cast(block.size())); + uint32_t numBytes = std::min(mThreshold - mBufferOffset, static_cast(block.size())); memcpy(&mBuffer[mBufferOffset], block.data(), numBytes); mBufferOffset += numBytes; block = block.SubSpan(numBytes); diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 253e21e4ef..6b399a1c1d 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -90,10 +90,15 @@ config("nxp_platform_config") { static_library("nxp_platform") { deps = [] - defines = [ "CHIP_DEVICE_K32W1=1" ] + defines = [ + "CHIP_DEVICE_K32W1=1", + "NXP_USE_MML=1", + ] sources = [ "../../SingletonConfigurationManager.cpp", + "../common/DiagnosticDataProviderImpl.cpp", + "../common/DiagnosticDataProviderImpl.h", "../common/ble/BLEManagerCommon.cpp", "../common/ble/BLEManagerCommon.h", "../common/ble/BLEManagerImpl.cpp", @@ -104,8 +109,6 @@ static_library("nxp_platform") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", - "DiagnosticDataProviderImpl.cpp", - "DiagnosticDataProviderImpl.h", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemTimeSupport.cpp", diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp index 3c1e39b041..e0ec11a747 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.cpp @@ -48,7 +48,6 @@ #include -extern "C" void HAL_ResetMCU(void); extern "C" void freertos_mbedtls_mutex_init(void); extern uint8_t __data_end__[], m_data0_end[]; @@ -93,14 +92,16 @@ CHIP_ERROR PlatformManagerImpl::ServiceInit(void) return CHIP_NO_ERROR; } -void PlatformManagerImpl::CleanReset() +void PlatformManagerImpl::Reset() { - StopEventLoopTask(); - Shutdown(); #if (CHIP_PLAT_NVM_SUPPORT == 1) NvCompletePendingOperations(); #endif - HAL_ResetMCU(); + // Restart the system. + NVIC_SystemReset(); + while (1) + { + } } void PlatformManagerImpl::ScheduleResetInIdle(void) @@ -200,6 +201,10 @@ void PlatformManagerImpl::_Shutdown() ChipLogError(DeviceLayer, "Failed to get current uptime since the Node’s last reboot"); } + /* Handle the server shutting down & emit the ShutDown event */ + /* Make sure to call this function from Matter Task */ + PlatformMgr().HandleServerShuttingDown(); + /* Shutdown all layers */ Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } diff --git a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h index 588790823c..935efaa555 100644 --- a/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h +++ b/src/platform/nxp/mcxw71_k32w1/PlatformManagerImpl.h @@ -51,7 +51,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp GetStartTime() { return mStartTime; } void HardwareInit(void); CHIP_ERROR ServiceInit(void); - void CleanReset(); + void Reset(); void StopBLEConnectivity() {} void ScheduleResetInIdle(void); bool GetResetInIdleValue(void); diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index d8c58a9368..7e86c64694 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -23,6 +23,8 @@ */ #pragma once +#include +#include // ==================== Platform Adaptations ==================== @@ -129,6 +131,10 @@ // ========== Platform-specific Configuration Overrides ========= +#ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY osPriorityHigh +#endif + #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE #if SLI_SI91X_MCU_INTERFACE #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (7 * 1024) diff --git a/src/platform/silabs/CHIPPlatformConfig.h b/src/platform/silabs/CHIPPlatformConfig.h index c6c855ee9c..c72c7fa20c 100644 --- a/src/platform/silabs/CHIPPlatformConfig.h +++ b/src/platform/silabs/CHIPPlatformConfig.h @@ -129,13 +129,13 @@ #define CHIP_SHELL_MAX_LINE_SIZE 256 #endif // CHIP_SHELL_MAX_LINE_SIZE -// ==================== FreeRTOS Configuration Overrides ==================== -#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_TASK -#define CHIP_CONFIG_FREERTOS_USE_STATIC_TASK 1 +// ==================== CMSISOS Configuration Overrides ==================== +#ifndef CHIP_CONFIG_CMSISOS_USE_STATIC_TASK +#define CHIP_CONFIG_CMSISOS_USE_STATIC_TASK 1 #endif -#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE -#define CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE 1 +#ifndef CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE +#define CHIP_CONFIG_CMSISOS_USE_STATIC_QUEUE 1 #endif #ifndef CHIP_SHELL_MAX_TOKENS diff --git a/src/platform/silabs/ConfigurationManagerImpl.cpp b/src/platform/silabs/ConfigurationManagerImpl.cpp index 122799952a..b4dd5c9c52 100644 --- a/src/platform/silabs/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/ConfigurationManagerImpl.cpp @@ -22,6 +22,7 @@ * for Silabs platforms using the Silicon Labs SDK. */ /* this file behaves like a config.h, comes first */ +#include #include #include #include @@ -304,7 +305,7 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // When called from an RPC, the following reset occurs before the RPC can respond, // which breaks tests (because it looks like the RPC hasn't successfully completed). // Block the task for 500 ms before the reset occurs to allow RPC response to be sent - vTaskDelay(pdMS_TO_TICKS(500)); + osDelay(pdMS_TO_TICKS(500)); NVIC_SystemReset(); } diff --git a/src/platform/silabs/DiagnosticDataProviderImpl.cpp b/src/platform/silabs/DiagnosticDataProviderImpl.cpp index 4be7113bb6..0cb4c85d3d 100644 --- a/src/platform/silabs/DiagnosticDataProviderImpl.cpp +++ b/src/platform/silabs/DiagnosticDataProviderImpl.cpp @@ -28,10 +28,11 @@ #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #endif -#include "FreeRTOS.h" #include "sl_memory_manager.h" +#include #include #include +#include using namespace ::chip::app::Clusters::GeneralDiagnostics; @@ -82,31 +83,24 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) { - /* Obtain all available task information */ - TaskStatus_t * taskStatusArray; ThreadMetrics * head = nullptr; - uint32_t arraySize, x, dummy; - arraySize = uxTaskGetNumberOfTasks(); + uint32_t threadCount = osThreadGetCount(); + osThreadId_t * threadIdTable = static_cast(chip::Platform::MemoryCalloc(threadCount, sizeof(osThreadId_t))); - taskStatusArray = static_cast(chip::Platform::MemoryCalloc(arraySize, sizeof(TaskStatus_t))); - - if (taskStatusArray != NULL) + if (threadIdTable != nullptr) { - /* Generate raw status information about each task. */ - arraySize = uxTaskGetSystemState(taskStatusArray, arraySize, &dummy); - /* For each populated position in the taskStatusArray array, - format the raw data as human readable ASCII data. */ - - for (x = 0; x < arraySize; x++) + osThreadEnumerate(threadIdTable, threadCount); + for (uint8_t tIdIndex = 0; tIdIndex < threadCount; tIdIndex++) { + osThreadId_t tId = threadIdTable[tIdIndex]; ThreadMetrics * thread = new ThreadMetrics(); if (thread) { - Platform::CopyString(thread->NameBuf, taskStatusArray[x].pcTaskName); + thread->id = tIdIndex; + thread->stackFreeMinimum.Emplace(osThreadGetStackSpace(tId)); + Platform::CopyString(thread->NameBuf, osThreadGetName(tId)); thread->name.Emplace(CharSpan::fromCharString(thread->NameBuf)); - thread->id = taskStatusArray[x].xTaskNumber; - thread->stackFreeMinimum.Emplace(taskStatusArray[x].usStackHighWaterMark); /* Unsupported metrics */ // thread->stackSize @@ -119,7 +113,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadM *threadMetricsOut = head; /* The array is no longer needed, free the memory it consumes. */ - chip::Platform::MemoryFree(taskStatusArray); + chip::Platform::MemoryFree(threadIdTable); } return CHIP_NO_ERROR; diff --git a/src/platform/silabs/Logging.cpp b/src/platform/silabs/Logging.cpp index 339bc8ae07..dea8913791 100644 --- a/src/platform/silabs/Logging.cpp +++ b/src/platform/silabs/Logging.cpp @@ -293,13 +293,6 @@ extern "C" void LwIPLog(const char * aFormat, ...) } PrintLog(formattedMsg); - -#if configCHECK_FOR_STACK_OVERFLOW - // Force a stack overflow check. - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - taskYIELD(); -#endif - // Let the application know that a log message has been emitted. chip::DeviceLayer::OnLogOutput(); #endif // SILABS_LOG_ENABLED @@ -348,12 +341,6 @@ extern "C" void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const ch } PrintLog(formattedMsg); - -#if configCHECK_FOR_STACK_OVERFLOW - // Force a stack overflow check. - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - taskYIELD(); -#endif } // Let the application know that a log message has been emitted. diff --git a/src/platform/silabs/MigrationManager.cpp b/src/platform/silabs/MigrationManager.cpp index f78facc938..d9bba0b249 100644 --- a/src/platform/silabs/MigrationManager.cpp +++ b/src/platform/silabs/MigrationManager.cpp @@ -57,7 +57,7 @@ void MigrationManager::applyMigrations() if (lastMigationGroupDone < migrationTable[i].migrationGroup) { (*migrationTable[i].migrationFunc)(); - completedMigrationGroup = max(migrationTable[i].migrationGroup, completedMigrationGroup); + completedMigrationGroup = std::max(migrationTable[i].migrationGroup, completedMigrationGroup); } } SilabsConfig::WriteConfigValue(SilabsConfig::kConfigKey_MigrationCounter, completedMigrationGroup); diff --git a/src/platform/silabs/PlatformManagerImpl.cpp b/src/platform/silabs/PlatformManagerImpl.cpp index 14dd4f78f2..dccb5db765 100644 --- a/src/platform/silabs/PlatformManagerImpl.cpp +++ b/src/platform/silabs/PlatformManagerImpl.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #if defined(SL_MBEDTLS_USE_TINYCRYPT) @@ -104,7 +104,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Call _InitChipStack() on the generic implementation base class // to finish the initialization process. - err = Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack(); + err = Internal::GenericPlatformManagerImpl_CMSISOS::_InitChipStack(); SuccessOrExit(err); // Start timer to increment TotalOperationalHours every hour @@ -129,9 +129,10 @@ void PlatformManagerImpl::UpdateOperationalHours(System::Layer * systemLayer, vo SystemLayer().StartTimer(System::Clock::Seconds32(kSecondsPerHour), UpdateOperationalHours, NULL); } + void PlatformManagerImpl::_Shutdown() { - Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); + Internal::GenericPlatformManagerImpl_CMSISOS::_Shutdown(); } #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION diff --git a/src/platform/silabs/PlatformManagerImpl.h b/src/platform/silabs/PlatformManagerImpl.h index 25813afb48..1abbb9f07f 100644 --- a/src/platform/silabs/PlatformManagerImpl.h +++ b/src/platform/silabs/PlatformManagerImpl.h @@ -24,7 +24,7 @@ #pragma once -#include +#include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION #include "wfx_host_events.h" #endif @@ -36,7 +36,7 @@ namespace DeviceLayer { /** * Concrete implementation of the PlatformManager singleton object for the SILABS platform. */ -class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS +class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_CMSISOS { // Allow the PlatformManager interface class to delegate method calls to // the implementation methods provided by this class. @@ -57,7 +57,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener // Allow the generic implementation base class to call helper methods on // this class. #ifndef DOXYGEN_SHOULD_SKIP_THIS - friend Internal::GenericPlatformManagerImpl_FreeRTOS; + friend Internal::GenericPlatformManagerImpl_CMSISOS; #endif public: @@ -87,8 +87,6 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener System::Clock::Timestamp mStartTime = System::Clock::kZero; static PlatformManagerImpl sInstance; - - using Internal::GenericPlatformManagerImpl_FreeRTOS::PostEventFromISR; }; /** diff --git a/src/platform/silabs/multi-ota/OTATlvProcessor.cpp b/src/platform/silabs/multi-ota/OTATlvProcessor.cpp index 91a748c077..e6601449fa 100644 --- a/src/platform/silabs/multi-ota/OTATlvProcessor.cpp +++ b/src/platform/silabs/multi-ota/OTATlvProcessor.cpp @@ -37,7 +37,7 @@ constexpr uint8_t au8Iv[] = { 0x00, 0x00, 0x00, 0x10, 0x11, 0x12, 0x13, 0x14, 0x CHIP_ERROR OTATlvProcessor::Process(ByteSpan & block) { CHIP_ERROR status = CHIP_NO_ERROR; - uint32_t bytes = chip::min(mLength - mProcessedLength, static_cast(block.size())); + uint32_t bytes = std::min(mLength - mProcessedLength, static_cast(block.size())); ByteSpan relevantData = block.SubSpan(0, bytes); status = ProcessInternal(relevantData); @@ -92,7 +92,7 @@ void OTADataAccumulator::Clear() CHIP_ERROR OTADataAccumulator::Accumulate(ByteSpan & block) { - uint32_t numBytes = chip::min(mThreshold - mBufferOffset, static_cast(block.size())); + uint32_t numBytes = std::min(mThreshold - mBufferOffset, static_cast(block.size())); memcpy(&mBuffer[mBufferOffset], block.data(), numBytes); mBufferOffset += numBytes; block = block.SubSpan(numBytes); diff --git a/src/platform/tests/TestKeyValueStoreMgr.cpp b/src/platform/tests/TestKeyValueStoreMgr.cpp index 0429182e0c..c6b87410b7 100644 --- a/src/platform/tests/TestKeyValueStoreMgr.cpp +++ b/src/platform/tests/TestKeyValueStoreMgr.cpp @@ -249,7 +249,7 @@ TEST_F(TestKeyValueStoreMgr, AllCharactersKey) for (size_t charId = 0; charId < sizeof(allChars); charId += kKeyLength) { char testKey[kKeyLength + 1] = {}; - memcpy(testKey, &allChars[charId], chip::min(sizeof(allChars) - charId, kKeyLength)); + memcpy(testKey, &allChars[charId], std::min(sizeof(allChars) - charId, kKeyLength)); CHIP_ERROR err = KeyValueStoreMgr().Put(testKey, kTestValue); EXPECT_EQ(err, CHIP_NO_ERROR); diff --git a/src/protocols/bdx/BdxTransferSession.cpp b/src/protocols/bdx/BdxTransferSession.cpp index 0a513d7ea7..89851493ba 100644 --- a/src/protocols/bdx/BdxTransferSession.cpp +++ b/src/protocols/bdx/BdxTransferSession.cpp @@ -559,8 +559,8 @@ void TransferSession::HandleTransferInit(MessageType msgType, System::PacketBuff VerifyOrReturn(err == CHIP_NO_ERROR, PrepareStatusReport(StatusCode::kBadMessageContents)); ResolveTransferControlOptions(transferInit.TransferCtlOptions); - mTransferVersion = ::chip::min(kBdxVersion, transferInit.Version); - mTransferMaxBlockSize = ::chip::min(mMaxSupportedBlockSize, transferInit.MaxBlockSize); + mTransferVersion = std::min(kBdxVersion, transferInit.Version); + mTransferMaxBlockSize = std::min(mMaxSupportedBlockSize, transferInit.MaxBlockSize); // Accept for now, they may be changed or rejected by the peer if this is a ReceiveInit mStartOffset = transferInit.StartOffset; diff --git a/src/protocols/secure_channel/PASESession.cpp b/src/protocols/secure_channel/PASESession.cpp index 6178348ad5..345b307f26 100644 --- a/src/protocols/secure_channel/PASESession.cpp +++ b/src/protocols/secure_channel/PASESession.cpp @@ -139,10 +139,7 @@ CHIP_ERROR PASESession::GeneratePASEVerifier(Spake2pVerifier & verifier, uint32_ if (useRandomPIN) { - ReturnErrorOnFailure(DRBG_get_bytes(reinterpret_cast(&setupPINCode), sizeof(setupPINCode))); - - // Passcodes shall be restricted to the values 00000001 to 99999998 in decimal, see 5.1.1.6 - setupPINCode = (setupPINCode % kSetupPINCodeMaximumValue) + 1; + ReturnErrorOnFailure(SetupPayload::generateRandomSetupPin(setupPINCode)); } return verifier.Generate(pbkdf2IterCount, salt, setupPINCode); diff --git a/src/python_testing/MinimalRepresentation.py b/src/python_testing/MinimalRepresentation.py index c99919a908..93ce543e09 100644 --- a/src/python_testing/MinimalRepresentation.py +++ b/src/python_testing/MinimalRepresentation.py @@ -17,10 +17,10 @@ from dataclasses import dataclass, field +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import uint -from conformance_support import ConformanceDecision -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TCP_Tests.py b/src/python_testing/TCP_Tests.py index 41e5c2c356..10209346a0 100644 --- a/src/python_testing/TCP_Tests.py +++ b/src/python_testing/TCP_Tests.py @@ -26,14 +26,14 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === # import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_2.py b/src/python_testing/TC_ACE_1_2.py index 7d227f5a5c..5a38120561 100644 --- a/src/python_testing/TC_ACE_1_2.py +++ b/src/python_testing/TC_ACE_1_2.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > @@ -42,7 +42,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_3.py b/src/python_testing/TC_ACE_1_3.py index 9fb5227c69..2868d9548f 100644 --- a/src/python_testing/TC_ACE_1_3.py +++ b/src/python_testing/TC_ACE_1_3.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACE_1_4.py b/src/python_testing/TC_ACE_1_4.py index 9344b0bd3e..37577b6270 100644 --- a/src/python_testing/TC_ACE_1_4.py +++ b/src/python_testing/TC_ACE_1_4.py @@ -22,31 +22,33 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true -# quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > # --storage-path admin_storage.json # --commissioning-method on-network # --discriminator 1234 # --passcode 20202021 -# --int-arg PIXIT.ACE.APPENDPOINT:1 PIXIT.ACE.APPDEVTYPEID:0x0100 -# --string-arg PIXIT.ACE.APPCLUSTER:OnOff PIXIT.ACE.APPATTRIBUTE:OnOff +# --int-arg PIXIT.ACE.APPENDPOINT:1 +# --int-arg PIXIT.ACE.APPDEVTYPEID:0x0100 +# --string-arg PIXIT.ACE.APPCLUSTER:OnOff +# --string-arg PIXIT.ACE.APPATTRIBUTE:OnOff # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import sys import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments # run with -# --int-arg PIXIT.ACE.ENDPOINT: PIXIT.ACE.APPDEVTYPE: -# --string-arg PIXIT.ACE.APPCLUSTER: PIXIT.ACE.APPATTRIBUTE: +# --int-arg PIXIT.ACE.ENDPOINT: --int-arg PIXIT.ACE.APPDEVTYPE: +# --string-arg PIXIT.ACE.APPCLUSTER: --string-arg PIXIT.ACE.APPATTRIBUTE: def str_to_cluster(str): diff --git a/src/python_testing/TC_ACE_1_5.py b/src/python_testing/TC_ACE_1_5.py index cda418737a..15c7380d23 100644 --- a/src/python_testing/TC_ACE_1_5.py +++ b/src/python_testing/TC_ACE_1_5.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > @@ -40,7 +40,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_11.py b/src/python_testing/TC_ACL_2_11.py index 88ef1d26ce..e8aa253ae7 100644 --- a/src/python_testing/TC_ACL_2_11.py +++ b/src/python_testing/TC_ACL_2_11.py @@ -22,7 +22,7 @@ # test-runner-runs: # run1: # app: ${NETWORK_MANAGEMENT_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: > # --discriminator 1234 --KVS kvs1 @@ -42,13 +42,13 @@ import queue import chip.clusters as Clusters -from basic_composition_support import arls_populated from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction, ValueDecodeFailure from chip.clusters.ClusterObjects import ALL_ACCEPTED_COMMANDS, ALL_ATTRIBUTES, ALL_CLUSTERS, ClusterEvent from chip.clusters.Objects import AccessControl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.basic_composition import arls_populated +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_ACL_2_2.py b/src/python_testing/TC_ACL_2_2.py index b0880b096b..6f5ed4760c 100644 --- a/src/python_testing/TC_ACL_2_2.py +++ b/src/python_testing/TC_ACL_2_2.py @@ -19,7 +19,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > @@ -32,7 +32,7 @@ # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_AccessChecker.py b/src/python_testing/TC_AccessChecker.py index a2429ee354..5f3b3d69ec 100644 --- a/src/python_testing/TC_AccessChecker.py +++ b/src/python_testing/TC_AccessChecker.py @@ -5,7 +5,7 @@ # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} -# factoryreset: true +# factory-reset: true # quiet: true # app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json # script-args: > @@ -23,13 +23,13 @@ from typing import Optional import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from chip.testing.spec_parsing import XmlCluster, build_xml_clusters from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) -from spec_parsing_support import XmlCluster, build_xml_clusters class AccessTestType(Enum): diff --git a/src/python_testing/TC_BOOLCFG_2_1.py b/src/python_testing/TC_BOOLCFG_2_1.py index 1eae9fc5de..2e90245f47 100644 --- a/src/python_testing/TC_BOOLCFG_2_1.py +++ b/src/python_testing/TC_BOOLCFG_2_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import functools @@ -29,7 +36,7 @@ from operator import ior import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_3_1.py b/src/python_testing/TC_BOOLCFG_3_1.py index 7446afd4b4..8ed77f6ba8 100644 --- a/src/python_testing/TC_BOOLCFG_3_1.py +++ b/src/python_testing/TC_BOOLCFG_3_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -29,7 +36,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_1.py b/src/python_testing/TC_BOOLCFG_4_1.py index 3240c27ea2..dfe6aac340 100644 --- a/src/python_testing/TC_BOOLCFG_4_1.py +++ b/src/python_testing/TC_BOOLCFG_4_1.py @@ -16,18 +16,25 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_BOOLCFG_4_2.py b/src/python_testing/TC_BOOLCFG_4_2.py index b1496c4987..093e389dcf 100644 --- a/src/python_testing/TC_BOOLCFG_4_2.py +++ b/src/python_testing/TC_BOOLCFG_4_2.py @@ -16,19 +16,31 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_3.py b/src/python_testing/TC_BOOLCFG_4_3.py index ea7ba2cac5..845d8e9d4a 100644 --- a/src/python_testing/TC_BOOLCFG_4_3.py +++ b/src/python_testing/TC_BOOLCFG_4_3.py @@ -16,19 +16,31 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_4_4.py b/src/python_testing/TC_BOOLCFG_4_4.py index 2ae6dae2c7..c585b14a84 100644 --- a/src/python_testing/TC_BOOLCFG_4_4.py +++ b/src/python_testing/TC_BOOLCFG_4_4.py @@ -16,19 +16,31 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_1.py b/src/python_testing/TC_BOOLCFG_5_1.py index f99fb3d8e4..ec31d8341b 100644 --- a/src/python_testing/TC_BOOLCFG_5_1.py +++ b/src/python_testing/TC_BOOLCFG_5_1.py @@ -16,19 +16,31 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BOOLCFG_5_2.py b/src/python_testing/TC_BOOLCFG_5_2.py index cd176faf60..fd6b88370d 100644 --- a/src/python_testing/TC_BOOLCFG_5_2.py +++ b/src/python_testing/TC_BOOLCFG_5_2.py @@ -16,19 +16,31 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --enable-key 000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --enable-key 000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg PIXIT.BOOLCFG.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts sensorTrigger = 0x0080_0000_0000_0000 diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py index 32dd541d66..f5eeec3344 100644 --- a/src/python_testing/TC_BRBINFO_4_1.py +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -15,23 +15,45 @@ # limitations under the License. # +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --string-arg th_icd_server_app_path:${LIT_ICD_APP} dut_fsa_stdin_pipe:dut-fsa-stdin +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === + # This test requires a TH_ICD_SERVER application. Please specify with --string-arg th_icd_server_app_path: # TH_ICD_SERVER must support following arguments: --secured-device-port --discriminator --passcode --KVS # E.g: python3 src/python_testing/TC_BRBINFO_4_1.py --commissioning-method on-network --qr-code MT:-24J042C00KA0648G00 \ # --string-arg th_icd_server_app_path:out/linux-x64-lit-icd/lit-icd-app +import asyncio import logging import os import queue -import signal -import subprocess -import time -import uuid +import random +import tempfile import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from chip.testing.apps import IcdAppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) @@ -40,13 +62,6 @@ class TC_BRBINFO_4_1(MatterBaseTest): - # - # Class Helper functions - # - - async def _read_attribute_expect_success(self, endpoint, cluster, attribute, node_id): - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute, node_id=node_id) - # This test has some manual steps and also multiple sleeps >= 30 seconds. Test typically runs under 3 mins, # so 6 minutes is more than enough. @property @@ -58,7 +73,7 @@ def desc_TC_BRBINFO_4_1(self) -> str: return "[TC_BRBINFO_4_1] Verification of KeepActive Command [DUT-Server]" def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: - steps = [ + return [ TestStep("0", "DUT commissioned and preconditions", is_commissioning=True), TestStep("1", "TH reads from the ICD the A_IDLE_MODE_DURATION, A_ACTIVE_MODE_DURATION, and ACTIVE_MODE_THRESHOLD attributes"), TestStep("2", "Setting up subscribe to ActiveChange event"), @@ -77,16 +92,16 @@ def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: TestStep("15", "Send KeepActive command with shortest TimeoutMs value while TH_ICD is prevented from sending check-ins"), TestStep("16", "Wait 15 seconds then send second KeepActive command with double the TimeoutMs value of the previous step"), TestStep("17", "TH allows TH_ICD to resume sending check-ins after timeout from step 15 expired but before second timeout from step 16 still valid"), - TestStep("18", "Wait for TH_ICD to check into TH, then confirm we have received new event from DUT")] - return steps + TestStep("18", "Wait for TH_ICD to check into TH, then confirm we have received new event from DUT"), + ] - def _ask_for_vendor_commissioniong_ux_operation(self, discriminator, setupPinCode, setupManualCode, setupQRCode): + def _ask_for_vendor_commissioning_ux_operation(self, discriminator, setupPinCode, setupManualCode, setupQRCode): self.wait_for_user_input( prompt_msg=f"Using the DUT vendor's provided interface, commission the ICD device using the following parameters:\n" f"- discriminator: {discriminator}\n" f"- setupPinCode: {setupPinCode}\n" f"- setupQRCode: {setupQRCode}\n" - f"- setupManualcode: {setupManualCode}\n" + f"- setupManualCode: {setupManualCode}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setupPinCode} --icd-registration true") @@ -117,81 +132,88 @@ async def _get_dynamic_endpoint(self) -> int: @async_test_body async def setup_class(self): + super().setup_class() + # These steps are not explicitly, but they help identify the dynamically added endpoint # The second part of this process happens on _get_dynamic_endpoint() - root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=_ROOT_ENDPOINT_ID) + root_part_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.PartsList, + endpoint=_ROOT_ENDPOINT_ID) self.set_of_dut_endpoints_before_adding_device = set(root_part_list) - super().setup_class() self._active_change_event_subscription = None - self.app_process = None - self.app_process_paused = False - app = self.user_params.get("th_icd_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - discriminator = 3850 - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) + self.th_icd_server = None + self.storage = None - logging.info("Starting ICD Server App") - self.app_process = subprocess.Popen(cmd) - logging.info("ICD started") - time.sleep(3) + th_icd_server_app = self.user_params.get("th_icd_server_app_path", None) + if not th_icd_server_app: + asserts.fail('This test requires a TH_ICD_SERVER app. Specify app path with --string-arg th_icd_server_app_path:') + if not os.path.exists(th_icd_server_app): + asserts.fail(f'The path {th_icd_server_app} does not exist') + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") + self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") + + self.th_icd_server_port = 5543 + self.th_icd_server_discriminator = random.randint(0, 4095) + self.th_icd_server_passcode = 20202021 + + # Start the TH_ICD_SERVER app. + self.th_icd_server = IcdAppServerSubprocess( + th_icd_server_app, + storage_dir=self.storage.name, + port=self.th_icd_server_port, + discriminator=self.th_icd_server_discriminator, + passcode=self.th_icd_server_passcode) + self.th_icd_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning of ICD to fabric one (TH)") self.icd_nodeid = 1111 self.default_controller.EnableICDRegistration(self.default_controller.GenerateICDRegistrationParameters()) - await self.default_controller.CommissionOnNetwork(nodeId=self.icd_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.default_controller.CommissionOnNetwork( + nodeId=self.icd_nodeid, + setupPinCode=self.th_icd_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_icd_server_discriminator) logging.info("Commissioning of ICD to fabric two (DUT)") params = await self.openCommissioningWindow(dev_ctrl=self.default_controller, node_id=self.icd_nodeid) - self._ask_for_vendor_commissioniong_ux_operation(params.randomDiscriminator, params.commissioningParameters.setupPinCode, - params.commissioningParameters.setupManualCode, params.commissioningParameters.setupQRCode) + if not self.is_pics_sdk_ci_only: + self._ask_for_vendor_commissioning_ux_operation( + params.randomDiscriminator, + params.commissioningParameters.setupPinCode, + params.commissioningParameters.setupManualCode, + params.commissioningParameters.setupQRCode) + else: + self.dut_fsa_stdin.write( + f"pairing onnetwork 2 {params.commissioningParameters.setupPinCode} --icd-registration true\n") + self.dut_fsa_stdin.flush() + # Wait for the commissioning to complete. + await asyncio.sleep(5) def teardown_class(self): if self._active_change_event_subscription is not None: self._active_change_event_subscription.Shutdown() self._active_change_event_subscription = None - - # In case the th_icd_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - self.resume_th_icd_server(check_state=False) - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_icd_server is not None: + self.th_icd_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() - def pause_th_icd_server(self, check_state): - if check_state: - asserts.assert_false(self.app_process_paused, "ICD TH Server unexpectedly is already paused") - if self.app_process_paused: - return - # stops (halts) the ICD server process by sending a SIGTOP signal - self.app_process.send_signal(signal.SIGSTOP.value) - self.app_process_paused = True - - def resume_th_icd_server(self, check_state): - if check_state: - asserts.assert_true(self.app_process_paused, "ICD TH Server unexpectedly is already running") - if not self.app_process_paused: - return - # resumes (continues) the ICD server process by sending a SIGCONT signal - self.app_process.send_signal(signal.SIGCONT.value) - self.app_process_paused = False - # # BRBINFO 4.1 Test Body # @@ -210,34 +232,42 @@ async def test_TC_BRBINFO_4_1(self): self.step("0") logging.info("Ensuring DUT is commissioned to TH") - # Confirms commissioning of DUT on TH as it reads its fature map - await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - basic_info_cluster, - basic_info_attributes.FeatureMap, - self.dut_node_id + # Confirms commissioning of DUT on TH as it reads its feature map + await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=basic_info_cluster, + attribute=basic_info_attributes.FeatureMap, + node_id=self.dut_node_id, ) logging.info("Ensuring ICD is commissioned to TH") self.step("1") - idle_mode_duration_s = await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - icdm_cluster, - icdm_attributes.IdleModeDuration, - self.icd_nodeid + idle_mode_duration_s = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.IdleModeDuration, + node_id=self.icd_nodeid, ) logging.info(f"IdleModeDurationS: {idle_mode_duration_s}") - active_mode_duration_ms = await self._read_attribute_expect_success( - _ROOT_ENDPOINT_ID, - icdm_cluster, - icdm_attributes.ActiveModeDuration, - self.icd_nodeid + active_mode_duration_ms = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.ActiveModeDuration, + node_id=self.icd_nodeid, ) logging.info(f"ActiveModeDurationMs: {active_mode_duration_ms}") + active_mode_threshold_ms = await self.read_single_attribute_check_success( + endpoint=_ROOT_ENDPOINT_ID, + cluster=icdm_cluster, + attribute=icdm_attributes.ActiveModeThreshold, + node_id=self.icd_nodeid, + ) + logging.info(f"ActiveModeThresholdMs: {active_mode_threshold_ms}") + self.step("2") event = brb_info_cluster.Events.ActiveChanged self.q = queue.Queue() @@ -292,7 +322,7 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "Unexpected event received from DUT") self.step("9") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() # sends 3x keep active commands stay_active_duration_ms = 2000 keep_active_timeout_ms = 60000 @@ -304,7 +334,7 @@ async def test_TC_BRBINFO_4_1(self): await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("10") - self.resume_th_icd_server(check_state=True) + self.th_icd_server.resume() await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) promised_active_duration_ms = await self._wait_for_active_changed_event(timeout_s=wait_for_dut_event_subscription_s) asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") @@ -314,14 +344,14 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "More than one event received from DUT") self.step("12") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() stay_active_duration_ms = 2000 keep_active_timeout_ms = 30000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("13") - time.sleep(30) - self.resume_th_icd_server(check_state=True) + await asyncio.sleep(30) + self.th_icd_server.resume() self.step("14") await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) @@ -329,20 +359,20 @@ async def test_TC_BRBINFO_4_1(self): asserts.assert_equal(self.q.qsize(), 0, "Unexpected event received from DUT") self.step("15") - self.pause_th_icd_server(check_state=True) + self.th_icd_server.pause() stay_active_duration_ms = 2000 keep_active_timeout_ms = 30000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("16") - time.sleep(15) + await asyncio.sleep(15) stay_active_duration_ms = 2000 keep_active_timeout_ms = 60000 await self._send_keep_active_command(stay_active_duration_ms, keep_active_timeout_ms, dynamic_endpoint_id) self.step("17") - time.sleep(15) - self.resume_th_icd_server(check_state=True) + await asyncio.sleep(15) + self.th_icd_server.resume() self.step("18") await self.default_controller.WaitForActive(self.icd_nodeid, timeoutSeconds=wait_for_icd_checkin_timeout_s, stayActiveDurationMs=5000) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index c3d67b9bf6..b3b09afad3 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -15,12 +15,20 @@ # limitations under the License. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +40,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_1.py b/src/python_testing/TC_CCTRL_2_1.py index a8aedb49ab..b656973f6a 100644 --- a/src/python_testing/TC_CCTRL_2_1.py +++ b/src/python_testing/TC_CCTRL_2_1.py @@ -15,8 +15,30 @@ # limitations under the License. # +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === + import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_cluster, run_if_endpoint_matches from mobly import asserts diff --git a/src/python_testing/TC_CCTRL_2_2.py b/src/python_testing/TC_CCTRL_2_2.py index 20a03e3bd6..a2e7b15dc2 100644 --- a/src/python_testing/TC_CCTRL_2_2.py +++ b/src/python_testing/TC_CCTRL_2_2.py @@ -18,23 +18,40 @@ # See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments # for details about the block below. # -# TODO: Skip CI for now, we don't have any way to run this. Needs setup. See test_TC_CCTRL.py +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === # This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: import logging import os import random -import signal -import subprocess +import tempfile import time -import uuid import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts @@ -43,25 +60,34 @@ class TC_CCTRL_2_2(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() - self.app_process = None - app = self.user_params.get("th_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 - discriminator = random.randint(0, 4095) - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd) - logging.info("TH_SERVER started") - time.sleep(3) + + self.th_server = None + self.storage = None + + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail("This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:") + if not os.path.exists(th_server_app): + asserts.fail(f"The path {th_server_app} does not exist") + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = 5543 + self.th_server_discriminator = random.randint(0, 4095) + self.th_server_passcode = 20202021 + + # Start the TH_SERVER app. + self.th_server = AppServerSubprocess( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_discriminator, + passcode=self.th_server_passcode) + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") @@ -71,20 +97,18 @@ async def setup_class(self): paa_path = str(self.matter_test_config.paa_trust_store_path) self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) self.server_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.TH_server_controller.CommissionOnNetwork( + nodeId=self.server_nodeid, + setupPinCode=self.th_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_server_discriminator) logging.info("Commissioning TH_SERVER complete") def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() def steps_TC_CCTRL_2_2(self) -> list[TestStep]: @@ -170,7 +194,7 @@ async def test_TC_CCTRL_2_2(self): self.step(9) cmd = Clusters.AdministratorCommissioning.Commands.RevokeCommissioning() # If no exception is raised, this is success - await self.send_single_cmd(cmd, timedRequestTimeoutMs=5000) + await self.send_single_cmd(cmd, endpoint=0, timedRequestTimeoutMs=5000) self.step(10) if not events: diff --git a/src/python_testing/TC_CCTRL_2_3.py b/src/python_testing/TC_CCTRL_2_3.py index 95bd546c8a..fe7ed3de40 100644 --- a/src/python_testing/TC_CCTRL_2_3.py +++ b/src/python_testing/TC_CCTRL_2_3.py @@ -18,23 +18,40 @@ # See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments # for details about the block below. # -# TODO: Skip CI for now, we don't have any way to run this. Needs setup. See test_TC_CCTRL.py +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: examples/fabric-admin/scripts/fabric-sync-app.py +# app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# app-ready-pattern: "Successfully opened pairing window on the device" +# script-args: > +# --PICS src/app/tests/suites/certification/ci-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 0 +# --string-arg th_server_app_path:${ALL_CLUSTERS_APP} +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === # This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: import logging import os import random -import signal -import subprocess +import tempfile import time -import uuid import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, - run_if_endpoint_matches) +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, has_cluster, + run_if_endpoint_matches) from mobly import asserts @@ -43,25 +60,34 @@ class TC_CCTRL_2_3(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() - self.app_process = None - app = self.user_params.get("th_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 - discriminator = random.randint(0, 4095) - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self.app_process = subprocess.Popen(cmd) - logging.info("TH_SERVER started") - time.sleep(3) + + self.th_server = None + self.storage = None + + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail("This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:") + if not os.path.exists(th_server_app): + asserts.fail(f"The path {th_server_app} does not exist") + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = 5543 + self.th_server_discriminator = random.randint(0, 4095) + self.th_server_passcode = 20202021 + + # Start the TH_SERVER app. + self.th_server = AppServerSubprocess( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_discriminator, + passcode=self.th_server_passcode) + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") @@ -71,20 +97,18 @@ async def setup_class(self): paa_path = str(self.matter_test_config.paa_trust_store_path) self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) self.server_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.TH_server_controller.CommissionOnNetwork( + nodeId=self.server_nodeid, + setupPinCode=self.th_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_server_discriminator) logging.info("Commissioning TH_SERVER complete") def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) - + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() def steps_TC_CCTRL_2_3(self) -> list[TestStep]: @@ -172,7 +196,7 @@ async def test_TC_CCTRL_2_3(self): await self.send_single_cmd(cmd, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, timedRequestTimeoutMs=5000) self.step(11) - time.sleep(30) + time.sleep(5 if self.is_pics_sdk_ci_only else 30) self.step(12) th_server_fabrics_new = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, fabric_filtered=False) diff --git a/src/python_testing/TC_CC_10_1.py b/src/python_testing/TC_CC_10_1.py index dee2dfad44..c2c76ecde0 100644 --- a/src/python_testing/TC_CC_10_1.py +++ b/src/python_testing/TC_CC_10_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio @@ -32,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kCCAttributeValueIDs = [0x0001, 0x0003, 0x0004, 0x0007, 0x4000, 0x4001, 0x4002, 0x4003, 0x4004] diff --git a/src/python_testing/TC_CC_2_2.py b/src/python_testing/TC_CC_2_2.py index c575ae81f5..09d9af23e8 100644 --- a/src/python_testing/TC_CC_2_2.py +++ b/src/python_testing/TC_CC_2_2.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClusterObjects -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts from test_plan_support import commission_if_required, read_attribute, verify_success diff --git a/src/python_testing/TC_CGEN_2_4.py b/src/python_testing/TC_CGEN_2_4.py index 09fbc6d593..7db0ddca28 100644 --- a/src/python_testing/TC_CGEN_2_4.py +++ b/src/python_testing/TC_CGEN_2_4.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -39,7 +46,7 @@ from chip.ChipDeviceCtrl import CommissioningParameters from chip.exceptions import ChipStackError from chip.native import PyChipError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Commissioning stage numbers - we should find a better way to match these to the C++ code diff --git a/src/python_testing/TC_CNET_1_4.py b/src/python_testing/TC_CNET_1_4.py index 58f885c9d5..2c69456e86 100644 --- a/src/python_testing/TC_CNET_1_4.py +++ b/src/python_testing/TC_CNET_1_4.py @@ -19,18 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts kRootEndpointId = 0 diff --git a/src/python_testing/TC_CNET_4_4.py b/src/python_testing/TC_CNET_4_4.py index 12407e6c5f..223cfdf588 100644 --- a/src/python_testing/TC_CNET_4_4.py +++ b/src/python_testing/TC_CNET_4_4.py @@ -22,7 +22,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_DA_1_2.py b/src/python_testing/TC_DA_1_2.py index a8b9dbf3cd..5c0b6dbf15 100644 --- a/src/python_testing/TC_DA_1_2.py +++ b/src/python_testing/TC_DA_1_2.py @@ -19,21 +19,32 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === +import logging import os import random import re import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, + type_matches) from chip.tlv import TLVReader from cryptography import x509 from cryptography.exceptions import InvalidSignature @@ -41,7 +52,6 @@ from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error @@ -382,7 +392,12 @@ async def test_TC_DA_1_2(self): if '.der' not in filename: continue with open(os.path.join(cd_cert_dir, filename), 'rb') as f: - cert = x509.load_der_x509_certificate(f.read()) + logging.info(f'Parsing CD signing certificate file: {filename}') + try: + cert = x509.load_der_x509_certificate(f.read()) + except ValueError: + logging.info(f'File {filename} is not a valid certificate, skipping') + pass pub = cert.public_key() ski = x509.SubjectKeyIdentifier.from_public_key(pub).digest certs[ski] = pub diff --git a/src/python_testing/TC_DA_1_5.py b/src/python_testing/TC_DA_1_5.py index d37f236a9f..e8e6ce773c 100644 --- a/src/python_testing/TC_DA_1_5.py +++ b/src/python_testing/TC_DA_1_5.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import random @@ -32,12 +40,12 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from chip.tlv import TLVReader from cryptography import x509 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec, utils from ecdsa.curves import curve_by_name -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, hex_from_bytes, type_matches from mobly import asserts from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.error import PyAsn1Error diff --git a/src/python_testing/TC_DA_1_7.py b/src/python_testing/TC_DA_1_7.py index be1e466002..6678080a60 100644 --- a/src/python_testing/TC_DA_1_7.py +++ b/src/python_testing/TC_DA_1_7.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --bool-arg allow_sdk_dac:true --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --bool-arg allow_sdk_dac:true +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -33,13 +41,13 @@ from typing import List, Optional import chip.clusters as Clusters +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, + hex_from_bytes) from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat from cryptography.x509 import AuthorityKeyIdentifier, Certificate, SubjectKeyIdentifier, load_der_x509_certificate -from matter_testing_support import (MatterBaseTest, TestStep, async_test_body, bytes_from_hex, default_matter_test_main, - hex_from_bytes) from mobly import asserts # Those are SDK samples that are known to be non-production. diff --git a/src/python_testing/TC_DEMTestBase.py b/src/python_testing/TC_DEMTestBase.py index da51ba2528..49c8c6a637 100644 --- a/src/python_testing/TC_DEMTestBase.py +++ b/src/python_testing/TC_DEMTestBase.py @@ -19,7 +19,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import utc_time_in_matter_epoch +from chip.testing.matter_testing import utc_time_in_matter_epoch from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index 1cad8aca0c..851099cb8e 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7e -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7e +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_1.""" @@ -34,7 +49,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_10.py b/src/python_testing/TC_DEM_2_10.py index fb837adf57..810efdbfa2 100644 --- a/src/python_testing/TC_DEM_2_10.py +++ b/src/python_testing/TC_DEM_2_10.py @@ -19,12 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7b -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7b +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_10.""" @@ -36,8 +50,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_2.py b/src/python_testing/TC_DEM_2_2.py index b180da13d2..168417dd98 100644 --- a/src/python_testing/TC_DEM_2_2.py +++ b/src/python_testing/TC_DEM_2_2.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x01 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x01 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_2.""" @@ -37,7 +52,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_3.py b/src/python_testing/TC_DEM_2_3.py index 69b44cc730..c5699c0318 100644 --- a/src/python_testing/TC_DEM_2_3.py +++ b/src/python_testing/TC_DEM_2_3.py @@ -18,12 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0xa --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0xa +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -31,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_4.py b/src/python_testing/TC_DEM_2_4.py index d611172cb9..1b591cd438 100644 --- a/src/python_testing/TC_DEM_2_4.py +++ b/src/python_testing/TC_DEM_2_4.py @@ -18,12 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x12 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x12 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +47,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_5.py b/src/python_testing/TC_DEM_2_5.py index 0a5547fd4a..c845ec1997 100644 --- a/src/python_testing/TC_DEM_2_5.py +++ b/src/python_testing/TC_DEM_2_5.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x22 --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x22 +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_5.""" @@ -34,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_6.py b/src/python_testing/TC_DEM_2_6.py index 012ff88d26..32dea4af4f 100644 --- a/src/python_testing/TC_DEM_2_6.py +++ b/src/python_testing/TC_DEM_2_6.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_6.""" @@ -34,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_7.py b/src/python_testing/TC_DEM_2_7.py index b693f6e646..44c65fbc58 100644 --- a/src/python_testing/TC_DEM_2_7.py +++ b/src/python_testing/TC_DEM_2_7.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7a --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7a +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_7.""" @@ -34,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_8.py b/src/python_testing/TC_DEM_2_8.py index a54baca2e2..016778fdf1 100644 --- a/src/python_testing/TC_DEM_2_8.py +++ b/src/python_testing/TC_DEM_2_8.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_8.""" @@ -34,7 +49,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DEM_2_9.py b/src/python_testing/TC_DEM_2_9.py index 935a04064d..05111e3b8f 100644 --- a/src/python_testing/TC_DEM_2_9.py +++ b/src/python_testing/TC_DEM_2_9.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x7c --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x7c +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === """Define Matter test case TC_DEM_2_9.""" @@ -33,7 +48,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_DEMTestBase import DEMTestBase diff --git a/src/python_testing/TC_DGGEN_2_4.py b/src/python_testing/TC_DGGEN_2_4.py index ee80d927a9..17b068452c 100644 --- a/src/python_testing/TC_DGGEN_2_4.py +++ b/src/python_testing/TC_DGGEN_2_4.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio @@ -33,8 +40,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import (MatterBaseTest, async_test_body, default_matter_test_main, matter_epoch_us_from_utc_datetime, - utc_datetime_from_matter_epoch_us, utc_datetime_from_posix_time_ms) +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, + matter_epoch_us_from_utc_datetime, utc_datetime_from_matter_epoch_us, + utc_datetime_from_posix_time_ms) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DGGEN_3_2.py b/src/python_testing/TC_DGGEN_3_2.py index 7e5af6c7a5..58c333e8b4 100644 --- a/src/python_testing/TC_DGGEN_3_2.py +++ b/src/python_testing/TC_DGGEN_3_2.py @@ -16,7 +16,7 @@ # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DGSW_2_1.py b/src/python_testing/TC_DGSW_2_1.py index c9411611e0..6338932725 100644 --- a/src/python_testing/TC_DGSW_2_1.py +++ b/src/python_testing/TC_DGSW_2_1.py @@ -19,17 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_DRLK_2_12.py b/src/python_testing/TC_DRLK_2_12.py index 3321ea303b..342fbc64f6 100644 --- a/src/python_testing/TC_DRLK_2_12.py +++ b/src/python_testing/TC_DRLK_2_12.py @@ -19,16 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index a26297d5c1..809e278517 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -18,12 +18,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -34,7 +43,7 @@ from chip.clusters.Attribute import EventPriority from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_2.py b/src/python_testing/TC_DRLK_2_2.py index 9a04e9d5fd..f9f192f18e 100644 --- a/src/python_testing/TC_DRLK_2_2.py +++ b/src/python_testing/TC_DRLK_2_2.py @@ -19,16 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_3.py b/src/python_testing/TC_DRLK_2_3.py index 3171ed28b4..114f41ab9c 100644 --- a/src/python_testing/TC_DRLK_2_3.py +++ b/src/python_testing/TC_DRLK_2_3.py @@ -19,16 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # Configurable parameters: # - userIndex: userIndex to use when creating a user on the DUT for testing purposes diff --git a/src/python_testing/TC_DRLK_2_5.py b/src/python_testing/TC_DRLK_2_5.py index a43067b05b..84451d2600 100644 --- a/src/python_testing/TC_DRLK_2_5.py +++ b/src/python_testing/TC_DRLK_2_5.py @@ -18,19 +18,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DRLK_2_9.py b/src/python_testing/TC_DRLK_2_9.py index 954ca7dd7b..fb294b724f 100644 --- a/src/python_testing/TC_DRLK_2_9.py +++ b/src/python_testing/TC_DRLK_2_9.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -33,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from drlk_2_x_common import DRLK_COMMON -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 31d8bfb76c..59182fa4e2 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -19,54 +19,73 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 run2 run3 run4 run5 run6 run7 run8 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --manual-code 10054912339 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# -# test-runner-run/run2/app: ${CHIP_LOCK_APP} -# test-runner-run/run2/factoryreset: True -# test-runner-run/run2/quiet: True -# test-runner-run/run2/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run2/script-args: --storage-path admin_storage.json --manual-code 10054912339 -# -# test-runner-run/run3/app: ${CHIP_LOCK_APP} -# test-runner-run/run3/factoryreset: True -# test-runner-run/run3/quiet: True -# test-runner-run/run3/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run3/script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 -# -# test-runner-run/run4/app: ${CHIP_LOCK_APP} -# test-runner-run/run4/factoryreset: True -# test-runner-run/run4/quiet: True -# test-runner-run/run4/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run4/script-args: --storage-path admin_storage.json --discriminator 1234 --passcode 20202021 -# -# test-runner-run/run5/app: ${CHIP_LOCK_APP} -# test-runner-run/run5/factoryreset: True -# test-runner-run/run5/quiet: True -# test-runner-run/run5/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run5/script-args: --storage-path admin_storage.json --manual-code 10054912339 --commissioning-method on-network -# -# test-runner-run/run6/app: ${CHIP_LOCK_APP} -# test-runner-run/run6/factoryreset: True -# test-runner-run/run6/quiet: True -# test-runner-run/run6/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run6/script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 --commissioning-method on-network -# -# test-runner-run/run7/app: ${CHIP_LOCK_APP} -# test-runner-run/run7/factoryreset: True -# test-runner-run/run7/quiet: True -# test-runner-run/run7/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run7/script-args: --storage-path admin_storage.json --discriminator 1234 --passcode 20202021 --commissioning-method on-network -# -# test-runner-run/run8/app: ${CHIP_LOCK_APP} -# test-runner-run/run8/factoryreset: False -# test-runner-run/run8/quiet: True -# test-runner-run/run8/app-args: --discriminator 1234 --KVS kvs1 -# test-runner-run/run8/script-args: --storage-path admin_storage.json +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true +# run2: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json --manual-code 10054912339 +# factory-reset: true +# quiet: true +# run3: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json --qr-code MT:-24J0Q1212-10648G00 +# factory-reset: true +# quiet: true +# run4: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --discriminator 1234 +# --passcode 20202021 +# factory-reset: true +# quiet: true +# run5: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run6: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --qr-code MT:-24J0Q1212-10648G00 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run7: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: > +# --storage-path admin_storage.json +# --discriminator 1234 +# --passcode 20202021 +# --commissioning-method on-network +# factory-reset: true +# quiet: true +# run8: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 +# script-args: --storage-path admin_storage.json +# factory-reset: false +# quiet: true # === END CI TEST ARGUMENTS === # Run 1: runs through all tests @@ -84,19 +103,24 @@ import chip.clusters as Clusters import chip.clusters.ClusterObjects import chip.tlv -from basic_composition_support import BasicCompositionTests from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor from chip.interaction_model import InteractionModelError, Status +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import AttributeIdType, ClusterIdType, GlobalAttributeIds, attribute_id_type, cluster_id_type +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) +from chip.testing.taglist_and_topology_test import (create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) from mobly import asserts -from taglist_and_topology_test_support import (create_device_type_list_for_root, create_device_type_lists, find_tag_list_problems, - find_tree_roots, flat_list_ok, get_direct_children_of_root, parts_list_cycles, - separate_endpoint_types) + + +def get_vendor_id(mei: int) -> int: + """Get the vendor ID portion (MEI prefix) of an overall MEI.""" + return (mei >> 16) & 0xffff def check_int_in_range(min_value: int, max_value: int, allow_null: bool = False) -> Callable: @@ -469,15 +493,17 @@ class RequiredMandatoryAttribute: cmd_prefixes = [a & 0xFFFF_0000 for a in cmd_values] bad_attrs = [a for a in attr_prefixes if a >= bad_prefix_min] bad_cmds = [a for a in cmd_prefixes if a >= bad_prefix_min] - for bad in bad_attrs: - location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad) + for bad_attrib_id in bad_attrs: + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad_attrib_id) + vendor_id = get_vendor_id(bad_attrib_id) self.record_error(self.get_test_name( - ), location=location, problem=f'Attribute with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)') + ), location=location, problem=f'Attribute 0x{bad_attrib_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}' + (' (Test Vendor)' if attribute_id_type(bad_attrib_id) == AttributeIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)') success = False - for bad in bad_cmds: - location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad) + for bad_cmd_id in bad_cmds: + location = CommandPathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, command_id=bad_cmd_id) + vendor_id = get_vendor_id(bad_cmd_id) self.record_error(self.get_test_name( - ), location=location, problem=f'Command with bad prefix {attribute_id} in cluster {cluster_id}', spec_location='Manufacturer Extensible Identifier (MEI)') + ), location=location, problem=f'Command 0x{bad_cmd_id:08x} with bad prefix 0x{vendor_id:04x} in cluster 0x{cluster_id:08x}', spec_location='Manufacturer Extensible Identifier (MEI)') success = False self.print_step(7, "Validate that none of the MEI global attribute IDs contain values outside of the allowed suffix range") @@ -520,10 +546,11 @@ class RequiredMandatoryAttribute: for endpoint_id, endpoint in self.endpoints_tlv.items(): cluster_prefixes = [a & 0xFFFF_0000 for a in endpoint.keys()] bad_clusters_ids = [a for a in cluster_prefixes if a >= bad_prefix_min] - for bad in bad_clusters_ids: - location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=bad) + for bad_cluster_id in bad_clusters_ids: + location = ClusterPathLocation(endpoint_id=endpoint_id, cluster_id=bad_cluster_id) + vendor_id = get_vendor_id(bad_cluster_id) self.record_error(self.get_test_name(), location=location, - problem=f'Bad cluster id prefix {bad}', spec_location='Manufacturer Extensible Identifier (MEI)') + problem=f'Cluster 0x{bad_cluster_id:08x} with bad prefix 0x{vendor_id:04x}' + (' (Test Vendor)' if cluster_id_type(bad_cluster_id) == ClusterIdType.kTest else ''), spec_location='Manufacturer Extensible Identifier (MEI)') success = False self.print_step(9, "Validate that all clusters in the standard range have a known cluster ID") diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index 2d03e8f326..a3e350bdfb 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -19,28 +19,36 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_LOCK_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --manual-code 10054912339 --bool-arg ignore_in_progress:True allow_provisional:True --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --tests test_TC_IDM_10_2 +# test-runner-runs: +# run1: +# app: ${CHIP_LOCK_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --manual-code 10054912339 +# --bool-arg ignore_in_progress:True allow_provisional:True +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --tests test_TC_IDM_10_2 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # TODO: Enable 10.5 in CI once the door lock OTA requestor problem is sorted. from typing import Callable import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.conformance import ConformanceDecision, conformance_allowed +from chip.testing.global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, + device_type_id_type, is_valid_device_type_id) +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) +from chip.testing.spec_parsing import CommandType, build_xml_clusters, build_xml_device_types from chip.tlv import uint -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from conformance_support import ConformanceDecision, conformance_allowed -from global_attribute_ids import (ClusterIdType, DeviceTypeIdType, GlobalAttributeIds, cluster_id_type, device_type_id_type, - is_valid_device_type_id) -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - MatterBaseTest, ProblemNotice, ProblemSeverity, async_test_body, default_matter_test_main) -from spec_parsing_support import CommandType, build_xml_clusters, build_xml_device_types class DeviceConformanceTests(BasicCompositionTests): diff --git a/src/python_testing/TC_ECOINFO_2_1.py b/src/python_testing/TC_ECOINFO_2_1.py index f3f22bb99c..a0adf75ac4 100644 --- a/src/python_testing/TC_ECOINFO_2_1.py +++ b/src/python_testing/TC_ECOINFO_2_1.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -46,10 +46,10 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.tlv import uint -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class TC_ECOINFO_2_1(MatterBaseTest): @@ -95,13 +95,15 @@ async def _setup_ci_prerequisites(self): self.th_server_passcode = 20202021 # Start the server app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) # Add some server to the DUT_FSA's Aggregator/Bridge. self.dut_fsa_stdin.write(f"pairing onnetwork 2 {self.th_server_passcode}\n") diff --git a/src/python_testing/TC_ECOINFO_2_2.py b/src/python_testing/TC_ECOINFO_2_2.py index 96fa2cd4d0..6ce1e490d5 100644 --- a/src/python_testing/TC_ECOINFO_2_2.py +++ b/src/python_testing/TC_ECOINFO_2_2.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -45,11 +45,11 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer -_DEVICE_TYPE_AGGREGGATOR = 0x000E +_DEVICE_TYPE_AGGREGATOR = 0x000E class TC_ECOINFO_2_2(MatterBaseTest): @@ -94,13 +94,15 @@ def _setup_ci_prerequisites(self): self.th_server_passcode = 20202021 # Start the server app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def steps_TC_ECOINFO_2_2(self) -> list[TestStep]: return [ @@ -147,7 +149,7 @@ async def test_TC_ECOINFO_2_2(self): device_type_list_read = await dev_ctrl.ReadAttribute(dut_node_id, [(endpoint, Clusters.Descriptor.Attributes.DeviceTypeList)]) device_type_list = device_type_list_read[endpoint][Clusters.Descriptor][Clusters.Descriptor.Attributes.DeviceTypeList] for device_type in device_type_list: - if device_type.deviceType == _DEVICE_TYPE_AGGREGGATOR: + if device_type.deviceType == _DEVICE_TYPE_AGGREGATOR: list_of_aggregator_endpoints.append(endpoint) asserts.assert_greater_equal(len(list_of_aggregator_endpoints), 1, "Did not find any Aggregator device types") diff --git a/src/python_testing/TC_EEM_2_1.py b/src/python_testing/TC_EEM_2_1.py index d5a2c07511..653bd942a9 100644 --- a/src/python_testing/TC_EEM_2_1.py +++ b/src/python_testing/TC_EEM_2_1.py @@ -18,19 +18,32 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_2.py b/src/python_testing/TC_EEM_2_2.py index fd2d5c828f..408cd85adb 100644 --- a/src/python_testing/TC_EEM_2_2.py +++ b/src/python_testing/TC_EEM_2_2.py @@ -18,17 +18,30 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_3.py b/src/python_testing/TC_EEM_2_3.py index 927ec9aea2..69a41b08e0 100644 --- a/src/python_testing/TC_EEM_2_3.py +++ b/src/python_testing/TC_EEM_2_3.py @@ -18,17 +18,30 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_4.py b/src/python_testing/TC_EEM_2_4.py index dbc89f1934..0f67fb0405 100644 --- a/src/python_testing/TC_EEM_2_4.py +++ b/src/python_testing/TC_EEM_2_4.py @@ -18,17 +18,30 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEM_2_5.py b/src/python_testing/TC_EEM_2_5.py index 95f01ebc15..43cb2cddf8 100644 --- a/src/python_testing/TC_EEM_2_5.py +++ b/src/python_testing/TC_EEM_2_5.py @@ -18,17 +18,30 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_2.py b/src/python_testing/TC_EEVSE_2_2.py index 152f08de26..144bfd82d3 100644 --- a/src/python_testing/TC_EEVSE_2_2.py +++ b/src/python_testing/TC_EEVSE_2_2.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_3.py b/src/python_testing/TC_EEVSE_2_3.py index d3c3c46ea2..eb4e43d0b5 100644 --- a/src/python_testing/TC_EEVSE_2_3.py +++ b/src/python_testing/TC_EEVSE_2_3.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +46,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EEVSE_2_4.py b/src/python_testing/TC_EEVSE_2_4.py index c7e855bf23..10355debd0 100644 --- a/src/python_testing/TC_EEVSE_2_4.py +++ b/src/python_testing/TC_EEVSE_2_4.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -31,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_5.py b/src/python_testing/TC_EEVSE_2_5.py index 5e057f7808..4571cfb363 100644 --- a/src/python_testing/TC_EEVSE_2_5.py +++ b/src/python_testing/TC_EEVSE_2_5.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -31,7 +45,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import Status -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_EEVSE_Utils import EEVSEBaseTestHelper logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_EEVSE_2_6.py b/src/python_testing/TC_EEVSE_2_6.py index 575d64cd3c..d66ff60bf6 100644 --- a/src/python_testing/TC_EEVSE_2_6.py +++ b/src/python_testing/TC_EEVSE_2_6.py @@ -18,12 +18,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -31,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, default_matter_test_main) from mobly import asserts from TC_EEVSE_Utils import EEVSEBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_1.py b/src/python_testing/TC_EPM_2_1.py index 81f0406a18..bee38aa129 100644 --- a/src/python_testing/TC_EPM_2_1.py +++ b/src/python_testing/TC_EPM_2_1.py @@ -18,18 +18,31 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EPM_2_2.py b/src/python_testing/TC_EPM_2_2.py index 1ca497f4fa..d817042753 100644 --- a/src/python_testing/TC_EPM_2_2.py +++ b/src/python_testing/TC_EPM_2_2.py @@ -18,18 +18,31 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import time -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EnergyReporting_Utils import EnergyReportingBaseTestHelper diff --git a/src/python_testing/TC_EWATERHTR_2_1.py b/src/python_testing/TC_EWATERHTR_2_1.py index e9ae195f98..82c9e93dad 100644 --- a/src/python_testing/TC_EWATERHTR_2_1.py +++ b/src/python_testing/TC_EWATERHTR_2_1.py @@ -19,18 +19,33 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x03 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_2.py b/src/python_testing/TC_EWATERHTR_2_2.py index 49c0fdc2de..1bd7185b1f 100644 --- a/src/python_testing/TC_EWATERHTR_2_2.py +++ b/src/python_testing/TC_EWATERHTR_2_2.py @@ -19,12 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x00 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x00 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === @@ -32,7 +47,7 @@ import time import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_EWATERHTR_2_3.py b/src/python_testing/TC_EWATERHTR_2_3.py index f502dfac18..0f1c3deae6 100644 --- a/src/python_testing/TC_EWATERHTR_2_3.py +++ b/src/python_testing/TC_EWATERHTR_2_3.py @@ -18,19 +18,34 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --featureSet 0x03 --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --featureSet 0x03 +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import EventChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from TC_EWATERHTRBase import EWATERHTRBase diff --git a/src/python_testing/TC_FAN_3_1.py b/src/python_testing/TC_FAN_3_1.py index 9e4477e9a2..483be894ba 100644 --- a/src/python_testing/TC_FAN_3_1.py +++ b/src/python_testing/TC_FAN_3_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_2.py b/src/python_testing/TC_FAN_3_2.py index e38706313d..799510eeea 100644 --- a/src/python_testing/TC_FAN_3_2.py +++ b/src/python_testing/TC_FAN_3_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_3.py b/src/python_testing/TC_FAN_3_3.py index a70c457aed..7a4dde3f6c 100644 --- a/src/python_testing/TC_FAN_3_3.py +++ b/src/python_testing/TC_FAN_3_3.py @@ -19,19 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_4.py b/src/python_testing/TC_FAN_3_4.py index 95a2240c4e..989680ed6b 100644 --- a/src/python_testing/TC_FAN_3_4.py +++ b/src/python_testing/TC_FAN_3_4.py @@ -19,22 +19,29 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -#import time +# import time logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_FAN_3_5.py b/src/python_testing/TC_FAN_3_5.py index a80e4b15aa..26dfc3e52f 100644 --- a/src/python_testing/TC_FAN_3_5.py +++ b/src/python_testing/TC_FAN_3_5.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +39,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index 25b7897aba..8d7f6d5ed8 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -19,19 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import re import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_1.py b/src/python_testing/TC_ICDM_3_1.py index f6f094698c..58181a6588 100644 --- a/src/python_testing/TC_ICDM_3_1.py +++ b/src/python_testing/TC_ICDM_3_1.py @@ -20,12 +20,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -33,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_2.py b/src/python_testing/TC_ICDM_3_2.py index 5a194420c3..d9800d65b7 100644 --- a/src/python_testing/TC_ICDM_3_2.py +++ b/src/python_testing/TC_ICDM_3_2.py @@ -20,12 +20,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -34,7 +42,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_3.py b/src/python_testing/TC_ICDM_3_3.py index cb8d1bd7bc..d261e53904 100644 --- a/src/python_testing/TC_ICDM_3_3.py +++ b/src/python_testing/TC_ICDM_3_3.py @@ -20,12 +20,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -33,7 +41,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_3_4.py b/src/python_testing/TC_ICDM_3_4.py index b8d0693acb..8ff2a57037 100644 --- a/src/python_testing/TC_ICDM_3_4.py +++ b/src/python_testing/TC_ICDM_3_4.py @@ -20,20 +20,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import time import chip.clusters as Clusters -from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_ICDM_5_1.py b/src/python_testing/TC_ICDM_5_1.py index f9c081b6fe..dacfe58c8b 100644 --- a/src/python_testing/TC_ICDM_5_1.py +++ b/src/python_testing/TC_ICDM_5_1.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +40,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mdns_discovery import mdns_discovery from mobly import asserts diff --git a/src/python_testing/TC_ICDManagementCluster.py b/src/python_testing/TC_ICDManagementCluster.py index 9f54e9b7dc..c0437cb809 100644 --- a/src/python_testing/TC_ICDManagementCluster.py +++ b/src/python_testing/TC_ICDManagementCluster.py @@ -18,19 +18,31 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${LIT_ICD_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${LIT_ICD_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import ctypes from enum import IntEnum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_IDM_1_2.py b/src/python_testing/TC_IDM_1_2.py index d5985c8ae9..a1db9bac83 100644 --- a/src/python_testing/TC_IDM_1_2.py +++ b/src/python_testing/TC_IDM_1_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import inspect @@ -37,7 +44,7 @@ from chip import ChipUtility from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_IDM_1_4.py b/src/python_testing/TC_IDM_1_4.py index fcfb5915ed..74194135de 100644 --- a/src/python_testing/TC_IDM_1_4.py +++ b/src/python_testing/TC_IDM_1_4.py @@ -19,12 +19,24 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --hex-arg PIXIT.DGGEN.TEST_EVENT_TRIGGER_KEY:000102030405060708090a0b0c0d0e0f +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +44,7 @@ import chip.clusters as Clusters from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts # If DUT supports `MaxPathsPerInvoke > 1`, additional command line argument diff --git a/src/python_testing/TC_IDM_4_2.py b/src/python_testing/TC_IDM_4_2.py index 8cd84011a4..0f4cd513e3 100644 --- a/src/python_testing/TC_IDM_4_2.py +++ b/src/python_testing/TC_IDM_4_2.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy @@ -37,7 +44,7 @@ from chip.clusters.Attribute import AttributePath, TypedAttributePath from chip.exceptions import ChipStackError from chip.interaction_model import Status -from matter_testing_support import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import AttributeChangeCallback, MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts ''' diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index dcb2e8d65d..d120bb7169 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,8 +41,8 @@ import chip.clusters as Clusters import test_plan_support -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, - has_cluster, run_if_endpoint_matches) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, default_matter_test_main, + has_cluster, run_if_endpoint_matches) from mobly import asserts diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 3bdee818de..995a80cd94 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -35,7 +35,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -47,29 +47,11 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl -from chip.testing.tasks import Subprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts - -class AppServer(Subprocess): - """Wrapper class for starting an application server in a subprocess.""" - - # Prefix for log messages from the application server. - PREFIX = b"[SERVER]" - - def __init__(self, app: str, storage_dir: str, discriminator: int, passcode: int, port: int = 5540): - storage_kvs_dir = tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1] - # Start the server application with dedicated KVS storage. - super().__init__(app, "--KVS", storage_kvs_dir, - '--secured-device-port', str(port), - "--discriminator", str(discriminator), - "--passcode", str(passcode), - output_cb=lambda line, is_stderr: self.PREFIX + line) - - def start(self): - # Start process and block until it prints the expected output. - super().start(expected_output="Server initialization complete") +_DEVICE_TYPE_AGGREGATOR = 0x000E class TC_MCORE_FS_1_1(MatterBaseTest): @@ -95,14 +77,16 @@ async def setup_class(self): self.th_server_discriminator = random.randint(0, 4095) self.th_server_passcode = 20202021 - # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + # Start the TH_SERVER app. + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) logging.info("Commissioning from separate fabric") # Create a second controller on a new fabric to communicate to the server @@ -142,8 +126,34 @@ def default_timeout(self) -> int: @async_test_body async def test_TC_MCORE_FS_1_1(self): - # TODO this value should either be determined or passed in from command line dut_commissioning_control_endpoint = 0 + + # Get the list of endpoints on the DUT_FSA_BRIDGE before adding the TH_SERVER_NO_UID. + dut_fsa_bridge_endpoints = set(await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.PartsList, + node_id=self.dut_node_id, + endpoint=0, + )) + + # Iterate through the endpoints on the DUT_FSA_BRIDGE + for endpoint in dut_fsa_bridge_endpoints: + # Read the DeviceTypeList attribute for the current endpoint + device_type_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.DeviceTypeList, + node_id=self.dut_node_id, + endpoint=endpoint + ) + + # Check if any of the device types is an AGGREGATOR + if any(device_type.deviceType == _DEVICE_TYPE_AGGREGATOR for device_type in device_type_list): + dut_commissioning_control_endpoint = endpoint + logging.info(f"Aggregator endpoint found: {dut_commissioning_control_endpoint}") + break + + asserts.assert_not_equal(dut_commissioning_control_endpoint, 0, "Invalid aggregator endpoint. Cannot proceed with test.") + self.step(1) self.step(2) self.step(3) diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index e1698413fa..f806db4d09 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -50,10 +50,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from ecdsa.curves import NIST256p -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -97,9 +97,11 @@ async def setup_class(self): self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) logging.info("Temporary storage directory: %s", self.storage.name) - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = th_server_port @@ -110,14 +112,16 @@ async def setup_class(self): discriminator=3840, passcode=20202021) - # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + # Start the TH_SERVER app. + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_setup_params.discriminator, passcode=self.th_server_setup_params.passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self._partslist_subscription is not None: @@ -135,7 +139,7 @@ def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamet f"- discriminator: {setup_params.discriminator}\n" f"- setupPinCode: {setup_params.passcode}\n" f"- setupQRCode: {setup_params.setup_qr_code}\n" - f"- setupManualcode: {setup_params.manual_code}\n" + f"- setupManualCode: {setup_params.manual_code}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setup_params.passcode}") diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 49dc89386c..2ac1556199 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -37,7 +37,7 @@ # --string-arg th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -50,9 +50,11 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer + +_DEVICE_TYPE_AGGREGATOR = 0x000E class TC_MCORE_FS_1_3(MatterBaseTest): @@ -84,13 +86,15 @@ def setup_class(self): self.th_server_passcode = 20202021 # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self.th_server is not None: @@ -107,7 +111,7 @@ def steps_TC_MCORE_FS_1_3(self) -> list[TestStep]: "TH verifies a value is visible for the UniqueID from the DUT_FSA's Bridged Device Basic Information Cluster."), ] - async def commission_via_commissioner_control(self, controller_node_id: int, device_node_id: int): + async def commission_via_commissioner_control(self, controller_node_id: int, device_node_id: int, endpoint_id: int): """Commission device_node_id to controller_node_id using CommissionerControl cluster.""" request_id = random.randint(0, 0xFFFFFFFFFFFFFFFF) @@ -126,6 +130,7 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev await self.send_single_cmd( node_id=controller_node_id, + endpoint=endpoint_id, cmd=Clusters.CommissionerControl.Commands.RequestCommissioningApproval( requestID=request_id, vendorID=vendor_id, @@ -138,6 +143,7 @@ async def commission_via_commissioner_control(self, controller_node_id: int, dev resp = await self.send_single_cmd( node_id=controller_node_id, + endpoint=endpoint_id, cmd=Clusters.CommissionerControl.Commands.CommissionNode( requestID=request_id, responseTimeoutSeconds=30, @@ -192,9 +198,30 @@ async def test_TC_MCORE_FS_1_3(self): endpoint=0, )) + aggregator_endpoint = 0 + + # Iterate through the endpoints on the DUT_FSA_BRIDGE + for endpoint in dut_fsa_bridge_endpoints: + # Read the DeviceTypeList attribute for the current endpoint + device_type_list = await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.DeviceTypeList, + node_id=self.dut_node_id, + endpoint=endpoint + ) + + # Check if any of the device types is an AGGREGATOR + if any(device_type.deviceType == _DEVICE_TYPE_AGGREGATOR for device_type in device_type_list): + aggregator_endpoint = endpoint + logging.info(f"Aggregator endpoint found: {aggregator_endpoint}") + break + + asserts.assert_not_equal(aggregator_endpoint, 0, "Invalid aggregator endpoint. Cannot proceed with commissioning.") + await self.commission_via_commissioner_control( controller_node_id=self.dut_node_id, - device_node_id=th_server_th_node_id) + device_node_id=th_server_th_node_id, + endpoint_id=aggregator_endpoint) # Wait for the device to appear on the DUT_FSA_BRIDGE. await asyncio.sleep(2 if self.is_pics_sdk_ci_only else 30) diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index c365b4e9b9..c8f3e764d5 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -36,7 +36,7 @@ # --string-arg th_fsa_app_path:examples/fabric-admin/scripts/fabric-sync-app.py th_fsa_admin_path:${FABRIC_ADMIN_APP} th_fsa_bridge_path:${FABRIC_BRIDGE_APP} th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -49,10 +49,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from chip.testing.tasks import Subprocess -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer class FabricSyncApp(Subprocess): @@ -94,9 +94,7 @@ def start(self): super().start(expected_output="Successfully opened pairing window on the device") def commission_on_network(self, node_id: int, setup_pin_code: int, filter_type=None, filter=None): - self.send( - f"pairing onnetwork {node_id} {setup_pin_code}", - expected_output=f"Commissioning complete for node ID {node_id:#018x}: success") + self.send(f"pairing onnetwork {node_id} {setup_pin_code}") class TC_MCORE_FS_1_4(MatterBaseTest): @@ -160,9 +158,11 @@ def setup_class(self): vendor_id=0xFFF1) self.th_fsa_controller.start() - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = 5544 @@ -170,13 +170,15 @@ def setup_class(self): self.th_server_passcode = 20202022 # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self.th_fsa_controller is not None: @@ -262,16 +264,19 @@ async def test_TC_MCORE_FS_1_4(self): filter=discriminator, ) - # Wait some time, so the dynamic endpoint will appear on the TH_FSA_BRIDGE. - await asyncio.sleep(5) - - # Get the list of endpoints on the TH_FSA_BRIDGE after adding the TH_SERVER_NO_UID. - th_fsa_bridge_endpoints_new = set(await self.read_single_attribute_check_success( - cluster=Clusters.Descriptor, - attribute=Clusters.Descriptor.Attributes.PartsList, - node_id=th_fsa_bridge_th_node_id, - endpoint=0, - )) + get_dynamic_endpoint_retries = 60 + th_fsa_bridge_endpoints_new = set(th_fsa_bridge_endpoints) + # Try to get the dynamic endpoint number for the TH_SERVER_NO_UID on the TH_FSA_BRIDGE. + while th_fsa_bridge_endpoints_new == th_fsa_bridge_endpoints and get_dynamic_endpoint_retries > 0: + await asyncio.sleep(0.5) + get_dynamic_endpoint_retries -= 1 + # Get the list of endpoints on the TH_FSA_BRIDGE. + th_fsa_bridge_endpoints_new.update(await self.read_single_attribute_check_success( + cluster=Clusters.Descriptor, + attribute=Clusters.Descriptor.Attributes.PartsList, + node_id=th_fsa_bridge_th_node_id, + endpoint=0, + )) # Get the endpoint number for just added TH_SERVER_NO_UID. logging.info("Endpoints on TH_FSA_BRIDGE: old=%s, new=%s", th_fsa_bridge_endpoints, th_fsa_bridge_endpoints_new) diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index d13d81ac84..59549fd0bc 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -33,7 +33,7 @@ # --string-arg th_server_app_path:${ALL_CLUSTERS_APP} dut_fsa_stdin_pipe:dut-fsa-stdin # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -50,10 +50,10 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl +from chip.testing.apps import AppServerSubprocess +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from ecdsa.curves import NIST256p -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -98,9 +98,11 @@ async def setup_class(self): self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) logging.info("Temporary storage directory: %s", self.storage.name) - # Get the named pipe path for the DUT_FSA app input from the user params. - dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) - if dut_fsa_stdin_pipe is not None: + if self.is_pics_sdk_ci_only: + # Get the named pipe path for the DUT_FSA app input from the user params. + dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe") + if not dut_fsa_stdin_pipe: + asserts.fail("CI setup requires --string-arg dut_fsa_stdin_pipe:") self.dut_fsa_stdin = open(dut_fsa_stdin_pipe, "w") self.th_server_port = th_server_port @@ -111,14 +113,16 @@ async def setup_class(self): discriminator=3840, passcode=20202021) - # Start the TH_SERVER_NO_UID app. - self.th_server = AppServer( + # Start the TH_SERVER app. + self.th_server = AppServerSubprocess( th_server_app, storage_dir=self.storage.name, port=self.th_server_port, discriminator=self.th_server_setup_params.discriminator, passcode=self.th_server_setup_params.passcode) - self.th_server.start() + self.th_server.start( + expected_output="Server initialization complete", + timeout=30) def teardown_class(self): if self._partslist_subscription is not None: @@ -139,7 +143,7 @@ def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamet f"- discriminator: {setup_params.discriminator}\n" f"- setupPinCode: {setup_params.passcode}\n" f"- setupQRCode: {setup_params.setup_qr_code}\n" - f"- setupManualcode: {setup_params.manual_code}\n" + f"- setupManualCode: {setup_params.manual_code}\n" f"If using FabricSync Admin test app, you may type:\n" f">>> pairing onnetwork 111 {setup_params.passcode}") diff --git a/src/python_testing/TC_MWOCTRL_2_1.py b/src/python_testing/TC_MWOCTRL_2_1.py index 0de3bee72e..6f913578cb 100644 --- a/src/python_testing/TC_MWOCTRL_2_1.py +++ b/src/python_testing/TC_MWOCTRL_2_1.py @@ -19,17 +19,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_2.py b/src/python_testing/TC_MWOCTRL_2_2.py index 0edc2ac661..4559689640 100644 --- a/src/python_testing/TC_MWOCTRL_2_2.py +++ b/src/python_testing/TC_MWOCTRL_2_2.py @@ -19,19 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOCTRL_2_4.py b/src/python_testing/TC_MWOCTRL_2_4.py index fce17c4175..e05c4a5bd5 100644 --- a/src/python_testing/TC_MWOCTRL_2_4.py +++ b/src/python_testing/TC_MWOCTRL_2_4.py @@ -19,19 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments diff --git a/src/python_testing/TC_MWOM_1_2.py b/src/python_testing/TC_MWOM_1_2.py index 7d29c3f43e..5cad6ce013 100644 --- a/src/python_testing/TC_MWOM_1_2.py +++ b/src/python_testing/TC_MWOM_1_2.py @@ -19,18 +19,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_MICROWAVE_OVEN_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_MICROWAVE_OVEN_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py index 6d135395d4..d831d486d2 100644 --- a/src/python_testing/TC_OCC_2_1.py +++ b/src/python_testing/TC_OCC_2_1.py @@ -23,18 +23,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index 9914452342..afa2e3cd61 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -19,16 +19,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py index 384f5bf63f..8d4b53f429 100644 --- a/src/python_testing/TC_OCC_2_3.py +++ b/src/python_testing/TC_OCC_2_3.py @@ -15,12 +15,21 @@ # limitations under the License. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for # the occupancy state ON/OFF change. @@ -30,7 +39,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py index cfec9a8653..cce0a2f697 100644 --- a/src/python_testing/TC_OCC_3_1.py +++ b/src/python_testing/TC_OCC_3_1.py @@ -1,203 +1,213 @@ -# -# Copyright (c) 2024 Project CHIP Authors -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true -# === END CI TEST ARGUMENTS === -# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for -# the occupancy state ON/OFF change. -# [TC-OCC-3.1] test procedure step 3, 4 -# [TC-OCC-3.2] test precedure step 3a, 3c - -import logging -import time -from typing import Any, Optional - -import chip.clusters as Clusters -from chip.interaction_model import Status -from matter_testing_support import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, - async_test_body, await_sequence_of_reports, default_matter_test_main) -from mobly import asserts - - -class TC_OCC_3_1(MatterBaseTest): - def setup_test(self): - super().setup_test() - self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) - - async def read_occ_attribute_expect_success(self, attribute): - cluster = Clusters.Objects.OccupancySensing - endpoint = self.matter_test_config.endpoint - return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) - - async def write_hold_time(self, hold_time: Optional[Any]) -> Status: - dev_ctrl = self.default_controller - node_id = self.dut_node_id - endpoint = self.matter_test_config.endpoint - - cluster = Clusters.OccupancySensing - write_result = await dev_ctrl.WriteAttribute(node_id, [(endpoint, cluster.Attributes.HoldTime(hold_time))]) - return write_result[0].Status - - def desc_TC_OCC_3_1(self) -> str: - return "[TC-OCC-3.1] Primary functionality with server as DUT" - - def steps_TC_OCC_3_1(self) -> list[TestStep]: - steps = [ - TestStep(1, "Commission DUT to TH.", is_commissioning=True), - TestStep(2, "If HoldTime is supported, TH writes HoldTime attribute to 10 sec on DUT."), - TestStep(3, "Prompt operator to await until DUT occupancy changes to unoccupied state."), - TestStep(4, "TH subscribes to Occupancy sensor attributes and events."), - TestStep("5a", "Prompt operator to trigger occupancy change."), - TestStep("5b", "TH reads Occupancy attribute from DUT. Verify occupancy changed to occupied and Occupancy attribute was reported as occupied."), - TestStep("5c", "If supported, verify OccupancyChangedEvent was reported as occupied."), - TestStep(6, "If HoldTime is supported, wait for HoldTime, otherwise prompt operator to wait until no longer occupied."), - TestStep("7a", "TH reads Occupancy attribute from DUT. Verify occupancy changed to unoccupied and Occupancy attribute was reported as unoccupied."), - TestStep("7b", "If supported, verify OccupancyChangedEvent was reported as unoccupied."), - ] - return steps - - def pics_TC_OCC_3_1(self) -> list[str]: - pics = [ - "OCC.S", - ] - return pics - - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - - @async_test_body - async def test_TC_OCC_3_1(self): - hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time - - self.step(1) # Commissioning already done - - self.step(2) - - cluster = Clusters.OccupancySensing - attributes = cluster.Attributes - attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) - - has_hold_time = attributes.HoldTime.attribute_id in attribute_list - occupancy_event_supported = self.check_pics("OCC.M.OccupancyChange") or self.is_ci - - if has_hold_time: - # write HoldTimeLimits HoldtimeMin to be 10 sec. - await self.write_single_attribute(cluster.Attributes.HoldTime(hold_time)) - holdtime_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(holdtime_dut, hold_time, "Hold time read-back does not match hold time written") - else: - logging.info("No HoldTime attribute supports. Will test only occupancy attribute triggering functionality only.") - - self.step(3) - - if self.is_ci: - # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is unoccupied state (occupancy attribute = 0)") - - # check sensor occupancy state is 0 for the next test step - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 0, "Occupancy attribute is not unoccupied.") - - self.step(4) - # Setup Occupancy attribute subscription here - endpoint_id = self.matter_test_config.endpoint - node_id = self.dut_node_id - dev_ctrl = self.default_controller - attrib_listener = ClusterAttributeChangeAccumulator(cluster) - await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - if occupancy_event_supported: - event_listener = EventChangeCallback(cluster) - await event_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - self.step("5a") - # CI call to trigger on - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') - else: - # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT - self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") - - # And then check if Occupancy attribute has changed. - self.step("5b") - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 1, "Occupancy state is not changed to 1") - - # subscription verification - post_prompt_settle_delay_seconds = 1.0 if self.is_ci else 10.0 - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 1], timeout_sec=post_prompt_settle_delay_seconds) - - if occupancy_event_supported: - self.step("5c") - event = event_listener.wait_for_event_report( - cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) - asserts.assert_equal(event.occupancy, 1, "Unexpected occupancy on OccupancyChanged") - else: - self.skip_step("5c") - - self.step(6) - if self.is_ci: - # CI call to trigger unoccupied. - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - - if has_hold_time: - time.sleep(hold_time + 2.0) # add some extra 2 seconds to ensure hold time has passed. - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is back to unoccupied state (occupancy attribute = 0)") - - # Check if Occupancy attribute is back to 0 after HoldTime attribute period - # Tester should not be triggering the sensor for this test step. - self.step("7a") - occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(occupancy_dut, 0, "Occupancy state is not back to 0 after HoldTime period") - - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 0], timeout_sec=post_prompt_settle_delay_seconds) - - if occupancy_event_supported: - self.step("7b") - event = event_listener.wait_for_event_report( - cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) - asserts.assert_equal(event.occupancy, 0, "Unexpected occupancy on OccupancyChanged") - else: - self.skip_step("7b") - - -if __name__ == "__main__": - default_matter_test_main() +# +# Copyright (c) 2024 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === +# +# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 3, 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +import logging +import time +from typing import Any, Optional + +import chip.clusters as Clusters +from chip.interaction_model import Status +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) +from mobly import asserts + + +class TC_OCC_3_1(MatterBaseTest): + def setup_test(self): + super().setup_test() + self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) + + async def read_occ_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.OccupancySensing + endpoint = self.matter_test_config.endpoint + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def write_hold_time(self, hold_time: Optional[Any]) -> Status: + dev_ctrl = self.default_controller + node_id = self.dut_node_id + endpoint = self.matter_test_config.endpoint + + cluster = Clusters.OccupancySensing + write_result = await dev_ctrl.WriteAttribute(node_id, [(endpoint, cluster.Attributes.HoldTime(hold_time))]) + return write_result[0].Status + + def desc_TC_OCC_3_1(self) -> str: + return "[TC-OCC-3.1] Primary functionality with server as DUT" + + def steps_TC_OCC_3_1(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH.", is_commissioning=True), + TestStep(2, "If HoldTime is supported, TH writes HoldTime attribute to 10 sec on DUT."), + TestStep(3, "Prompt operator to await until DUT occupancy changes to unoccupied state."), + TestStep(4, "TH subscribes to Occupancy sensor attributes and events."), + TestStep("5a", "Prompt operator to trigger occupancy change."), + TestStep("5b", "TH reads Occupancy attribute from DUT. Verify occupancy changed to occupied and Occupancy attribute was reported as occupied."), + TestStep("5c", "If supported, verify OccupancyChangedEvent was reported as occupied."), + TestStep(6, "If HoldTime is supported, wait for HoldTime, otherwise prompt operator to wait until no longer occupied."), + TestStep("7a", "TH reads Occupancy attribute from DUT. Verify occupancy changed to unoccupied and Occupancy attribute was reported as unoccupied."), + TestStep("7b", "If supported, verify OccupancyChangedEvent was reported as unoccupied."), + ] + return steps + + def pics_TC_OCC_3_1(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + # Sends and out-of-band command to the all-clusters-app + def write_to_app_pipe(self, command): + # CI app pipe id creation + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when using named pipe") + self.app_pipe = self.app_pipe + str(app_pid) + + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Delay for pipe command to be processed (otherwise tests are flaky) + time.sleep(0.001) + + @async_test_body + async def test_TC_OCC_3_1(self): + hold_time = 10 if not self.is_ci else 1.0 # 10 seconds for occupancy state hold time + + self.step(1) # Commissioning already done + + self.step(2) + + cluster = Clusters.OccupancySensing + attributes = cluster.Attributes + attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) + + has_hold_time = attributes.HoldTime.attribute_id in attribute_list + occupancy_event_supported = self.check_pics("OCC.M.OccupancyChange") or self.is_ci + + if has_hold_time: + # write HoldTimeLimits HoldtimeMin to be 10 sec. + await self.write_single_attribute(cluster.Attributes.HoldTime(hold_time)) + holdtime_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(holdtime_dut, hold_time, "Hold time read-back does not match hold time written") + else: + logging.info("No HoldTime attribute supports. Will test only occupancy attribute triggering functionality only.") + + self.step(3) + + if self.is_ci: + # CI call to trigger unoccupied. + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is unoccupied state (occupancy attribute = 0)") + + # check sensor occupancy state is 0 for the next test step + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy attribute is not unoccupied.") + + self.step(4) + # Setup Occupancy attribute subscription here + endpoint_id = self.matter_test_config.endpoint + node_id = self.dut_node_id + dev_ctrl = self.default_controller + attrib_listener = ClusterAttributeChangeAccumulator(cluster) + await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + if occupancy_event_supported: + event_listener = EventChangeCallback(cluster) + await event_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + self.step("5a") + # CI call to trigger on + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + else: + # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") + + # And then check if Occupancy attribute has changed. + self.step("5b") + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 1, "Occupancy state is not changed to 1") + + # subscription verification + post_prompt_settle_delay_seconds = 1.0 if self.is_ci else 10.0 + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 1], timeout_sec=post_prompt_settle_delay_seconds) + + if occupancy_event_supported: + self.step("5c") + event = event_listener.wait_for_event_report( + cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) + asserts.assert_equal(event.occupancy, 1, "Unexpected occupancy on OccupancyChanged") + else: + self.skip_step("5c") + + self.step(6) + if self.is_ci: + # CI call to trigger unoccupied. + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + + if has_hold_time: + time.sleep(hold_time + 2.0) # add some extra 2 seconds to ensure hold time has passed. + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is back to unoccupied state (occupancy attribute = 0)") + + # Check if Occupancy attribute is back to 0 after HoldTime attribute period + # Tester should not be triggering the sensor for this test step. + self.step("7a") + occupancy_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy state is not back to 0 after HoldTime period") + + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 0], timeout_sec=post_prompt_settle_delay_seconds) + + if occupancy_event_supported: + self.step("7b") + event = event_listener.wait_for_event_report( + cluster.Events.OccupancyChanged, timeout_sec=post_prompt_settle_delay_seconds) + asserts.assert_equal(event.occupancy, 0, "Unexpected occupancy on OccupancyChanged") + else: + self.skip_step("7b") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py index c4049104fe..3a5ca17069 100644 --- a/src/python_testing/TC_OCC_3_2.py +++ b/src/python_testing/TC_OCC_3_2.py @@ -1,198 +1,207 @@ -# -# Copyright (c) 2024 Project CHIP (Matter) 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. -# -# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments -# for details about the block below. -# -# === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --endpoint 1 --bool-arg simulate_occupancy:true -# === END CI TEST ARGUMENTS === - -# There are CI integration for the test cases below that implements manually controlling sensor device for -# the occupancy state ON/OFF change. -# [TC-OCC-3.1] test procedure step 3, 4 -# [TC-OCC-3.2] test precedure step 3a, 3c - -import logging -import time - -import chip.clusters as Clusters -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - await_sequence_of_reports, default_matter_test_main) -from mobly import asserts - - -class TC_OCC_3_2(MatterBaseTest): - def setup_test(self): - super().setup_test() - self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) - - async def read_occ_attribute_expect_success(self, attribute): - cluster = Clusters.Objects.OccupancySensing - endpoint_id = self.matter_test_config.endpoint - return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) - - def desc_TC_OCC_3_2(self) -> str: - return "[TC-OCC-3.2] Subscription Report Verification with server as DUT" - - def steps_TC_OCC_3_2(self) -> list[TestStep]: - steps = [ - TestStep(1, "Commission DUT to TH if not already done", is_commissioning=True), - TestStep(2, "TH establishes a wildcard subscription to all attributes on Occupancy Sensing Cluster on the endpoint under test. Subscription min interval = 0 and max interval = 30 seconds."), - TestStep("3a", "Prepare DUT to be unoccupied state."), - TestStep("3b", "TH reads DUT Occupancy attribute."), - TestStep("3c", "Trigger DUT to change the occupancy state."), - TestStep("3d", "TH awaits a ReportDataMessage containing an attribute report for DUT Occupancy attribute."), - TestStep("4a", "Check if DUT supports HoldTime attribute, If not supported, then stop and skip the rest of test cases."), - TestStep("4b", "TH writes HoldTimeMin to HoldTime attribute."), - TestStep("4c", "TH clears its report history and writes HoldTimeMax to HoldTime attribute."), - TestStep("4d", "TH awaits a ReportDataMessage containing an attribute report for DUT HoldTime attribute and all legacy attributes supported."), - ] - return steps - - def pics_TC_OCC_3_2(self) -> list[str]: - pics = [ - "OCC.S", - ] - return pics - - # Sends and out-of-band command to the all-clusters-app - def write_to_app_pipe(self, command): - # CI app pipe id creation - self.app_pipe = "/tmp/chip_all_clusters_fifo_" - if self.is_ci: - app_pid = self.matter_test_config.app_pid - if app_pid == 0: - asserts.fail("The --app-pid flag must be set when using named pipe") - self.app_pipe = self.app_pipe + str(app_pid) - - with open(self.app_pipe, "w") as app_pipe: - app_pipe.write(command + "\n") - # Delay for pipe command to be processed (otherwise tests are flaky) - time.sleep(0.001) - - @async_test_body - async def test_TC_OCC_3_2(self): - endpoint_id = self.matter_test_config.endpoint - node_id = self.dut_node_id - dev_ctrl = self.default_controller - - post_prompt_settle_delay_seconds = 10.0 - cluster = Clusters.Objects.OccupancySensing - attributes = cluster.Attributes - - self.step(1) # Commissioning already done - - self.step(2) - feature_map = await self.read_occ_attribute_expect_success(attribute=attributes.FeatureMap) - has_feature_pir = (feature_map & cluster.Bitmaps.Feature.kPassiveInfrared) != 0 - has_feature_ultrasonic = (feature_map & cluster.Bitmaps.Feature.kUltrasonic) != 0 - has_feature_contact = (feature_map & cluster.Bitmaps.Feature.kPhysicalContact) != 0 - - logging.info( - f"Feature map: 0x{feature_map:x}. PIR: {has_feature_pir}, US:{has_feature_ultrasonic}, PHY:{has_feature_contact}") - - attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) - has_pir_timing_attrib = attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list - has_ultrasonic_timing_attrib = attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list - has_contact_timing_attrib = attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list - logging.info(f"Attribute list: {attribute_list}") - logging.info(f"--> Has PIROccupiedToUnoccupiedDelay: {has_pir_timing_attrib}") - logging.info(f"--> Has UltrasonicOccupiedToUnoccupiedDelay: {has_ultrasonic_timing_attrib}") - logging.info(f"--> Has PhysicalContactOccupiedToUnoccupiedDelay: {has_contact_timing_attrib}") - - # min interval = 0, and max interval = 30 seconds - attrib_listener = ClusterAttributeChangeAccumulator(Clusters.Objects.OccupancySensing) - await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) - - # add Namepiped to assimilate the manual sensor untrigger here - self.step("3a") - # CI call to trigger off - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') - else: - self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") - - self.step("3b") - initial_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) - asserts.assert_equal(initial_dut, 0, "Occupancy attribute is still detected state") - - # add Namepiped to assimilate the manual sensor trigger here - self.step("3c") - attrib_listener.reset() - - # CI call to trigger on - if self.is_ci: - self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') - else: - self.wait_for_user_input( - prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") - - self.step("3d") - await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ - 1], timeout_sec=post_prompt_settle_delay_seconds) - - self.step("4a") - if attributes.HoldTime.attribute_id not in attribute_list: - logging.info("No HoldTime attribute supports. Terminate this test case") - self.skip_all_remaining_steps("4b") - - self.step("4b") - hold_time_limits_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTimeLimits) - hold_time_min = hold_time_limits_dut.holdTimeMin - hold_time_max = hold_time_limits_dut.holdTimeMax - await self.write_single_attribute(attributes.HoldTime(hold_time_min)) - hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(hold_time_dut, hold_time_min, "HoldTime did not match written HoldTimeMin") - - # HoldTime may already have been HoldTimeMin, or not. Make sure we look only at subsequent reports. - attrib_listener.reset() - - self.step("4c") - await self.write_single_attribute(attributes.HoldTime(hold_time_max)) - hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) - asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax") - - self.step("4d") - has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact)) - - expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features) - expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic - expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact - - # Build list of expectations based on attributes present. - all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)] - if expect_legacy_pir_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max)) - if expect_legacy_us_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max)) - if expect_legacy_phy_timing: - all_expected_final_values.append(AttributeValue( - endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max)) - - # Wait for the reports to come. - attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds) - - -if __name__ == "__main__": - default_matter_test_main() +# +# Copyright (c) 2024 Project CHIP (Matter) 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. +# +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --endpoint 1 +# --bool-arg simulate_occupancy:true +# factory-reset: true +# quiet: true +# === END CI TEST ARGUMENTS === + +# There are CI integration for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 3, 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +import logging +import time + +import chip.clusters as Clusters +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, + async_test_body, await_sequence_of_reports, default_matter_test_main) +from mobly import asserts + + +class TC_OCC_3_2(MatterBaseTest): + def setup_test(self): + super().setup_test() + self.is_ci = self.matter_test_config.global_test_params.get('simulate_occupancy', False) + + async def read_occ_attribute_expect_success(self, attribute): + cluster = Clusters.Objects.OccupancySensing + endpoint_id = self.matter_test_config.endpoint + return await self.read_single_attribute_check_success(endpoint=endpoint_id, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_3_2(self) -> str: + return "[TC-OCC-3.2] Subscription Report Verification with server as DUT" + + def steps_TC_OCC_3_2(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH if not already done", is_commissioning=True), + TestStep(2, "TH establishes a wildcard subscription to all attributes on Occupancy Sensing Cluster on the endpoint under test. Subscription min interval = 0 and max interval = 30 seconds."), + TestStep("3a", "Prepare DUT to be unoccupied state."), + TestStep("3b", "TH reads DUT Occupancy attribute."), + TestStep("3c", "Trigger DUT to change the occupancy state."), + TestStep("3d", "TH awaits a ReportDataMessage containing an attribute report for DUT Occupancy attribute."), + TestStep("4a", "Check if DUT supports HoldTime attribute, If not supported, then stop and skip the rest of test cases."), + TestStep("4b", "TH writes HoldTimeMin to HoldTime attribute."), + TestStep("4c", "TH clears its report history and writes HoldTimeMax to HoldTime attribute."), + TestStep("4d", "TH awaits a ReportDataMessage containing an attribute report for DUT HoldTime attribute and all legacy attributes supported."), + ] + return steps + + def pics_TC_OCC_3_2(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + # Sends and out-of-band command to the all-clusters-app + def write_to_app_pipe(self, command): + # CI app pipe id creation + self.app_pipe = "/tmp/chip_all_clusters_fifo_" + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when using named pipe") + self.app_pipe = self.app_pipe + str(app_pid) + + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Delay for pipe command to be processed (otherwise tests are flaky) + time.sleep(0.001) + + @async_test_body + async def test_TC_OCC_3_2(self): + endpoint_id = self.matter_test_config.endpoint + node_id = self.dut_node_id + dev_ctrl = self.default_controller + + post_prompt_settle_delay_seconds = 10.0 + cluster = Clusters.Objects.OccupancySensing + attributes = cluster.Attributes + + self.step(1) # Commissioning already done + + self.step(2) + feature_map = await self.read_occ_attribute_expect_success(attribute=attributes.FeatureMap) + has_feature_pir = (feature_map & cluster.Bitmaps.Feature.kPassiveInfrared) != 0 + has_feature_ultrasonic = (feature_map & cluster.Bitmaps.Feature.kUltrasonic) != 0 + has_feature_contact = (feature_map & cluster.Bitmaps.Feature.kPhysicalContact) != 0 + + logging.info( + f"Feature map: 0x{feature_map:x}. PIR: {has_feature_pir}, US:{has_feature_ultrasonic}, PHY:{has_feature_contact}") + + attribute_list = await self.read_occ_attribute_expect_success(attribute=attributes.AttributeList) + has_pir_timing_attrib = attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list + has_ultrasonic_timing_attrib = attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list + has_contact_timing_attrib = attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list + logging.info(f"Attribute list: {attribute_list}") + logging.info(f"--> Has PIROccupiedToUnoccupiedDelay: {has_pir_timing_attrib}") + logging.info(f"--> Has UltrasonicOccupiedToUnoccupiedDelay: {has_ultrasonic_timing_attrib}") + logging.info(f"--> Has PhysicalContactOccupiedToUnoccupiedDelay: {has_contact_timing_attrib}") + + # min interval = 0, and max interval = 30 seconds + attrib_listener = ClusterAttributeChangeAccumulator(Clusters.Objects.OccupancySensing) + await attrib_listener.start(dev_ctrl, node_id, endpoint=endpoint_id, min_interval_sec=0, max_interval_sec=30) + + # add Namepiped to assimilate the manual sensor untrigger here + self.step("3a") + # CI call to trigger off + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 0}') + else: + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") + + self.step("3b") + initial_dut = await self.read_occ_attribute_expect_success(attribute=attributes.Occupancy) + asserts.assert_equal(initial_dut, 0, "Occupancy attribute is still detected state") + + # add Namepiped to assimilate the manual sensor trigger here + self.step("3c") + attrib_listener.reset() + + # CI call to trigger on + if self.is_ci: + self.write_to_app_pipe('{"Name":"SetOccupancy", "EndpointId": 1, "Occupancy": 1}') + else: + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") + + self.step("3d") + await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 1], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("4a") + if attributes.HoldTime.attribute_id not in attribute_list: + logging.info("No HoldTime attribute supports. Terminate this test case") + self.skip_all_remaining_steps("4b") + + self.step("4b") + hold_time_limits_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTimeLimits) + hold_time_min = hold_time_limits_dut.holdTimeMin + hold_time_max = hold_time_limits_dut.holdTimeMax + await self.write_single_attribute(attributes.HoldTime(hold_time_min)) + hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(hold_time_dut, hold_time_min, "HoldTime did not match written HoldTimeMin") + + # HoldTime may already have been HoldTimeMin, or not. Make sure we look only at subsequent reports. + attrib_listener.reset() + + self.step("4c") + await self.write_single_attribute(attributes.HoldTime(hold_time_max)) + hold_time_dut = await self.read_occ_attribute_expect_success(attribute=attributes.HoldTime) + asserts.assert_equal(hold_time_dut, hold_time_max, "HoldTime did not match written HoldTimeMax") + + self.step("4d") + has_no_legacy_features = ((not has_feature_pir) and (not has_feature_ultrasonic) and (not has_feature_contact)) + + expect_legacy_pir_timing = has_pir_timing_attrib and (has_feature_pir or has_no_legacy_features) + expect_legacy_us_timing = has_ultrasonic_timing_attrib and has_feature_ultrasonic + expect_legacy_phy_timing = has_contact_timing_attrib and has_feature_contact + + # Build list of expectations based on attributes present. + all_expected_final_values = [AttributeValue(endpoint_id, attribute=cluster.Attributes.HoldTime, value=hold_time_max)] + if expect_legacy_pir_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, value=hold_time_max)) + if expect_legacy_us_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, value=hold_time_max)) + if expect_legacy_phy_timing: + all_expected_final_values.append(AttributeValue( + endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, value=hold_time_max)) + + # Wait for the reports to come. + attrib_listener.await_all_final_values_reported(all_expected_final_values, timeout_sec=post_prompt_settle_delay_seconds) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OPCREDS_3_1.py b/src/python_testing/TC_OPCREDS_3_1.py index dd92fd7a2f..1506d2a712 100644 --- a/src/python_testing/TC_OPCREDS_3_1.py +++ b/src/python_testing/TC_OPCREDS_3_1.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy import logging @@ -34,8 +42,8 @@ from chip import ChipDeviceCtrl from chip.exceptions import ChipStackError from chip.interaction_model import InteractionModelError, Status +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.tlv import TLVReader, TLVWriter -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_OPCREDS_3_2.py b/src/python_testing/TC_OPCREDS_3_2.py index 3eab07bc9d..2bfc214665 100644 --- a/src/python_testing/TC_OPCREDS_3_2.py +++ b/src/python_testing/TC_OPCREDS_3_2.py @@ -19,18 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from chip.tlv import TLVReader from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts from test_plan_support import (commission_from_existing, commission_if_required, read_attribute, remove_fabric, verify_commissioning_successful, verify_success) diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index c3be8a438c..060b71d85e 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -19,16 +19,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index 09e4c65918..f0ed8f214d 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -19,16 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index b9a62b275c..d35aa6e61e 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index 512802467f..ec2c7c17da 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.OPSTATE.ErrorEventGen:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.OPSTATE.ErrorEventGen:1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index ad79765e88..89a2462a2b 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py index d13f8a1e7e..0b9e1ec3bb 100644 --- a/src/python_testing/TC_OPSTATE_2_6.py +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index 1d1a289080..d830a416c0 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -19,17 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index 254464eaa6..55afad11be 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -19,16 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index 77d4358788..329bceb1fb 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -19,16 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.COUNTDOWN:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index 70a3a6f020..ffc639390e 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -19,16 +19,26 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.OVENOPSTATE.ErrorEventGen:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.OVENOPSTATE.ErrorEventGen:1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 39edb670ff..42edca72f3 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OVENOPSTATE_2_6.py b/src/python_testing/TC_OVENOPSTATE_2_6.py index 09436f4e76..2770625bb7 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_6.py +++ b/src/python_testing/TC_OVENOPSTATE_2_6.py @@ -19,17 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --int-arg PIXIT.WAITTIME.REBOOT:5 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS src/app/tests/suites/certification/ci-pics-values +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index c697c7ab5f..557b7606cc 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -27,7 +27,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep +from chip.testing.matter_testing import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts diff --git a/src/python_testing/TC_PS_2_3.py b/src/python_testing/TC_PS_2_3.py index 72b54877dc..13f4420b0a 100644 --- a/src/python_testing/TC_PS_2_3.py +++ b/src/python_testing/TC_PS_2_3.py @@ -19,20 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import time import chip.clusters as Clusters -from matter_testing_support import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, - default_matter_test_main) +from chip.testing.matter_testing import (ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) from mobly import asserts diff --git a/src/python_testing/TC_PWRTL_2_1.py b/src/python_testing/TC_PWRTL_2_1.py index 579398642a..3de09c6e93 100644 --- a/src/python_testing/TC_PWRTL_2_1.py +++ b/src/python_testing/TC_PWRTL_2_1.py @@ -19,18 +19,25 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RR_1_1.py b/src/python_testing/TC_RR_1_1.py index 0cb53a4fb4..0cbf0274c5 100644 --- a/src/python_testing/TC_RR_1_1.py +++ b/src/python_testing/TC_RR_1_1.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import asyncio @@ -38,8 +45,8 @@ import chip.clusters as Clusters from chip.interaction_model import Status as StatusEnum +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts from TC_SC_3_6 import AttributeChangeAccumulator, ResubscriptionCatcher diff --git a/src/python_testing/TC_RVCCLEANM_1_2.py b/src/python_testing/TC_RVCCLEANM_1_2.py index d1b3018772..3dfd75f4f4 100644 --- a/src/python_testing/TC_RVCCLEANM_1_2.py +++ b/src/python_testing/TC_RVCCLEANM_1_2.py @@ -19,18 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index 8e5013ad4c..5234a74685 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -19,23 +19,34 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 PIXIT.RVCCLEANM.MODE_CHANGE_OK:2 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK:2 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments # run with -# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK: PIXIT.RVCCLEANM.MODE_CHANGE_FAIL: +# --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_OK: --int-arg PIXIT.RVCCLEANM.MODE_CHANGE_FAIL: class TC_RVCCLEANM_2_1(MatterBaseTest): diff --git a/src/python_testing/TC_RVCCLEANM_2_2.py b/src/python_testing/TC_RVCCLEANM_2_2.py index ed63dd09c3..7352d03e24 100644 --- a/src/python_testing/TC_RVCCLEANM_2_2.py +++ b/src/python_testing/TC_RVCCLEANM_2_2.py @@ -19,18 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_1.py b/src/python_testing/TC_RVCOPSTATE_2_1.py index b15fc92743..48715c3b7a 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_1.py +++ b/src/python_testing/TC_RVCOPSTATE_2_1.py @@ -19,19 +19,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_3.py b/src/python_testing/TC_RVCOPSTATE_2_3.py index e9dc801cc1..1b522117b9 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_3.py +++ b/src/python_testing/TC_RVCOPSTATE_2_3.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -32,7 +41,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCOPSTATE_2_4.py b/src/python_testing/TC_RVCOPSTATE_2_4.py index c7186a80ee..ad515dbff1 100644 --- a/src/python_testing/TC_RVCOPSTATE_2_4.py +++ b/src/python_testing/TC_RVCOPSTATE_2_4.py @@ -19,18 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_1_2.py b/src/python_testing/TC_RVCRUNM_1_2.py index 308e79ab26..90db1601b1 100644 --- a/src/python_testing/TC_RVCRUNM_1_2.py +++ b/src/python_testing/TC_RVCRUNM_1_2.py @@ -19,18 +19,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index 2693cb041a..55c37c7094 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -19,23 +19,34 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK:0 PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK:0 +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts # This test requires several additional command line arguments # run with -# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK: PIXIT.RVCRUNM.MODE_CHANGE_FAIL: +# --int-arg PIXIT.RVCRUNM.MODE_CHANGE_OK: --int-arg PIXIT.RVCRUNM.MODE_CHANGE_FAIL: # For running in CI, it is expected that OK=0 and FAIL=2 diff --git a/src/python_testing/TC_RVCRUNM_2_2.py b/src/python_testing/TC_RVCRUNM_2_2.py index 3a2ce23ea2..e78d6d7f42 100644 --- a/src/python_testing/TC_RVCRUNM_2_2.py +++ b/src/python_testing/TC_RVCRUNM_2_2.py @@ -19,23 +19,34 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --int-arg PIXIT.RVCRUNM.MODE_A:1 PIXIT.RVCRUNM.MODE_B:2 +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --int-arg PIXIT.RVCRUNM.MODE_A:1 +# --int-arg PIXIT.RVCRUNM.MODE_B:2 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import enum import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # This test requires several additional command line arguments. # Run the test with -# --int-arg PIXIT.RVCRUNM.MODE_A: PIXIT.RVCRUNM.MODE_B: +# --int-arg PIXIT.RVCRUNM.MODE_A: --int-arg PIXIT.RVCRUNM.MODE_B: class RvcStatusEnum(enum.IntEnum): diff --git a/src/python_testing/TC_SC_3_6.py b/src/python_testing/TC_SC_3_6.py index 53353ea85f..8cfbee8e46 100644 --- a/src/python_testing/TC_SC_3_6.py +++ b/src/python_testing/TC_SC_3_6.py @@ -19,12 +19,19 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === @@ -38,8 +45,8 @@ import chip.clusters as Clusters from chip.clusters import ClusterObjects as ClustersObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from chip.utils import CommissioningBuildingBlocks -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # TODO: Overall, we need to add validation that session IDs have not changed throughout to be agnostic diff --git a/src/python_testing/TC_SC_7_1.py b/src/python_testing/TC_SC_7_1.py index b702bf438f..42ad785843 100644 --- a/src/python_testing/TC_SC_7_1.py +++ b/src/python_testing/TC_SC_7_1.py @@ -19,12 +19,18 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 2222 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --bool-arg post_cert_test:true --qr-code MT:-24J0KCZ16750648G00 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 2222 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --bool-arg post_cert_test:true +# --qr-code MT:-24J0KCZ16750648G00 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # Note that in the CI we are using the post-cert test as we can only start one app from the current script. @@ -32,7 +38,7 @@ import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py index 1bed2c8d12..41773804e4 100644 --- a/src/python_testing/TC_SEAR_1_2.py +++ b/src/python_testing/TC_SEAR_1_2.py @@ -20,19 +20,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py index df4a1ddb51..2c2b85a13c 100644 --- a/src/python_testing/TC_SEAR_1_3.py +++ b/src/python_testing/TC_SEAR_1_3.py @@ -20,18 +20,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]' --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --json-arg PIXIT.SEAR.VALID_AREAS:'[7, 1234567]' +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py index d31dcc2b13..cf53f446f9 100644 --- a/src/python_testing/TC_SEAR_1_4.py +++ b/src/python_testing/TC_SEAR_1_4.py @@ -20,18 +20,27 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py index d4704d686a..130ccb8d59 100644 --- a/src/python_testing/TC_SEAR_1_5.py +++ b/src/python_testing/TC_SEAR_1_5.py @@ -20,19 +20,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py index 8e94971c8b..dc6188a14e 100644 --- a/src/python_testing/TC_SEAR_1_6.py +++ b/src/python_testing/TC_SEAR_1_6.py @@ -20,19 +20,28 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${CHIP_RVC_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${CHIP_RVC_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 4609043a3e..fe55013452 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -18,32 +18,63 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 run2 run3 run4 -# -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run2/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run2/factoryreset: True -# test-runner-run/run2/quiet: True -# test-runner-run/run2/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run2/script-args: --endpoint 2 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run3/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run3/factoryreset: True -# test-runner-run/run3/quiet: True -# test-runner-run/run3/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run3/script-args: --endpoint 3 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# -# test-runner-run/run4/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run4/factoryreset: True -# test-runner-run/run4/quiet: True -# test-runner-run/run4/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run4/script-args: --endpoint 4 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values -# +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 1 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run2: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 2 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run3: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 3 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true +# run4: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 4 +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# --PICS src/app/tests/suites/certification/ci-pics-values +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === # # These tests run on every endpoint regardless of whether a switch is present because they are set up to auto-select. @@ -59,10 +90,10 @@ import test_plan_support from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import EventReadResult +from chip.testing.matter_testing import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, + TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, + run_if_endpoint_matches) from chip.tlv import uint -from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, EventChangeCallback, MatterBaseTest, - TestStep, await_sequence_of_reports, default_matter_test_main, has_feature, - run_if_endpoint_matches) from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TIMESYNC_2_1.py b/src/python_testing/TC_TIMESYNC_2_1.py index 0f2fdba4d6..cb2df9d66a 100644 --- a/src/python_testing/TC_TIMESYNC_2_1.py +++ b/src/python_testing/TC_TIMESYNC_2_1.py @@ -19,12 +19,21 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --endpoint 0 --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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --endpoint 0 +# --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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import ipaddress @@ -32,8 +41,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, run_if_endpoint_matches, - utc_time_in_matter_epoch) +from chip.testing.matter_testing import (MatterBaseTest, default_matter_test_main, has_attribute, has_cluster, + run_if_endpoint_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_10.py b/src/python_testing/TC_TIMESYNC_2_10.py index c7eb9860b9..99ca9f3ac0 100644 --- a/src/python_testing/TC_TIMESYNC_2_10.py +++ b/src/python_testing/TC_TIMESYNC_2_10.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue @@ -35,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_11.py b/src/python_testing/TC_TIMESYNC_2_11.py index 5815baeaca..0865bc87f4 100644 --- a/src/python_testing/TC_TIMESYNC_2_11.py +++ b/src/python_testing/TC_TIMESYNC_2_11.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue @@ -35,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_12.py b/src/python_testing/TC_TIMESYNC_2_12.py index f530554591..7677dcf184 100644 --- a/src/python_testing/TC_TIMESYNC_2_12.py +++ b/src/python_testing/TC_TIMESYNC_2_12.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue @@ -35,9 +43,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, + get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_13.py b/src/python_testing/TC_TIMESYNC_2_13.py index c667b71eda..8138983030 100644 --- a/src/python_testing/TC_TIMESYNC_2_13.py +++ b/src/python_testing/TC_TIMESYNC_2_13.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import queue @@ -33,7 +41,7 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, SimpleEventCallback, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_2.py b/src/python_testing/TC_TIMESYNC_2_2.py index 83c07355d6..74f935aac9 100644 --- a/src/python_testing/TC_TIMESYNC_2_2.py +++ b/src/python_testing/TC_TIMESYNC_2_2.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === from datetime import timedelta @@ -32,7 +40,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, compare_time, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_4.py b/src/python_testing/TC_TIMESYNC_2_4.py index 21d98fd8ca..76fe9074be 100644 --- a/src/python_testing/TC_TIMESYNC_2_4.py +++ b/src/python_testing/TC_TIMESYNC_2_4.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing @@ -32,7 +40,8 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_5.py b/src/python_testing/TC_TIMESYNC_2_5.py index 5c19e37229..f363f03ba6 100644 --- a/src/python_testing/TC_TIMESYNC_2_5.py +++ b/src/python_testing/TC_TIMESYNC_2_5.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing @@ -32,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_6.py b/src/python_testing/TC_TIMESYNC_2_6.py index deae112321..0e9ec9f795 100644 --- a/src/python_testing/TC_TIMESYNC_2_6.py +++ b/src/python_testing/TC_TIMESYNC_2_6.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing @@ -32,7 +40,7 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_7.py b/src/python_testing/TC_TIMESYNC_2_7.py index a405aae1f9..1c6cea2023 100644 --- a/src/python_testing/TC_TIMESYNC_2_7.py +++ b/src/python_testing/TC_TIMESYNC_2_7.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time @@ -34,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_8.py b/src/python_testing/TC_TIMESYNC_2_8.py index 418d6e8e41..82a77c4c88 100644 --- a/src/python_testing/TC_TIMESYNC_2_8.py +++ b/src/python_testing/TC_TIMESYNC_2_8.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time @@ -34,9 +42,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_2_9.py b/src/python_testing/TC_TIMESYNC_2_9.py index 0fd6872d70..4ce83f81dd 100644 --- a/src/python_testing/TC_TIMESYNC_2_9.py +++ b/src/python_testing/TC_TIMESYNC_2_9.py @@ -19,12 +19,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/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:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# 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:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import typing @@ -33,9 +41,9 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, + utc_time_in_matter_epoch) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, type_matches, - utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_TIMESYNC_3_1.py b/src/python_testing/TC_TIMESYNC_3_1.py index ad972345db..4c7c9d9420 100644 --- a/src/python_testing/TC_TIMESYNC_3_1.py +++ b/src/python_testing/TC_TIMESYNC_3_1.py @@ -19,16 +19,23 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TMP_2_1.py b/src/python_testing/TC_TMP_2_1.py index f48b96991e..d0ae9cf86a 100644 --- a/src/python_testing/TC_TMP_2_1.py +++ b/src/python_testing/TC_TMP_2_1.py @@ -16,7 +16,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 387aeab6a8..6dad144f30 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -18,12 +18,20 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import copy @@ -35,7 +43,7 @@ from chip.clusters import Globals from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts logger = logging.getLogger(__name__) diff --git a/src/python_testing/TC_TestEventTrigger.py b/src/python_testing/TC_TestEventTrigger.py index 373fabf704..ae4f64a805 100644 --- a/src/python_testing/TC_TestEventTrigger.py +++ b/src/python_testing/TC_TestEventTrigger.py @@ -19,19 +19,31 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f -# test-runner-run/run1/script-args: --storage-path admin_storage.json --bool-arg allow_sdk_dac:true --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# script-args: > +# --storage-path admin_storage.json +# --bool-arg allow_sdk_dac:true +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # Assumes `--enable-key 000102030405060708090a0b0c0d0e0f` on Linux app command line, or a DUT diff --git a/src/python_testing/TC_VALCC_2_1.py b/src/python_testing/TC_VALCC_2_1.py index ba9e98e3db..d6f00b00a6 100644 --- a/src/python_testing/TC_VALCC_2_1.py +++ b/src/python_testing/TC_VALCC_2_1.py @@ -16,19 +16,26 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_1.py b/src/python_testing/TC_VALCC_3_1.py index e24c09db66..4b53ab032c 100644 --- a/src/python_testing/TC_VALCC_3_1.py +++ b/src/python_testing/TC_VALCC_3_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time @@ -29,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_2.py b/src/python_testing/TC_VALCC_3_2.py index 9ef0886d8b..6905e3bde8 100644 --- a/src/python_testing/TC_VALCC_3_2.py +++ b/src/python_testing/TC_VALCC_3_2.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -30,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_3.py b/src/python_testing/TC_VALCC_3_3.py index ddf3ba83d1..a63053cf34 100644 --- a/src/python_testing/TC_VALCC_3_3.py +++ b/src/python_testing/TC_VALCC_3_3.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -30,7 +37,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_3_4.py b/src/python_testing/TC_VALCC_3_4.py index 906854011a..30c57dcb3f 100644 --- a/src/python_testing/TC_VALCC_3_4.py +++ b/src/python_testing/TC_VALCC_3_4.py @@ -16,19 +16,26 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_1.py b/src/python_testing/TC_VALCC_4_1.py index 183151af61..9af428d103 100644 --- a/src/python_testing/TC_VALCC_4_1.py +++ b/src/python_testing/TC_VALCC_4_1.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time @@ -29,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_2.py b/src/python_testing/TC_VALCC_4_2.py index 7e331f5f0f..9365e5bc78 100644 --- a/src/python_testing/TC_VALCC_4_2.py +++ b/src/python_testing/TC_VALCC_4_2.py @@ -16,21 +16,27 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === -import logging import time import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts @@ -55,6 +61,7 @@ def steps_TC_VALCC_4_2(self) -> list[TestStep]: TestStep(8, "Send Close command"), TestStep(9, "Read OpenDuration attribute"), TestStep(10, "Read RemainingDuration attribute"), + TestStep(11, "Write DefaultOpenDuration back to original value") ] return steps @@ -73,16 +80,11 @@ async def test_TC_VALCC_4_2(self): attributes = Clusters.ValveConfigurationAndControl.Attributes self.step("2a") - defaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration) + originalDefaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration) self.step("2b") - if defaultOpenDuration is NullValue: - defaultOpenDuration = 60 - - result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, attributes.DefaultOpenDuration(defaultOpenDuration))]) - asserts.assert_equal(result[0].Status, Status.Success, "DefaultOpenDuration write failed") - else: - logging.info("Test step skipped") + defaultOpenDuration = 60 + await self.write_single_attribute(attributes.DefaultOpenDuration(defaultOpenDuration), endpoint_id=endpoint) self.step(3) try: @@ -129,6 +131,9 @@ async def test_TC_VALCC_4_2(self): remaining_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.RemainingDuration) asserts.assert_true(remaining_duration_dut is NullValue, "RemainingDuration is not null") + self.step(11) + await self.write_single_attribute(attributes.DefaultOpenDuration(originalDefaultOpenDuration), endpoint_id=endpoint) + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/TC_VALCC_4_3.py b/src/python_testing/TC_VALCC_4_3.py index cdb8c38ca7..b0762d0d88 100644 --- a/src/python_testing/TC_VALCC_4_3.py +++ b/src/python_testing/TC_VALCC_4_3.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -29,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_4.py b/src/python_testing/TC_VALCC_4_4.py index 4fd1692da3..b85ff9a9f0 100644 --- a/src/python_testing/TC_VALCC_4_4.py +++ b/src/python_testing/TC_VALCC_4_4.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging @@ -29,7 +36,8 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import (MatterBaseTest, TestStep, async_test_body, default_matter_test_main, + utc_time_in_matter_epoch) from mobly import asserts diff --git a/src/python_testing/TC_VALCC_4_5.py b/src/python_testing/TC_VALCC_4_5.py index b07f4281d1..c6b7674c6c 100644 --- a/src/python_testing/TC_VALCC_4_5.py +++ b/src/python_testing/TC_VALCC_4_5.py @@ -16,12 +16,19 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ALL_CLUSTERS_APP} +# app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import time @@ -29,7 +36,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_1_2.py b/src/python_testing/TC_WHM_1_2.py index b8727671d1..2bbcdd5108 100644 --- a/src/python_testing/TC_WHM_1_2.py +++ b/src/python_testing/TC_WHM_1_2.py @@ -16,18 +16,32 @@ # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --enable-key 000102030405060708090a0b0c0d0e0f --application water-heater -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --hex-arg enableKey:000102030405060708090a0b0c0d0e0f --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --enable-key 000102030405060708090a0b0c0d0e0f +# --application water-heater +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --hex-arg enableKey:000102030405060708090a0b0c0d0e0f +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TC_WHM_2_1.py b/src/python_testing/TC_WHM_2_1.py index 3ed57876cd..b9dcb0257d 100644 --- a/src/python_testing/TC_WHM_2_1.py +++ b/src/python_testing/TC_WHM_2_1.py @@ -19,19 +19,31 @@ # for details about the block below. # # === BEGIN CI TEST ARGUMENTS === -# test-runner-runs: run1 -# test-runner-run/run1/app: ${ENERGY_MANAGEMENT_APP} -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/quiet: True -# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json --application evse -# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-runs: +# run1: +# app: ${ENERGY_MANAGEMENT_APP} +# app-args: > +# --discriminator 1234 +# --KVS kvs1 +# --trace-to json:${TRACE_APP}.json +# --application evse +# script-args: > +# --storage-path admin_storage.json +# --commissioning-method on-network +# --discriminator 1234 +# --passcode 20202021 +# --endpoint 1 +# --trace-to json:${TRACE_TEST_JSON}.json +# --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# factory-reset: true +# quiet: true # === END CI TEST ARGUMENTS === import logging import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts diff --git a/src/python_testing/TC_pics_checker.py b/src/python_testing/TC_pics_checker.py index 91e2102b5e..07e8613cc1 100644 --- a/src/python_testing/TC_pics_checker.py +++ b/src/python_testing/TC_pics_checker.py @@ -17,13 +17,13 @@ import math import chip.clusters as Clusters -from basic_composition_support import BasicCompositionTests -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, - MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.basic_composition import BasicCompositionTests +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, FeaturePathLocation, + MatterBaseTest, ProblemLocation, TestStep, async_test_body, default_matter_test_main) +from chip.testing.pics import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str +from chip.testing.spec_parsing import build_xml_clusters from mobly import asserts -from pics_support import accepted_cmd_pics_str, attribute_pics_str, feature_pics_str, generated_cmd_pics_str -from spec_parsing_support import build_xml_clusters class TC_PICS_Checker(MatterBaseTest, BasicCompositionTests): diff --git a/src/python_testing/TestBatchInvoke.py b/src/python_testing/TestBatchInvoke.py index cf10fbb227..6465692c95 100644 --- a/src/python_testing/TestBatchInvoke.py +++ b/src/python_testing/TestBatchInvoke.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, type_matches +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, type_matches from mobly import asserts ''' Integration test of batch commands using UnitTesting Cluster diff --git a/src/python_testing/TestChoiceConformanceSupport.py b/src/python_testing/TestChoiceConformanceSupport.py index 8436bc8418..77eca93761 100644 --- a/src/python_testing/TestChoiceConformanceSupport.py +++ b/src/python_testing/TestChoiceConformanceSupport.py @@ -19,11 +19,11 @@ import xml.etree.ElementTree as ElementTree import jinja2 -from choice_conformance_support import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, - evaluate_feature_choice_conformance) -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.choice_conformance import (evaluate_attribute_choice_conformance, evaluate_command_choice_conformance, + evaluate_feature_choice_conformance) +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import XmlCluster, add_cluster_data_from_xml from mobly import asserts -from spec_parsing_support import XmlCluster, add_cluster_data_from_xml FEATURE_TEMPLATE = '''\ diff --git a/src/python_testing/TestCommissioningTimeSync.py b/src/python_testing/TestCommissioningTimeSync.py index dfd03d957d..d4033ea58b 100644 --- a/src/python_testing/TestCommissioningTimeSync.py +++ b/src/python_testing/TestCommissioningTimeSync.py @@ -20,7 +20,7 @@ from chip import ChipDeviceCtrl from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main, utc_time_in_matter_epoch from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestConformanceSupport.py b/src/python_testing/TestConformanceSupport.py index 3744b6fe5e..ca41bf088e 100644 --- a/src/python_testing/TestConformanceSupport.py +++ b/src/python_testing/TestConformanceSupport.py @@ -18,11 +18,11 @@ import xml.etree.ElementTree as ElementTree from typing import Callable +from chip.testing.conformance import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, + deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, + parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from chip.tlv import uint -from conformance_support import (Choice, Conformance, ConformanceDecision, ConformanceException, ConformanceParseParameters, - deprecated, disallowed, mandatory, optional, parse_basic_callable_from_xml, - parse_callable_from_xml, parse_device_type_callable_from_xml, provisional, zigbee) -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestConformanceTest.py b/src/python_testing/TestConformanceTest.py index f0ff8032ea..ddf3e421a7 100644 --- a/src/python_testing/TestConformanceTest.py +++ b/src/python_testing/TestConformanceTest.py @@ -18,12 +18,12 @@ from typing import Any import chip.clusters as Clusters -from basic_composition_support import arls_populated -from conformance_support import ConformanceDecision -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.basic_composition import arls_populated +from chip.testing.conformance import ConformanceDecision +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestGroupTableReports.py b/src/python_testing/TestGroupTableReports.py index 738b2089a1..9d98a050c7 100644 --- a/src/python_testing/TestGroupTableReports.py +++ b/src/python_testing/TestGroupTableReports.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -42,7 +42,7 @@ from chip.clusters import ClusterObjects as ClusterObjects from chip.clusters.Attribute import SubscriptionTransaction, TypedAttributePath from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestIdChecks.py b/src/python_testing/TestIdChecks.py index 8969807d58..eda01ef955 100644 --- a/src/python_testing/TestIdChecks.py +++ b/src/python_testing/TestIdChecks.py @@ -15,9 +15,10 @@ # limitations under the License. # -from global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, - device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, is_valid_device_type_id) -from matter_testing_support import MatterBaseTest, default_matter_test_main +from chip.testing.global_attribute_ids import (AttributeIdType, ClusterIdType, DeviceTypeIdType, attribute_id_type, cluster_id_type, + device_type_id_type, is_valid_attribute_id, is_valid_cluster_id, + is_valid_device_type_id) +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/TestMatterTestingSupport.py b/src/python_testing/TestMatterTestingSupport.py index d2a259f154..811349b3a9 100644 --- a/src/python_testing/TestMatterTestingSupport.py +++ b/src/python_testing/TestMatterTestingSupport.py @@ -22,14 +22,15 @@ import chip.clusters as Clusters from chip.clusters.Types import Nullable, NullValue +from chip.testing.matter_testing import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, + get_wait_seconds_from_set_time, parse_matter_test_args, type_matches, + utc_time_in_matter_epoch) +from chip.testing.pics import parse_pics, parse_pics_xml +from chip.testing.taglist_and_topology_test import (TagProblem, create_device_type_list_for_root, create_device_type_lists, + find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, + get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) from chip.tlv import uint -from matter_testing_support import (MatterBaseTest, async_test_body, compare_time, default_matter_test_main, - get_wait_seconds_from_set_time, type_matches, utc_time_in_matter_epoch) from mobly import asserts, signals -from pics_support import parse_pics, parse_pics_xml -from taglist_and_topology_test_support import (TagProblem, create_device_type_list_for_root, create_device_type_lists, - find_tag_list_problems, find_tree_roots, flat_list_ok, get_all_children, - get_direct_children_of_root, parts_list_cycles, separate_endpoint_types) def get_raw_type_list(): @@ -629,6 +630,24 @@ def test_xml_pics(self): self.pics_assert('BINFO.S.A0014', False) self.pics_assert('PICSDOESNOTEXIST', False) + def test_parse_matter_test_args(self): + args = [ + # Verify that values are appended to a single argument + "--int-arg", "PIXIT.TEST.DEC:42", + "--int-arg", "PIXIT.TEST.HEX:0x1234", + # Verify that multiple values can be passed for a single argument + "--string-arg", "PIXIT.TEST.STR.MULTI.1:foo", "PIXIT.TEST.STR.MULTI.2:bar", + # Verify JSON parsing + "--json-arg", "PIXIT.TEST.JSON:{\"key\":\"value\"}", + ] + + parsed = parse_matter_test_args(args) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.DEC"), 42) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.HEX"), 0x1234) + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.STR.MULTI.1"), "foo") + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.STR.MULTI.2"), "bar") + asserts.assert_equal(parsed.global_test_params.get("PIXIT.TEST.JSON"), {"key": "value"}) + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/TestSpecParsingDeviceType.py b/src/python_testing/TestSpecParsingDeviceType.py index 7729ccee8a..a9ee14f12b 100644 --- a/src/python_testing/TestSpecParsingDeviceType.py +++ b/src/python_testing/TestSpecParsingDeviceType.py @@ -18,12 +18,12 @@ import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.conformance import conformance_allowed +from chip.testing.matter_testing import MatterBaseTest, default_matter_test_main +from chip.testing.spec_parsing import build_xml_clusters, build_xml_device_types, parse_single_device_type from chip.tlv import uint -from conformance_support import conformance_allowed from jinja2 import Template -from matter_testing_support import MatterBaseTest, default_matter_test_main from mobly import asserts -from spec_parsing_support import build_xml_clusters, build_xml_device_types, parse_single_device_type from TC_DeviceConformance import DeviceConformanceTests diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index 4e0171b077..b4c908c232 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -15,17 +15,16 @@ # limitations under the License. # -import os import xml.etree.ElementTree as ElementTree import chip.clusters as Clusters import jinja2 -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import MatterBaseTest, ProblemNotice, default_matter_test_main +from chip.testing.spec_parsing import (ClusterParser, DataModelLevel, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, + add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base, get_data_model_directory) from mobly import asserts -from spec_parsing_support import (ClusterParser, PrebuiltDataModelDirectory, SpecParsingException, XmlCluster, - add_cluster_data_from_xml, build_xml_clusters, check_clusters_for_unknown_commands, - combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -272,10 +271,10 @@ def test_build_xml_override(self): asserts.assert_equal(set(one_four_clusters.keys())-set(tot_xml_clusters.keys()), set(), "There are some 1.4 clusters that are not included in the TOT spec") - str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), - '..', '..', 'data_model', '1.4', 'clusters')) + str_path = get_data_model_directory(PrebuiltDataModelDirectory.k1_4, DataModelLevel.kCluster) string_override_check, problems = build_xml_clusters(str_path) - asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") + + asserts.assert_count_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") with asserts.assert_raises(SpecParsingException): build_xml_clusters("baddir") diff --git a/src/python_testing/TestTimeSyncTrustedTimeSource.py b/src/python_testing/TestTimeSyncTrustedTimeSource.py index 2f4c9a1f55..50bca6f3da 100644 --- a/src/python_testing/TestTimeSyncTrustedTimeSource.py +++ b/src/python_testing/TestTimeSyncTrustedTimeSource.py @@ -18,7 +18,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts # We don't have a good pipe between the c++ enums in CommissioningDelegate and python diff --git a/src/python_testing/TestUnitTestingErrorPath.py b/src/python_testing/TestUnitTestingErrorPath.py index b49e8a656d..872f1fa930 100644 --- a/src/python_testing/TestUnitTestingErrorPath.py +++ b/src/python_testing/TestUnitTestingErrorPath.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main from mobly import asserts """ Integration test for error path returns via the UnitTesting cluster. diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index 92c0ab23ce..cdd1382292 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -23,7 +23,7 @@ import chip.clusters as Clusters from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import type_matches +from chip.testing.matter_testing import type_matches from mobly import asserts diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 57bd117cf1..34a391873b 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -53,13 +53,10 @@ def main(search_directory, env_file): # Define the base command to run tests base_command = os.path.join(chip_root, "scripts/tests/run_python_test.py") - # Define the files and patterns to exclude + # Define the test python script files and patterns to exclude excluded_patterns = { "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI - "TC_CCTRL_2_1.py", # They rely on example applications that inter-communicate and there is no example app that works right now - "TC_CCTRL_2_2.py", # They rely on example applications that inter-communicate and there is no example app that works right now - "TC_CCTRL_2_3.py", # They rely on example applications that inter-communicate and there is no example app that works right now "TC_DGGEN_3_2.py", # src/python_testing/test_testing/test_TC_DGGEN_3_2.py is the Unit test of this test "TC_EEVSE_Utils.py", # Shared code for TC_EEVSE, not a standalone test "TC_EWATERHTRBase.py", # Shared code for TC_EWATERHTR, not a standalone test @@ -69,7 +66,6 @@ def main(search_directory, env_file): "TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test "TC_OCC_3_1.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change "TC_OCC_3_2.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change - "TC_BRBINFO_4_1.py", # This test requires a TH_ICD_SERVER application, hence not ready run with CI "TestCommissioningTimeSync.py", # Code/Test not being used or not shared code for any other tests "TestConformanceSupport.py", # Unit test - does not run against an app "TestChoiceConformanceSupport.py", # Unit test - does not run against an app @@ -88,14 +84,6 @@ def main(search_directory, env_file): "hello_test.py", # Is a template for tests "test_plan_support.py", # Shared code for TC_*, not a standalone test "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests - "basic_composition_support.py", # Test support/shared code script, not a standalone test - "choice_conformance_support.py", # Test support/shared code script, not a standalone test - "conformance_support.py", # Test support/shared code script, not a standalone test - "global_attribute_ids.py", # Test support/shared code script, not a standalone test - "matter_testing_support.py", # Test support/shared code script, not a standalone test - "pics_support.py", # Test support/shared code script, not a standalone test - "spec_parsing_support.py", # Test support/shared code script, not a standalone test - "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } # Get all .py files in the directory diff --git a/src/python_testing/hello_external_runner.py b/src/python_testing/hello_external_runner.py index 5f00eeb287..64af55ce07 100755 --- a/src/python_testing/hello_external_runner.py +++ b/src/python_testing/hello_external_runner.py @@ -23,8 +23,8 @@ from multiprocessing import Process from multiprocessing.managers import BaseManager +from chip.testing.matter_testing import MatterTestConfig, get_test_info, run_tests from hello_test import HelloTest -from matter_testing_support import MatterTestConfig, get_test_info, run_tests try: from matter_yamltests.hooks import TestRunnerHooks diff --git a/src/python_testing/hello_test.py b/src/python_testing/hello_test.py index ef6bce8040..2d910b1e52 100644 --- a/src/python_testing/hello_test.py +++ b/src/python_testing/hello_test.py @@ -30,7 +30,7 @@ # --passcode 20202021 # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto -# factoryreset: true +# factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === @@ -38,7 +38,7 @@ import chip.clusters as Clusters from chip.interaction_model import Status -from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from chip.testing.matter_testing import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index c8d54fb008..19c7aee68d 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,7 +18,6 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") -# Python package for CHIP testing support. pw_python_package("chip-testing") { setup = [ "setup.py", @@ -30,7 +29,16 @@ pw_python_package("chip-testing") { sources = [ "chip/testing/__init__.py", + "chip/testing/apps.py", + "chip/testing/basic_composition.py", + "chip/testing/choice_conformance.py", + "chip/testing/conformance.py", + "chip/testing/global_attribute_ids.py", + "chip/testing/matter_testing.py", "chip/testing/metadata.py", + "chip/testing/pics.py", + "chip/testing/spec_parsing.py", + "chip/testing/taglist_and_topology_test.py", "chip/testing/tasks.py", ] diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py new file mode 100644 index 0000000000..3b21a1c050 --- /dev/null +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/apps.py @@ -0,0 +1,69 @@ +# Copyright (c) 2024 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 signal +import tempfile + +from chip.testing.tasks import Subprocess + + +class AppServerSubprocess(Subprocess): + """Wrapper class for starting an application server in a subprocess.""" + + # Prefix for log messages from the application server. + PREFIX = b"[SERVER]" + + def __init__(self, app: str, storage_dir: str, discriminator: int, + passcode: int, port: int = 5540): + self.kvs_fd, kvs_path = tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-") + # Start the server application with dedicated KVS storage. + super().__init__(app, "--KVS", kvs_path, + '--secured-device-port', str(port), + "--discriminator", str(discriminator), + "--passcode", str(passcode), + output_cb=lambda line, is_stderr: self.PREFIX + line) + + def __del__(self): + # Do not leak KVS file descriptor. + os.close(self.kvs_fd) + + +class IcdAppServerSubprocess(AppServerSubprocess): + """Wrapper class for starting an ICD application server in a subprocess.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.paused = False + + def pause(self, check_state: bool = True): + if check_state and self.paused: + raise ValueError("ICD TH Server unexpectedly is already paused") + if not self.paused: + # Stop (halt) the ICD server process by sending a SIGTOP signal. + self.p.send_signal(signal.SIGSTOP) + self.paused = True + + def resume(self, check_state: bool = True): + if check_state and not self.paused: + raise ValueError("ICD TH Server unexpectedly is already running") + if self.paused: + # Resume (continue) the ICD server process by sending a SIGCONT signal. + self.p.send_signal(signal.SIGCONT) + self.paused = False + + def terminate(self): + # Make sure the ICD server process is not paused before terminating it. + self.resume(check_state=False) + super().terminate() diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py similarity index 100% rename from src/python_testing/basic_composition_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/basic_composition.py diff --git a/src/python_testing/choice_conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py similarity index 93% rename from src/python_testing/choice_conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py index 58d37bf101..7e7775d555 100644 --- a/src/python_testing/choice_conformance_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/choice_conformance.py @@ -1,8 +1,8 @@ +from chip.testing.conformance import Choice, ConformanceDecisionWithChoice +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import AttributePathLocation, ProblemNotice, ProblemSeverity +from chip.testing.spec_parsing import XmlCluster from chip.tlv import uint -from conformance_support import Choice, ConformanceDecisionWithChoice -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import AttributePathLocation, ProblemNotice, ProblemSeverity -from spec_parsing_support import XmlCluster class ChoiceConformanceProblemNotice(ProblemNotice): diff --git a/src/python_testing/conformance_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py similarity index 100% rename from src/python_testing/conformance_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/conformance.py diff --git a/src/python_testing/global_attribute_ids.py b/src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py similarity index 100% rename from src/python_testing/global_attribute_ids.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/global_attribute_ids.py diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py similarity index 99% rename from src/python_testing/matter_testing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index 92cde9edb6..2d23a9f84b 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -38,6 +38,7 @@ from datetime import datetime, timedelta, timezone from enum import Enum, IntFlag from functools import partial +from itertools import chain from typing import Any, Iterable, List, Optional, Tuple from chip.tlv import float32, uint @@ -64,12 +65,12 @@ from chip.interaction_model import InteractionModelError, Status from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.pics import read_pics_from_file from chip.tracing import TracingContext -from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner -from pics_support import read_pics_from_file try: from matter_yamltests.hooks import TestRunnerHooks @@ -1842,7 +1843,7 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig: all_global_args = [] argsets = [item for item in (args.int_arg, args.float_arg, args.string_arg, args.json_arg, args.hex_arg, args.bool_arg) if item is not None] - for argset in argsets: + for argset in chain.from_iterable(argsets): all_global_args.extend(argset) config.global_test_params = {} @@ -1954,17 +1955,17 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig help='Path to chip-tool credentials file root') args_group = parser.add_argument_group(title="Config arguments", description="Test configuration global arguments set") - args_group.add_argument('--int-arg', nargs='*', type=int_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--int-arg', nargs='*', action='append', type=int_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an integer as hex or decimal (e.g. -2 or 0xFFFF_1234)") - args_group.add_argument('--bool-arg', nargs='*', type=bool_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--bool-arg', nargs='*', action='append', type=bool_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an boolean value (e.g. true/false or 0/1)") - args_group.add_argument('--float-arg', nargs='*', type=float_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--float-arg', nargs='*', action='append', type=float_named_arg, metavar="NAME:VALUE", help="Add a named test argument for a floating point value (e.g. -2.1 or 6.022e23)") - args_group.add_argument('--string-arg', nargs='*', type=str_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--string-arg', nargs='*', action='append', type=str_named_arg, metavar="NAME:VALUE", help="Add a named test argument for a string value") - args_group.add_argument('--json-arg', nargs='*', type=json_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--json-arg', nargs='*', action='append', type=json_named_arg, metavar="NAME:VALUE", help="Add a named test argument for JSON stored as a list or dict") - args_group.add_argument('--hex-arg', nargs='*', type=bytes_as_hex_named_arg, metavar="NAME:VALUE", + args_group.add_argument('--hex-arg', nargs='*', action='append', type=bytes_as_hex_named_arg, metavar="NAME:VALUE", help="Add a named test argument for an octet string in hex (e.g. 0011cafe or 00:11:CA:FE)") if not argv: @@ -2277,7 +2278,7 @@ def default_matter_test_main(): In this case, only one test class in a test script is allowed. To make your test script executable, add the following to your file: .. code-block:: python - from matter_testing_support.py import default_matter_test_main + from chip.testing.matter_testing.py import default_matter_test_main ... if __name__ == '__main__': default_matter_test_main.main() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py index 2a912d0fe6..2d40d792ac 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py @@ -13,22 +13,13 @@ # limitations under the License. import logging -import re from dataclasses import dataclass from io import StringIO -from typing import Any, Dict, List, Optional +from typing import Dict, List, Optional import yaml -# TODO #35787: Remove support for non-YAML format -def cast_to_bool(value: Any) -> bool: - """Convert True/true/False/false strings to bool.""" - if isinstance(value, str): - return value.strip().lower() == "true" - return bool(value) - - @dataclass class Metadata: py_script_path: str @@ -40,7 +31,7 @@ class Metadata: factory_reset: bool = False factory_reset_app_only: bool = False script_gdb: bool = False - quiet: bool = True + quiet: bool = False class NamedStringIO(StringIO): @@ -53,52 +44,28 @@ def extract_runs_args(py_script_path: str) -> Dict[str, Dict[str, str]]: """Extract the run arguments from the CI test arguments blocks.""" found_ci_args_section = False - done_ci_args_section = False - - runs_def_ptrn = re.compile(r'^\s*#\s*test-runner-runs:\s*(?P.*)$') - arg_def_ptrn = re.compile( - r'^\s*#\s*test-runner-run/(?P[a-zA-Z0-9_]+)/(?P[a-zA-Z0-9_\-]+):\s*(?P.*)$') - runs_arg_lines: Dict[str, Dict[str, str]] = {} ci_args_section_lines = [] with open(py_script_path, 'r', encoding='utf8') as py_script: for line_idx, line in enumerate(py_script.readlines()): line = line.strip() - line_num = line_idx + 1 # Append empty line to the line capture, so during YAML parsing # line numbers will match the original file. ci_args_section_lines.append("") # Detect the single CI args section, to skip the lines otherwise. - if not done_ci_args_section and line.startswith("# === BEGIN CI TEST ARGUMENTS ==="): + if line.startswith("# === BEGIN CI TEST ARGUMENTS ==="): found_ci_args_section = True continue - elif found_ci_args_section and line.startswith("# === END CI TEST ARGUMENTS ==="): - done_ci_args_section = True - found_ci_args_section = False - continue + if line.startswith("# === END CI TEST ARGUMENTS ==="): + break if found_ci_args_section: # Update the last line in the line capture. ci_args_section_lines[-1] = " " + line.lstrip("#") - runs_match = runs_def_ptrn.match(line) - args_match = arg_def_ptrn.match(line) - - if not found_ci_args_section and (runs_match or args_match): - logging.warning(f"{py_script_path}:{line_num}: Found CI args outside of CI TEST ARGUMENTS block") - continue - - if runs_match: - for run in runs_match.group("run_id").strip().split(): - runs_arg_lines[run] = {} - runs_arg_lines[run]['run'] = run - - elif args_match: - runs_arg_lines[args_match.group("run_id")][args_match.group("arg_name")] = args_match.group("arg_val") - if not runs_arg_lines: try: runs = yaml.safe_load(NamedStringIO("\n".join(ci_args_section_lines), py_script_path)) @@ -182,8 +149,8 @@ def parse_script(self, py_script_path: str) -> List[Metadata]: app_args=attr.get("app-args"), app_ready_pattern=attr.get("app-ready-pattern"), script_args=attr.get("script-args"), - factory_reset=cast_to_bool(attr.get("factoryreset", False)), - quiet=cast_to_bool(attr.get("quiet", True)) + factory_reset=attr.get("factory-reset", False), + quiet=attr.get("quiet", True), )) return runs_metadata diff --git a/src/python_testing/pics_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/pics.py similarity index 100% rename from src/python_testing/pics_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/pics.py diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py similarity index 95% rename from src/python_testing/spec_parsing_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py index 75ffea120f..97a13606ea 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/spec_parsing.py @@ -26,14 +26,14 @@ from typing import Callable, Optional import chip.clusters as Clusters -import conformance_support +import chip.testing.conformance as conformance_support +from chip.testing.conformance import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, + ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, + parse_callable_from_xml, parse_device_type_callable_from_xml) +from chip.testing.global_attribute_ids import GlobalAttributeIds +from chip.testing.matter_testing import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, + EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) from chip.tlv import uint -from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, - ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, - parse_callable_from_xml, parse_device_type_callable_from_xml) -from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, DeviceTypePathLocation, - EventPathLocation, FeaturePathLocation, ProblemNotice, ProblemSeverity) _PRIVILEGE_STR = { None: "N/A", @@ -518,19 +518,36 @@ class DataModelLevel(str, Enum): kDeviceType = 'device_types' -def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: +def _get_data_model_root() -> str: + """Attempts to find ${CHIP_ROOT}/data_model or equivalent.""" + + # Since this class is generally in a module, we have to rely on being bootstrapped or + # we use CWD if we cannot + choices = [os.getcwd()] + + if 'PW_PROJECT_ROOT' in os.environ: + choices.insert(0, os.environ['PW_PROJECT_ROOT']) + + for c in choices: + data_model_path = os.path.join(c, 'data_model') + if os.path.exists(os.path.join(data_model_path, 'master', 'scraper_version')): + return data_model_path + raise FileNotFoundError('Cannot find a CHIP_ROOT/data_model path. Tried %r as prefixes.' % choices) + + +def get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str], data_model_level: DataModelLevel) -> str: if data_model_directory == PrebuiltDataModelDirectory.k1_3: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.3', data_model_level) + return os.path.join(_get_data_model_root(), '1.3', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.k1_4: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', '1.4', data_model_level) + return os.path.join(_get_data_model_root(), '1.4', data_model_level) elif data_model_directory == PrebuiltDataModelDirectory.kMaster: - return os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', data_model_level) + return os.path.join(_get_data_model_root(), 'master', data_model_level) else: return data_model_directory def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} pure_base_clusters: dict[str, XmlCluster] = {} @@ -777,7 +794,7 @@ def parse_single_device_type(root: ElementTree.Element) -> tuple[list[ProblemNot def build_xml_device_types(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.k1_4) -> tuple[dict[int, XmlDeviceType], list[ProblemNotice]]: - dir = _get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) + dir = get_data_model_directory(data_model_directory, DataModelLevel.kDeviceType) device_types: dict[int, XmlDeviceType] = {} problems = [] for xml in glob.glob(f"{dir}/*.xml"): diff --git a/src/python_testing/taglist_and_topology_test_support.py b/src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py similarity index 100% rename from src/python_testing/taglist_and_topology_test_support.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/taglist_and_topology_test.py diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py index 24ed6c62d4..384cd77db3 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py @@ -23,19 +23,6 @@ class TestMetadataReader(unittest.TestCase): test_file_content = ''' # === BEGIN CI TEST ARGUMENTS === - # test-runner-runs: run1 - # test-runner-run/run1/app: ${ALL_CLUSTERS_APP} - # test-runner-run/run1/app-args: --discriminator 1234 --trace-to json:${TRACE_APP}.json - # test-runner-run/run1/script-args: --commissioning-method on-network --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto - # test-runner-run/run1/factoryreset: True - # test-runner-run/run1/quiet: True - # === END CI TEST ARGUMENTS === - - # test-runner-run/run1/quiet: False - ''' - - test_file_content_yaml = ''' - # === BEGIN CI TEST ARGUMENTS === # test-runner-runs: # run1: # app: ${ALL_CLUSTERS_APP} @@ -44,7 +31,7 @@ class TestMetadataReader(unittest.TestCase): # --commissioning-method on-network # --trace-to json:${TRACE_TEST_JSON}.json # --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto - # factoryreset: true + # factory-reset: true # quiet: true # === END CI TEST ARGUMENTS === ''' @@ -83,15 +70,6 @@ def test_run_arg_generation(self): self.expected_metadata.py_script_path = test_file self.assertEqual(self.expected_metadata, reader.parse_script(test_file)[0]) - def test_run_arg_generation_yaml(self): - with tempfile.TemporaryDirectory() as temp_dir: - test_file = self.generate_temp_file(temp_dir, self.test_file_content_yaml) - env_file = self.generate_temp_file(temp_dir, self.env_file_content) - - reader = MetadataReader(env_file) - self.expected_metadata.py_script_path = test_file - self.assertEqual(self.expected_metadata, reader.parse_script(test_file)[0]) - if __name__ == "__main__": unittest.main() diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py index 5e91a89cf6..051d571d79 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py @@ -14,6 +14,10 @@ import unittest +# TODO: Allow to use relative imports or imports from chip.testing package. Then, +# rename "tasks" module to "subprocess", because it would be more descriptive. +# Unfortunately, current way of importing clashes with the subprocess module +# from the Python standard library. from tasks import Subprocess diff --git a/src/python_testing/post_certification_tests/production_device_checks.py b/src/python_testing/post_certification_tests/production_device_checks.py index 6988076e6a..b8e567f76a 100644 --- a/src/python_testing/post_certification_tests/production_device_checks.py +++ b/src/python_testing/post_certification_tests/production_device_checks.py @@ -31,8 +31,8 @@ # files, then add the extra dependencies. From the root: # # . scripts/activate.sh -# ./scripts/build_python.sh -i py -# source py/bin/activate +# ./scripts/build_python.sh -i out/python_env +# source out/python_env/bin/activate # pip install opencv-python requests click_option_group # python src/python_testing/post_certification_tests/production_device_checks.py @@ -59,15 +59,15 @@ os.path.join(os.path.dirname(__file__), '..', '..', '..')) try: - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from basic_composition_support import BasicCompositionTests - from matter_testing_support import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, - run_tests_no_exit) + from chip.testing.basic_composition import BasicCompositionTests + from chip.testing.matter_testing import (MatterBaseTest, MatterStackState, MatterTestConfig, TestStep, async_test_body, + run_tests_no_exit) try: import fetch_paa_certs_from_dcl diff --git a/src/python_testing/test_plan_table_generator.py b/src/python_testing/test_plan_table_generator.py index c972116f34..b38f6f94df 100755 --- a/src/python_testing/test_plan_table_generator.py +++ b/src/python_testing/test_plan_table_generator.py @@ -22,7 +22,7 @@ from pathlib import Path import click -from matter_testing_support import MatterTestConfig, generate_mobly_test_config +from chip.testing.matter_testing import MatterTestConfig, generate_mobly_test_config def indent_multiline(multiline: str, num_spaces: int) -> str: diff --git a/src/python_testing/test_testing/MockTestRunner.py b/src/python_testing/test_testing/MockTestRunner.py index 2d0afb8a5c..6c9bc1c088 100644 --- a/src/python_testing/test_testing/MockTestRunner.py +++ b/src/python_testing/test_testing/MockTestRunner.py @@ -22,13 +22,7 @@ from unittest.mock import MagicMock from chip.clusters import Attribute - -try: - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterStackState, MatterTestConfig, run_tests_no_exit +from chip.testing.matter_testing import MatterStackState, MatterTestConfig, run_tests_no_exit class AsyncMock(MagicMock): @@ -56,7 +50,15 @@ def __init__(self, filename: str, classname: str, test: str, endpoint: int = Non def set_test(self, filename: str, classname: str, test: str): self.test = test self.config.tests = [self.test] - module = importlib.import_module(Path(os.path.basename(filename)).stem) + + module_name = Path(os.path.basename(filename)).stem + + try: + module = importlib.import_module(module_name) + except ModuleNotFoundError: + sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + module = importlib.import_module(module_name) + self.test_class = getattr(module, classname) def set_test_config(self, test_config: MatterTestConfig = MatterTestConfig()): diff --git a/src/python_testing/test_testing/TestDecorators.py b/src/python_testing/test_testing/TestDecorators.py index 82b49eddd8..ce32518b71 100644 --- a/src/python_testing/test_testing/TestDecorators.py +++ b/src/python_testing/test_testing/TestDecorators.py @@ -25,23 +25,13 @@ # # You will get step_* calls as appropriate in between the test_start and test_stop calls if the test is not skipped. -import os import sys +from typing import Optional import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, - run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, - has_cluster, has_feature, run_if_endpoint_matches, run_on_singleton_matching_endpoint, - should_run_test_on_endpoint) - -from typing import Optional - +from chip.testing.matter_testing import (MatterBaseTest, MatterTestConfig, async_test_body, has_attribute, has_cluster, has_feature, + run_if_endpoint_matches, run_on_singleton_matching_endpoint, should_run_test_on_endpoint) from mobly import asserts from MockTestRunner import MockTestRunner diff --git a/src/python_testing/test_testing/test_IDM_10_4.py b/src/python_testing/test_testing/test_IDM_10_4.py index 8634e94129..8a30609e94 100644 --- a/src/python_testing/test_testing/test_IDM_10_4.py +++ b/src/python_testing/test_testing/test_IDM_10_4.py @@ -21,13 +21,7 @@ import chip.clusters as Clusters from chip.clusters import Attribute - -try: - from pics_support import parse_pics_xml -except ImportError: - sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) - from pics_support import parse_pics_xml - +from chip.testing.pics import parse_pics_xml from MockTestRunner import MockTestRunner # Reachable attribute is off in the pics file diff --git a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py index bd28023b8e..6a2dc48ba4 100644 --- a/src/python_testing/test_testing/test_TC_CCNTL_2_2.py +++ b/src/python_testing/test_testing/test_TC_CCNTL_2_2.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_DA_1_2.py b/src/python_testing/test_testing/test_TC_DA_1_2.py index 296508ba2f..290bac613a 100755 --- a/src/python_testing/test_testing/test_TC_DA_1_2.py +++ b/src/python_testing/test_testing/test_TC_DA_1_2.py @@ -30,7 +30,7 @@ def run_single_test(dac_provider: str, product_id: int, factory_reset: bool = Fa reset = "" if factory_reset: - reset = ' --factoryreset' + reset = ' --factory-reset' app = os.path.join( CHIP_ROOT, 'out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app') diff --git a/src/python_testing/test_testing/test_TC_DA_1_5.py b/src/python_testing/test_testing/test_TC_DA_1_5.py index 126814ca61..fbabfbf6cf 100755 --- a/src/python_testing/test_testing/test_TC_DA_1_5.py +++ b/src/python_testing/test_testing/test_TC_DA_1_5.py @@ -27,7 +27,7 @@ def run_single_test(flag: str, factory_reset: bool = False) -> int: reset = "" if factory_reset: - reset = ' --factoryreset' + reset = ' --factory-reset' app = os.path.join(CHIP_ROOT, 'out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app') diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py index d79b412530..ed9f1b3531 100644 --- a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -30,11 +30,11 @@ from MockTestRunner import AsyncMock, MockTestRunner try: - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit except ImportError: sys.path.append(os.path.abspath( os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + from chip.testing.matter_testing import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit invoke_call_count = 0 event_call_count = 0 diff --git a/src/python_testing/test_testing/test_TC_SC_7_1.py b/src/python_testing/test_testing/test_TC_SC_7_1.py index 3b1b6a5b1c..96dced72f9 100644 --- a/src/python_testing/test_testing/test_TC_SC_7_1.py +++ b/src/python_testing/test_testing/test_TC_SC_7_1.py @@ -16,21 +16,14 @@ # limitations under the License. # -import os import sys from random import randbytes import chip.clusters as Clusters from chip.clusters import Attribute +from chip.testing.matter_testing import MatterTestConfig from MockTestRunner import MockTestRunner -try: - from matter_testing_support import MatterTestConfig -except ImportError: - sys.path.append(os.path.abspath( - os.path.join(os.path.dirname(__file__), '..'))) - from matter_testing_support import MatterTestConfig - def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse: opcreds = Clusters.OperationalCredentials diff --git a/src/setup_payload/SetupPayload.cpp b/src/setup_payload/SetupPayload.cpp index 9683da21f8..915f20c4a2 100644 --- a/src/setup_payload/SetupPayload.cpp +++ b/src/setup_payload/SetupPayload.cpp @@ -23,6 +23,7 @@ #include "SetupPayload.h" +#include #include #include #include @@ -207,6 +208,34 @@ CHIP_ERROR SetupPayload::removeSerialNumber() return CHIP_NO_ERROR; } +CHIP_ERROR SetupPayload::generateRandomSetupPin(uint32_t & setupPINCode) +{ + uint8_t retries = 0; + const uint8_t maxRetries = 10; + + do + { + ReturnErrorOnFailure(Crypto::DRBG_get_bytes(reinterpret_cast(&setupPINCode), sizeof(setupPINCode))); + + // Passcodes shall be restricted to the values 00000001 to 99999998 in decimal, see 5.1.1.6 + // TODO: Consider revising this method to ensure uniform distribution of setup PIN codes + setupPINCode = (setupPINCode % kSetupPINCodeMaximumValue) + 1; + + // Make sure that the Generated Setup Pin code is not one of the invalid passcodes/pin codes defined in the + // specification. + if (IsValidSetupPIN(setupPINCode)) + { + return CHIP_NO_ERROR; + } + + retries++; + // We got pretty unlucky with the random number generator, Just try again. + // This shouldn't take many retries assuming DRBG_get_bytes is not broken. + } while (retries < maxRetries); + + return CHIP_ERROR_INTERNAL; +} + CHIP_ERROR SetupPayload::addOptionalVendorData(const OptionalQRCodeInfo & info) { VerifyOrReturnError(IsVendorTag(info.tag), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 3d5d101fbf..829af128bf 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -259,6 +259,17 @@ class SetupPayload : public PayloadContents **/ static bool IsVendorTag(uint8_t tag) { return !IsCommonTag(tag); } + /** @brief Generate a Random Setup Pin Code (Passcode) + * + * This function generates a random passcode within the defined limits (00000001 to 99999998) + * It also checks that the generated passcode is not equal to any invalid passcode values as defined in 5.1.7.1. + * + * @param[out] setupPINCode The generated random setup PIN code. + * @return Returns a CHIP_ERROR_INTERNAL if unable to generate a valid passcode within a reasonable number of attempts, + * CHIP_NO_ERROR otherwise + **/ + static CHIP_ERROR generateRandomSetupPin(uint32_t & setupPINCode); + private: std::map optionalVendorData; std::map optionalExtensionData; diff --git a/src/system/SystemFaultInjection.cpp b/src/system/SystemFaultInjection.cpp index 1154409674..531395694c 100644 --- a/src/system/SystemFaultInjection.cpp +++ b/src/system/SystemFaultInjection.cpp @@ -25,7 +25,6 @@ /* module header, also carries config, comes first */ #include -#include #include namespace chip { diff --git a/src/system/SystemPacketBuffer.h b/src/system/SystemPacketBuffer.h index 5068822c7f..8fd73b9c35 100644 --- a/src/system/SystemPacketBuffer.h +++ b/src/system/SystemPacketBuffer.h @@ -784,7 +784,7 @@ class PacketBufferWriterBase : public Writer * @param[in] aSize Maximum number of octects to write into the packet buffer. */ PacketBufferWriterBase(System::PacketBufferHandle && aPacket, size_t aSize) : - Writer(aPacket->Start() + aPacket->DataLength(), chip::min(aSize, static_cast(aPacket->AvailableDataLength()))) + Writer(aPacket->Start() + aPacket->DataLength(), std::min(aSize, static_cast(aPacket->AvailableDataLength()))) { mPacket = std::move(aPacket); } diff --git a/src/test_driver/efr32/BUILD.gn b/src/test_driver/efr32/BUILD.gn index 0d10cb8d76..1fc16ed47f 100644 --- a/src/test_driver/efr32/BUILD.gn +++ b/src/test_driver/efr32/BUILD.gn @@ -61,6 +61,16 @@ efr32_sdk("sdk") { ] } +config("efr32_ldflags") { + _ldscript = + "${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld" + + ldflags = [ + "-T" + rebase_path(_ldscript, root_build_dir), + "-Wl,--no-warn-rwx-segment", + ] +} + # This is the test runner. `pw_test` will dep this for each `silabs_executable` target. source_set("efr32_test_main") { defines = [ "PW_RPC_ENABLED" ] @@ -103,6 +113,7 @@ source_set("efr32_test_main") { ] include_dirs = [ "${chip_root}/examples/common/pigweed/efr32" ] + public_configs = [ ":efr32_ldflags" ] } # This target is referred to by BuildRoot in scripts/build/builders/efr32.py, as well as the example in README.md. diff --git a/src/test_driver/efr32/args.gni b/src/test_driver/efr32/args.gni index f7f52398a5..35be5dd63e 100644 --- a/src/test_driver/efr32/args.gni +++ b/src/test_driver/efr32/args.gni @@ -15,9 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/args.gni") import("${chip_root}/src/platform/silabs/efr32/args.gni") -import("${chip_root}/third_party/silabs/silabs_board.gni") # silabs_family silabs_sdk_target = get_label_info(":sdk", "label_no_toolchain") @@ -46,9 +44,3 @@ pw_unit_test_MAIN = "//:efr32_test_main" # Additional variables needed by silabs_executable that must be passed in to pw_test. test_executable_output_name = "matter-silabs-device_tests-" test_executable_output_name_suffix = ".out" -_ldscript = - "${chip_root}/examples/platform/silabs/ldscripts/${silabs_family}.ld" -test_executable_ldflags = [ - "-T" + rebase_path(_ldscript, root_build_dir), - "-Wl,--no-warn-rwx-segment", -] diff --git a/src/test_driver/efr32/src/main.cpp b/src/test_driver/efr32/src/main.cpp index 088dc4e870..a2a078c469 100644 --- a/src/test_driver/efr32/src/main.cpp +++ b/src/test_driver/efr32/src/main.cpp @@ -19,10 +19,10 @@ #include #include -#include #include #include #include +#include #include #include #include @@ -34,9 +34,9 @@ #include #include #include +#include #include #include -#include using namespace chip; using namespace chip::DeviceLayer; @@ -66,13 +66,17 @@ class NlTest : public pw_rpc::nanopb::NlTest::Service } // namespace chip::rpc namespace { - -#define TEST_TASK_STACK_SIZE 16 * 1024 -#define TEST_TASK_PRIORITY 1 - -static TaskHandle_t sTestTaskHandle; -StaticTask_t sTestTaskBuffer; -StackType_t sTestTaskStack[TEST_TASK_STACK_SIZE]; +osThreadId_t sTestTaskHandle; +osThread_t testTaskControlBlock; +constexpr uint32_t kTestTaskStackSize = 16 * 1024; +uint8_t testTaskStack[kTestTaskStackSize]; +constexpr osThreadAttr_t kTestTaskAttr = { .name = "TestDriver", + .attr_bits = osThreadDetached, + .cb_mem = &testTaskControlBlock, + .cb_size = osThreadCbSize, + .stack_mem = testTaskStack, + .stack_size = kTestTaskStackSize, + .priority = osPriorityNormal }; chip::rpc::NlTest nl_test_service; pw::unit_test::UnitTestService unit_test_service; @@ -105,15 +109,14 @@ int main(void) SetDeviceInstanceInfoProvider(&provision.GetStorage()); SetCommissionableDataProvider(&provision.GetStorage()); - SILABS_LOG("***** CHIP EFR32 device tests *****\r\n"); + ChipLogProgress(AppServer, "***** CHIP EFR32 device tests *****\r\n"); // Start RPC service which runs the tests. - sTestTaskHandle = xTaskCreateStatic(RunRpcService, "RPC_TEST_TASK", ArraySize(sTestTaskStack), nullptr, TEST_TASK_PRIORITY, - sTestTaskStack, &sTestTaskBuffer); - SILABS_LOG("Starting FreeRTOS scheduler"); + sTestTaskHandle = osThreadNew(RunRpcService, nullptr, &kTestTaskAttr); + ChipLogProgress(AppServer, "Starting Kernel"); sl_system_kernel_start(); // Should never get here. - SILABS_LOG("vTaskStartScheduler() failed"); + ChipLogProgress(AppServer, "sl_system_kernel_start() failed"); return -1; } diff --git a/src/test_driver/linux-cirque/MobileDeviceTest.py b/src/test_driver/linux-cirque/MobileDeviceTest.py index a206dc31c2..c8a73baf0c 100755 --- a/src/test_driver/linux-cirque/MobileDeviceTest.py +++ b/src/test_driver/linux-cirque/MobileDeviceTest.py @@ -126,7 +126,7 @@ def run_controller_test(self): "Toggle ep1 on/off from state 0 to 1", "Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0000", "Toggle ep1 on/off from state 1 to 0", - "No command 0x0000_0001 in Cluster 0x0000_0006 on Endpoint 0xe9"]), + "No command 0x0000_0001 in Cluster 0x0000_0006 on Endpoint 233"]), "Datamodel test failed: cannot find matching string from device {}".format(device_id)) diff --git a/src/tools/PICS-generator/PICSGenerator.py b/src/tools/PICS-generator/PICSGenerator.py index acdeb676ed..6cfb95803a 100644 --- a/src/tools/PICS-generator/PICSGenerator.py +++ b/src/tools/PICS-generator/PICSGenerator.py @@ -25,10 +25,10 @@ from pics_generator_support import map_cluster_name_to_pics_xml, pics_xml_file_list_loader from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 console = None xml_clusters = None diff --git a/src/tools/PICS-generator/XMLPICSValidator.py b/src/tools/PICS-generator/XMLPICSValidator.py index d728a61991..5fd170463d 100644 --- a/src/tools/PICS-generator/XMLPICSValidator.py +++ b/src/tools/PICS-generator/XMLPICSValidator.py @@ -23,7 +23,7 @@ # Add the path to python_testing folder, in order to be able to import from matter_testing_support sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from spec_parsing_support import build_xml_clusters # noqa: E402 +from chip.testing.spec_parsing import build_xml_clusters # noqa: E402 parser = argparse.ArgumentParser() parser.add_argument('--pics-template', required=True) diff --git a/src/tools/device-graph/matter-device-graph.py b/src/tools/device-graph/matter-device-graph.py index 16a2e6dbb0..597468624d 100644 --- a/src/tools/device-graph/matter-device-graph.py +++ b/src/tools/device-graph/matter-device-graph.py @@ -23,9 +23,9 @@ import graphviz from rich.console import Console -# Add the path to python_testing folder, in order to be able to import from matter_testing_support +# Add the path to python_testing folder, in order to be able to import from chip.testing.matter_testing sys.path.append(os.path.abspath(sys.path[0] + "/../../python_testing")) -from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 +from chip.testing.matter_testing import MatterBaseTest, async_test_body, default_matter_test_main # noqa: E402 console = None maxClusterNameLength = 30 diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index ba586a3095..574d5f40cc 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -158,7 +158,11 @@ class SecureSession : public Session, public ReferenceCounted; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::GeneralCommissioning::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::GeneralCommissioning::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace TCUpdateDeadline + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) @@ -37258,9 +37305,56 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ContentAppObserver -namespace WebRTCTransportProvider { +namespace ZoneManagement { namespace Attributes { +namespace Sensitivity { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace Sensitivity + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) @@ -37269,7 +37363,7 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37289,7 +37383,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, Mar Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id), + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } @@ -37303,7 +37397,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -37316,7 +37410,7 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::ZoneManagement::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -37336,7 +37430,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id), + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ZoneManagement::Id, Id), EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } @@ -37350,13 +37444,1875 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::ZoneManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace WebRTCTransportProvider +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace MaxEncodedPixelRate + +namespace NightVisionCapable { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace NightVisionCapable + +namespace MaxPreRollBufferSize { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace MaxPreRollBufferSize + +namespace TwoWayTalkSupport { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace TwoWayTalkSupport + +namespace MaxNetworkBandwidth { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace MaxNetworkBandwidth + +namespace CurrentFrameRate { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace CurrentFrameRate + +namespace HDRModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace HDRModeEnabled + +namespace SoftRecordingPrivacyModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace SoftRecordingPrivacyModeEnabled + +namespace SoftLivestreamPrivacyModeEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace SoftLivestreamPrivacyModeEnabled + +namespace HardPrivacyModeOn { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace HardPrivacyModeOn + +namespace NightVision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace NightVision + +namespace NightVisionIllum { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace NightVisionIllum + +namespace AWBEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace AWBEnabled + +namespace AutoShutterSpeedEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace AutoShutterSpeedEnabled + +namespace AutoISOEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace AutoISOEnabled + +namespace SpeakerMuted { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerMuted + +namespace SpeakerVolumeLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerVolumeLevel + +namespace SpeakerMaxLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerMaxLevel + +namespace SpeakerMinLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace SpeakerMinLevel + +namespace MicrophoneMuted { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace MicrophoneMuted + +namespace MicrophoneVolumeLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicrophoneVolumeLevel + +namespace MicrophoneMaxLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicrophoneMaxLevel + +namespace MicrophoneMinLevel { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace MicrophoneMinLevel + +namespace MicrophoneAGCEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace MicrophoneAGCEnabled + +namespace ImageRotation { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ImageRotation + +namespace ImageFlipHorizontal { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace ImageFlipHorizontal + +namespace ImageFlipVertical { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace ImageFlipVertical + +namespace LocalVideoRecordingEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace LocalSnapshotRecordingEnabled + +namespace StatusLightEnabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace StatusLightEnabled + +namespace StatusLightBrightness { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace DepthSensorStatus + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::CameraAvStreamManagement::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::CameraAvStreamManagement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace CameraAvStreamManagement + +namespace WebRTCTransportProvider { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportProvider::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportProvider::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportProvider + +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportRequestor::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WebRTCTransportRequestor::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::WebRTCTransportRequestor::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 712f13d790..50d01dbe71 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -834,6 +834,12 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace TCUpdateDeadline + namespace FeatureMap { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); @@ -5635,6 +5641,259 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Attributes { + +namespace Sensitivity { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace Sensitivity + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace MaxEncodedPixelRate + +namespace NightVisionCapable { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace NightVisionCapable + +namespace MaxPreRollBufferSize { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace MaxPreRollBufferSize + +namespace TwoWayTalkSupport { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum * value); // TwoWayTalkSupportTypeEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value, + MarkAttributeDirty markDirty); +} // namespace TwoWayTalkSupport + +namespace MaxNetworkBandwidth { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace MaxNetworkBandwidth + +namespace CurrentFrameRate { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace CurrentFrameRate + +namespace HDRModeEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace HDRModeEnabled + +namespace SoftRecordingPrivacyModeEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace SoftRecordingPrivacyModeEnabled + +namespace SoftLivestreamPrivacyModeEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace SoftLivestreamPrivacyModeEnabled + +namespace HardPrivacyModeOn { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace HardPrivacyModeOn + +namespace NightVision { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace NightVision + +namespace NightVisionIllum { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace NightVisionIllum + +namespace AWBEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace AWBEnabled + +namespace AutoShutterSpeedEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace AutoShutterSpeedEnabled + +namespace AutoISOEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace AutoISOEnabled + +namespace SpeakerMuted { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace SpeakerMuted + +namespace SpeakerVolumeLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace SpeakerVolumeLevel + +namespace SpeakerMaxLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace SpeakerMaxLevel + +namespace SpeakerMinLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace SpeakerMinLevel + +namespace MicrophoneMuted { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace MicrophoneMuted + +namespace MicrophoneVolumeLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace MicrophoneVolumeLevel + +namespace MicrophoneMaxLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace MicrophoneMaxLevel + +namespace MicrophoneMinLevel { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace MicrophoneMinLevel + +namespace MicrophoneAGCEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace MicrophoneAGCEnabled + +namespace ImageRotation { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ImageRotation + +namespace ImageFlipHorizontal { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace ImageFlipHorizontal + +namespace ImageFlipVertical { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace ImageFlipVertical + +namespace LocalVideoRecordingEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace LocalSnapshotRecordingEnabled + +namespace StatusLightEnabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace StatusLightEnabled + +namespace StatusLightBrightness { +Protocols::InteractionModel::Status Get(EndpointId endpoint, + chip::app::Clusters::Globals::ThreeLevelAutoEnum * value); // ThreeLevelAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::Globals::ThreeLevelAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { +Protocols::InteractionModel::Status +Get(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum * value); // TriStateAutoEnum +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value, + MarkAttributeDirty markDirty); +} // namespace DepthSensorStatus + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { namespace Attributes { @@ -5653,6 +5912,24 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 791d9c0ca8..90be263281 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -618,11 +618,26 @@ void emberAfContentControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ void emberAfWebRTCTransportProviderClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5177,6 +5192,83 @@ chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterServerP */ void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint); +// +// Zone Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterZoneManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfZoneManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterZoneManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterZoneManagementClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfZoneManagementClusterServerTickCallback(chip::EndpointId endpoint); + +// +// Camera AV Stream Management Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterCameraAvStreamManagementClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfCameraAvStreamManagementClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterCameraAvStreamManagementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterCameraAvStreamManagementClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfCameraAvStreamManagementClusterServerTickCallback(chip::EndpointId endpoint); + // // WebRTC Transport Provider Cluster // @@ -5215,6 +5307,44 @@ chip::Protocols::InteractionModel::Status MatterWebRTCTransportProviderClusterSe */ void emberAfWebRTCTransportProviderClusterServerTickCallback(chip::EndpointId endpoint); +// +// WebRTC Transport Requestor Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterWebRTCTransportRequestorClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfWebRTCTransportRequestorClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterWebRTCTransportRequestorClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status MatterWebRTCTransportRequestorClusterServerPreAttributeChangedCallback( + const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfWebRTCTransportRequestorClusterServerTickCallback(chip::EndpointId endpoint); + // // Chime Cluster // @@ -6644,6 +6774,108 @@ bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( bool emberAfContentAppObserverClusterContentAppMessageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData); +/** + * @brief Zone Management Cluster CreateTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterCreateTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster UpdateTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterUpdateTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster GetTwoDCartesianZone Command callback (from client) + */ +bool emberAfZoneManagementClusterGetTwoDCartesianZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::DecodableType & commandData); +/** + * @brief Zone Management Cluster RemoveZone Command callback (from client) + */ +bool emberAfZoneManagementClusterRemoveZoneCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ZoneManagement::Commands::RemoveZone::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster AudioStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterAudioStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster AudioStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterAudioStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamModify Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamModifyCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster VideoStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterVideoStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SnapshotStreamAllocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSnapshotStreamAllocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SnapshotStreamDeallocate Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSnapshotStreamDeallocateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetStreamPriorities Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetStreamPrioritiesCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster CaptureSnapshot Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterCaptureSnapshotCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetViewport Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetViewportCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageRotation Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageRotationCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageFlipHorizontal Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageFlipHorizontalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::DecodableType & commandData); +/** + * @brief Camera AV Stream Management Cluster SetImageFlipVertical Command callback (from client) + */ +bool emberAfCameraAvStreamManagementClusterSetImageFlipVerticalCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::DecodableType & commandData); /** * @brief WebRTC Transport Provider Cluster SolicitOffer Command callback (from client) */ @@ -6674,6 +6906,30 @@ bool emberAfWebRTCTransportProviderClusterProvideICECandidateCallback( bool emberAfWebRTCTransportProviderClusterEndSessionCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster Offer Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterOfferCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster Answer Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterAnswerCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster ICECandidate Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterICECandidateCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::DecodableType & commandData); +/** + * @brief WebRTC Transport Requestor Cluster End Command callback (from client) + */ +bool emberAfWebRTCTransportRequestorClusterEndCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::WebRTCTransportRequestor::Commands::End::DecodableType & commandData); /** * @brief Chime Cluster PlayChimeSound Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 006c91ef14..f877d63b7f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -3568,6 +3568,142 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ContentAppObserver::Sta } } +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::StatusCodeEnum val) +{ + using EnumType = ZoneManagement::StatusCodeEnum; + switch (val) + { + case EnumType::kZoneNotFound: + case EnumType::kZoneInUse: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneEventStoppedReasonEnum val) +{ + using EnumType = ZoneManagement::ZoneEventStoppedReasonEnum; + switch (val) + { + case EnumType::kActionStopped: + case EnumType::kTimeout: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneEventTriggeredReasonEnum val) +{ + using EnumType = ZoneManagement::ZoneEventTriggeredReasonEnum; + switch (val) + { + case EnumType::kMotion: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneSourceEnum val) +{ + using EnumType = ZoneManagement::ZoneSourceEnum; + switch (val) + { + case EnumType::kMfg: + case EnumType::kUser: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneTypeEnum val) +{ + using EnumType = ZoneManagement::ZoneTypeEnum; + switch (val) + { + case EnumType::kTwoDCARTZone: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(ZoneManagement::ZoneUseEnum val) +{ + using EnumType = ZoneManagement::ZoneUseEnum; + switch (val) + { + case EnumType::kMotion: + case EnumType::kPrivacy: + case EnumType::kFocus: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::AudioCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::AudioCodecEnum; + switch (val) + { + case EnumType::kOpus: + case EnumType::kAacLc: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::ImageCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::ImageCodecEnum; + switch (val) + { + case EnumType::kJpeg: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::TriStateAutoEnum val) +{ + using EnumType = CameraAvStreamManagement::TriStateAutoEnum; + switch (val) + { + case EnumType::kOff: + case EnumType::kOn: + case EnumType::kAuto: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::TwoWayTalkSupportTypeEnum val) +{ + using EnumType = CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + switch (val) + { + case EnumType::kNotSupported: + case EnumType::kHalfDuplex: + case EnumType::kFullDuplex: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} +static auto __attribute__((unused)) EnsureKnownEnumValue(CameraAvStreamManagement::VideoCodecEnum val) +{ + using EnumType = CameraAvStreamManagement::VideoCodecEnum; + switch (val) + { + case EnumType::kH264: + case EnumType::kHevc: + case EnumType::kVvc: + case EnumType::kAv1: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(UnitTesting::SimpleEnum val) { using EnumType = UnitTesting::SimpleEnum; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 8a53e03c83..dd7986eaee 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -5448,6 +5448,168 @@ enum class StatusEnum : uint8_t }; } // namespace ContentAppObserver +namespace ZoneManagement { + +// Enum for StatusCodeEnum +enum class StatusCodeEnum : uint8_t +{ + kZoneNotFound = 0x02, + kZoneInUse = 0x03, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 0, +}; + +// Enum for ZoneEventStoppedReasonEnum +enum class ZoneEventStoppedReasonEnum : uint8_t +{ + kActionStopped = 0x00, + kTimeout = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for ZoneEventTriggeredReasonEnum +enum class ZoneEventTriggeredReasonEnum : uint8_t +{ + kMotion = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +// Enum for ZoneSourceEnum +enum class ZoneSourceEnum : uint8_t +{ + kMfg = 0x00, + kUser = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for ZoneTypeEnum +enum class ZoneTypeEnum : uint8_t +{ + kTwoDCARTZone = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +// Enum for ZoneUseEnum +enum class ZoneUseEnum : uint8_t +{ + kMotion = 0x00, + kPrivacy = 0x01, + kFocus = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kTwoDimensionalCartesianZone = 0x1, +}; +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { + +// Enum for AudioCodecEnum +enum class AudioCodecEnum : uint8_t +{ + kOpus = 0x00, + kAacLc = 0x01, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 2, +}; + +// Enum for ImageCodecEnum +enum class ImageCodecEnum : uint8_t +{ + kJpeg = 0x00, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 1, +}; + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +// Enum for TriStateAutoEnum +enum class TriStateAutoEnum : uint8_t +{ + kOff = 0x00, + kOn = 0x01, + kAuto = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Enum for TwoWayTalkSupportTypeEnum +enum class TwoWayTalkSupportTypeEnum : uint8_t +{ + kNotSupported = 0x00, + kHalfDuplex = 0x01, + kFullDuplex = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + +// Enum for VideoCodecEnum +enum class VideoCodecEnum : uint8_t +{ + kH264 = 0x00, + kHevc = 0x01, + kVvc = 0x02, + kAv1 = 0x03, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 4, +}; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kPrivacy = 0x1, + kAudio = 0x2, + kSpeaker = 0x4, + kImageControl = 0x8, + kVideo = 0x10, + kSnapshot = 0x20, + kWatermark = 0x40, + kOnScreenDisplay = 0x80, + kLocalStorage = 0x100, +}; +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { using StreamTypeEnum = Clusters::detail::StreamTypeEnum; @@ -5457,6 +5619,15 @@ using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { + +using StreamTypeEnum = Clusters::detail::StreamTypeEnum; + +using WebRTCEndReasonEnum = Clusters::detail::WebRTCEndReasonEnum; + +using WebRTCMetadataOptions = Clusters::detail::WebRTCMetadataOptions; +} // namespace WebRTCTransportRequestor + namespace Chime {} // namespace Chime namespace EcosystemInformation {} // namespace EcosystemInformation diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 7999de734b..c944864eec 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -555,6 +555,57 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace OperationalStateStruct +namespace ViewportStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kX1), x1); + encoder.Encode(to_underlying(Fields::kY1), y1); + encoder.Encode(to_underlying(Fields::kX2), x2); + encoder.Encode(to_underlying(Fields::kY2), y2); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kX1)) + { + err = DataModel::Decode(reader, x1); + } + else if (__context_tag == to_underlying(Fields::kY1)) + { + err = DataModel::Decode(reader, y1); + } + else if (__context_tag == to_underlying(Fields::kX2)) + { + err = DataModel::Decode(reader, x2); + } + else if (__context_tag == to_underlying(Fields::kY2)) + { + err = DataModel::Decode(reader, y2); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ViewportStruct + namespace WebRTCSessionStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -5275,6 +5326,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, TCAcknowledgements); case Attributes::TCAcknowledgementsRequired::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, TCAcknowledgementsRequired); + case Attributes::TCUpdateDeadline::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, TCUpdateDeadline); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -28590,9 +28643,2068 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre } } // namespace Attributes -namespace Events {} // namespace Events +namespace Events {} // namespace Events + +} // namespace ContentAppObserver +namespace ZoneManagement { +namespace Structs { + +namespace TwoDCartesianVertexStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kX), x); + encoder.Encode(to_underlying(Fields::kY), y); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kX)) + { + err = DataModel::Decode(reader, x); + } + else if (__context_tag == to_underlying(Fields::kY)) + { + err = DataModel::Decode(reader, y); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TwoDCartesianVertexStruct + +namespace TwoDCartesianZoneStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kUse), use); + encoder.Encode(to_underlying(Fields::kVertices), vertices); + encoder.Encode(to_underlying(Fields::kColor), color); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else if (__context_tag == to_underlying(Fields::kUse)) + { + err = DataModel::Decode(reader, use); + } + else if (__context_tag == to_underlying(Fields::kVertices)) + { + err = DataModel::Decode(reader, vertices); + } + else if (__context_tag == to_underlying(Fields::kColor)) + { + err = DataModel::Decode(reader, color); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace TwoDCartesianZoneStruct + +namespace ZoneInformationStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + encoder.Encode(to_underlying(Fields::kZoneType), zoneType); + encoder.Encode(to_underlying(Fields::kZoneSource), zoneSource); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else if (__context_tag == to_underlying(Fields::kZoneType)) + { + err = DataModel::Decode(reader, zoneType); + } + else if (__context_tag == to_underlying(Fields::kZoneSource)) + { + err = DataModel::Decode(reader, zoneSource); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ZoneInformationStruct + +namespace ZoneTriggeringTimeControlStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kInitialDuration), initialDuration); + encoder.Encode(to_underlying(Fields::kAugmentationDuration), augmentationDuration); + encoder.Encode(to_underlying(Fields::kMaxDuration), maxDuration); + encoder.Encode(to_underlying(Fields::kBlindDuration), blindDuration); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kInitialDuration)) + { + err = DataModel::Decode(reader, initialDuration); + } + else if (__context_tag == to_underlying(Fields::kAugmentationDuration)) + { + err = DataModel::Decode(reader, augmentationDuration); + } + else if (__context_tag == to_underlying(Fields::kMaxDuration)) + { + err = DataModel::Decode(reader, maxDuration); + } + else if (__context_tag == to_underlying(Fields::kBlindDuration)) + { + err = DataModel::Decode(reader, blindDuration); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ZoneTriggeringTimeControlStruct +} // namespace Structs + +namespace Commands { +namespace CreateTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZone), zone); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZone)) + { + err = DataModel::Decode(reader, zone); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CreateTwoDCartesianZone. +namespace CreateTwoDCartesianZoneResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CreateTwoDCartesianZoneResponse. +namespace UpdateTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + encoder.Encode(to_underlying(Fields::kZone), zone); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else if (__context_tag == to_underlying(Fields::kZone)) + { + err = DataModel::Decode(reader, zone); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace UpdateTwoDCartesianZone. +namespace GetTwoDCartesianZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTwoDCartesianZone. +namespace GetTwoDCartesianZoneResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZones), zones); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GetTwoDCartesianZoneResponse. +namespace RemoveZone { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kZoneID), zoneID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZoneID)) + { + err = DataModel::Decode(reader, zoneID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace RemoveZone. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::SupportedZoneSources::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedZoneSources); + case Attributes::Zones::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, zones); + case Attributes::TimeControl::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, timeControl); + case Attributes::Sensitivity::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, sensitivity); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace ZoneTriggered { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kZones), zones)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ZoneTriggered. +namespace ZoneStopped { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kZones), zones)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReason), reason)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kZones)) + { + err = DataModel::Decode(reader, zones); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ZoneStopped. +} // namespace Events + +} // namespace ZoneManagement +namespace CameraAvStreamManagement { +namespace Structs { + +namespace VideoResolutionStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWidth), width); + encoder.Encode(to_underlying(Fields::kHeight), height); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWidth)) + { + err = DataModel::Decode(reader, width); + } + else if (__context_tag == to_underlying(Fields::kHeight)) + { + err = DataModel::Decode(reader, height); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoResolutionStruct + +namespace VideoStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kVideoCodec), videoCodec); + encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate); + encoder.Encode(to_underlying(Fields::kMinFragmentLen), minFragmentLen); + encoder.Encode(to_underlying(Fields::kMaxFragmentLen), maxFragmentLen); + encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); + encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kVideoCodec)) + { + err = DataModel::Decode(reader, videoCodec); + } + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) + { + err = DataModel::Decode(reader, minFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) + { + err = DataModel::Decode(reader, maxBitRate); + } + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) + { + err = DataModel::Decode(reader, minFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) + { + err = DataModel::Decode(reader, maxFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) + { + err = DataModel::Decode(reader, watermarkEnabled); + } + else if (__context_tag == to_underlying(Fields::kOSDEnabled)) + { + err = DataModel::Decode(reader, OSDEnabled); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoStreamStruct + +namespace SnapshotStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kFrameRate), frameRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kQuality), quality); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kFrameRate)) + { + err = DataModel::Decode(reader, frameRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kQuality)) + { + err = DataModel::Decode(reader, quality); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace SnapshotStreamStruct + +namespace SnapshotParamsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kResolution), resolution); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace SnapshotParamsStruct + +namespace RateDistortionTradeOffPointsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kCodec), codec); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kCodec)) + { + err = DataModel::Decode(reader, codec); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace RateDistortionTradeOffPointsStruct + +namespace AudioCapabilitiesStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kMaxNumberOfChannels), maxNumberOfChannels); + encoder.Encode(to_underlying(Fields::kSupportedCodecs), supportedCodecs); + encoder.Encode(to_underlying(Fields::kSupportedSampleRates), supportedSampleRates); + encoder.Encode(to_underlying(Fields::kSupportedBitDepths), supportedBitDepths); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kMaxNumberOfChannels)) + { + err = DataModel::Decode(reader, maxNumberOfChannels); + } + else if (__context_tag == to_underlying(Fields::kSupportedCodecs)) + { + err = DataModel::Decode(reader, supportedCodecs); + } + else if (__context_tag == to_underlying(Fields::kSupportedSampleRates)) + { + err = DataModel::Decode(reader, supportedSampleRates); + } + else if (__context_tag == to_underlying(Fields::kSupportedBitDepths)) + { + err = DataModel::Decode(reader, supportedBitDepths); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AudioCapabilitiesStruct + +namespace AudioStreamStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec); + encoder.Encode(to_underlying(Fields::kChannelCount), channelCount); + encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth); + encoder.Encode(to_underlying(Fields::kReferenceCount), referenceCount); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kAudioCodec)) + { + err = DataModel::Decode(reader, audioCodec); + } + else if (__context_tag == to_underlying(Fields::kChannelCount)) + { + err = DataModel::Decode(reader, channelCount); + } + else if (__context_tag == to_underlying(Fields::kSampleRate)) + { + err = DataModel::Decode(reader, sampleRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kBitDepth)) + { + err = DataModel::Decode(reader, bitDepth); + } + else if (__context_tag == to_underlying(Fields::kReferenceCount)) + { + err = DataModel::Decode(reader, referenceCount); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AudioStreamStruct + +namespace VideoSensorParamsStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSensorWidth), sensorWidth); + encoder.Encode(to_underlying(Fields::kSensorHeight), sensorHeight); + encoder.Encode(to_underlying(Fields::kHDRCapable), HDRCapable); + encoder.Encode(to_underlying(Fields::kMaxFPS), maxFPS); + encoder.Encode(to_underlying(Fields::kMaxHDRFPS), maxHDRFPS); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSensorWidth)) + { + err = DataModel::Decode(reader, sensorWidth); + } + else if (__context_tag == to_underlying(Fields::kSensorHeight)) + { + err = DataModel::Decode(reader, sensorHeight); + } + else if (__context_tag == to_underlying(Fields::kHDRCapable)) + { + err = DataModel::Decode(reader, HDRCapable); + } + else if (__context_tag == to_underlying(Fields::kMaxFPS)) + { + err = DataModel::Decode(reader, maxFPS); + } + else if (__context_tag == to_underlying(Fields::kMaxHDRFPS)) + { + err = DataModel::Decode(reader, maxHDRFPS); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace VideoSensorParamsStruct +} // namespace Structs + +namespace Commands { +namespace AudioStreamAllocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kAudioCodec), audioCodec); + encoder.Encode(to_underlying(Fields::kChannelCount), channelCount); + encoder.Encode(to_underlying(Fields::kSampleRate), sampleRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kBitDepth), bitDepth); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kAudioCodec)) + { + err = DataModel::Decode(reader, audioCodec); + } + else if (__context_tag == to_underlying(Fields::kChannelCount)) + { + err = DataModel::Decode(reader, channelCount); + } + else if (__context_tag == to_underlying(Fields::kSampleRate)) + { + err = DataModel::Decode(reader, sampleRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kBitDepth)) + { + err = DataModel::Decode(reader, bitDepth); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamAllocate. +namespace AudioStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamAllocateResponse. +namespace AudioStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAudioStreamID), audioStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamDeallocate. +namespace VideoStreamAllocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamType), streamType); + encoder.Encode(to_underlying(Fields::kVideoCodec), videoCodec); + encoder.Encode(to_underlying(Fields::kMinFrameRate), minFrameRate); + encoder.Encode(to_underlying(Fields::kMaxFrameRate), maxFrameRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kMinBitRate), minBitRate); + encoder.Encode(to_underlying(Fields::kMaxBitRate), maxBitRate); + encoder.Encode(to_underlying(Fields::kMinFragmentLen), minFragmentLen); + encoder.Encode(to_underlying(Fields::kMaxFragmentLen), maxFragmentLen); + encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); + encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kVideoCodec)) + { + err = DataModel::Decode(reader, videoCodec); + } + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) + { + err = DataModel::Decode(reader, minFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) + { + err = DataModel::Decode(reader, maxBitRate); + } + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) + { + err = DataModel::Decode(reader, minFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) + { + err = DataModel::Decode(reader, maxFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) + { + err = DataModel::Decode(reader, watermarkEnabled); + } + else if (__context_tag == to_underlying(Fields::kOSDEnabled)) + { + err = DataModel::Decode(reader, OSDEnabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamAllocate. +namespace VideoStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamAllocateResponse. +namespace VideoStreamModify { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + encoder.Encode(to_underlying(Fields::kWatermarkEnabled), watermarkEnabled); + encoder.Encode(to_underlying(Fields::kOSDEnabled), OSDEnabled); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else if (__context_tag == to_underlying(Fields::kWatermarkEnabled)) + { + err = DataModel::Decode(reader, watermarkEnabled); + } + else if (__context_tag == to_underlying(Fields::kOSDEnabled)) + { + err = DataModel::Decode(reader, OSDEnabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamModify. +namespace VideoStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kVideoStreamID), videoStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamDeallocate. +namespace SnapshotStreamAllocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kFrameRate), frameRate); + encoder.Encode(to_underlying(Fields::kBitRate), bitRate); + encoder.Encode(to_underlying(Fields::kMinResolution), minResolution); + encoder.Encode(to_underlying(Fields::kMaxResolution), maxResolution); + encoder.Encode(to_underlying(Fields::kQuality), quality); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kFrameRate)) + { + err = DataModel::Decode(reader, frameRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kQuality)) + { + err = DataModel::Decode(reader, quality); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamAllocate. +namespace SnapshotStreamAllocateResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamAllocateResponse. +namespace SnapshotStreamDeallocate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamDeallocate. +namespace SetStreamPriorities { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kStreamPriorities), streamPriorities); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kStreamPriorities)) + { + err = DataModel::Decode(reader, streamPriorities); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetStreamPriorities. +namespace CaptureSnapshot { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kSnapshotStreamID), snapshotStreamID); + encoder.Encode(to_underlying(Fields::kRequestedResolution), requestedResolution); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else if (__context_tag == to_underlying(Fields::kRequestedResolution)) + { + err = DataModel::Decode(reader, requestedResolution); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CaptureSnapshot. +namespace CaptureSnapshotResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kData), data); + encoder.Encode(to_underlying(Fields::kImageCodec), imageCodec); + encoder.Encode(to_underlying(Fields::kResolution), resolution); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kData)) + { + err = DataModel::Decode(reader, data); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kResolution)) + { + err = DataModel::Decode(reader, resolution); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace CaptureSnapshotResponse. +namespace SetViewport { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kViewport), viewport); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kViewport)) + { + err = DataModel::Decode(reader, viewport); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetViewport. +namespace SetImageRotation { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAngle), angle); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAngle)) + { + err = DataModel::Decode(reader, angle); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageRotation. +namespace SetImageFlipHorizontal { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageFlipHorizontal. +namespace SetImageFlipVertical { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kEnabled), enabled); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kEnabled)) + { + err = DataModel::Decode(reader, enabled); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SetImageFlipVertical. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::MaxConcurrentVideoEncoders::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxConcurrentVideoEncoders); + case Attributes::MaxEncodedPixelRate::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxEncodedPixelRate); + case Attributes::VideoSensorParams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, videoSensorParams); + case Attributes::NightVisionCapable::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVisionCapable); + case Attributes::MinViewport::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, minViewport); + case Attributes::RateDistortionTradeOffPoints::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, rateDistortionTradeOffPoints); + case Attributes::MaxPreRollBufferSize::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxPreRollBufferSize); + case Attributes::MicrophoneCapabilities::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneCapabilities); + case Attributes::SpeakerCapabilities::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerCapabilities); + case Attributes::TwoWayTalkSupport::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, twoWayTalkSupport); + case Attributes::SupportedSnapshotParams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, supportedSnapshotParams); + case Attributes::MaxNetworkBandwidth::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, maxNetworkBandwidth); + case Attributes::CurrentFrameRate::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentFrameRate); + case Attributes::HDRModeEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, HDRModeEnabled); + case Attributes::CurrentVideoCodecs::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentVideoCodecs); + case Attributes::CurrentSnapshotConfig::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentSnapshotConfig); + case Attributes::FabricsUsingCamera::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, fabricsUsingCamera); + case Attributes::AllocatedVideoStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedVideoStreams); + case Attributes::AllocatedAudioStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedAudioStreams); + case Attributes::AllocatedSnapshotStreams::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, allocatedSnapshotStreams); + case Attributes::RankedVideoStreamPrioritiesList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, rankedVideoStreamPrioritiesList); + case Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, softRecordingPrivacyModeEnabled); + case Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, softLivestreamPrivacyModeEnabled); + case Attributes::HardPrivacyModeOn::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, hardPrivacyModeOn); + case Attributes::NightVision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVision); + case Attributes::NightVisionIllum::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nightVisionIllum); + case Attributes::AWBEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, AWBEnabled); + case Attributes::AutoShutterSpeedEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, autoShutterSpeedEnabled); + case Attributes::AutoISOEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, autoISOEnabled); + case Attributes::Viewport::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, viewport); + case Attributes::SpeakerMuted::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerMuted); + case Attributes::SpeakerVolumeLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerVolumeLevel); + case Attributes::SpeakerMaxLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerMaxLevel); + case Attributes::SpeakerMinLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, speakerMinLevel); + case Attributes::MicrophoneMuted::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneMuted); + case Attributes::MicrophoneVolumeLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneVolumeLevel); + case Attributes::MicrophoneMaxLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneMaxLevel); + case Attributes::MicrophoneMinLevel::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneMinLevel); + case Attributes::MicrophoneAGCEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, microphoneAGCEnabled); + case Attributes::ImageRotation::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageRotation); + case Attributes::ImageFlipHorizontal::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageFlipHorizontal); + case Attributes::ImageFlipVertical::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, imageFlipVertical); + case Attributes::LocalVideoRecordingEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, localVideoRecordingEnabled); + case Attributes::LocalSnapshotRecordingEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, localSnapshotRecordingEnabled); + case Attributes::StatusLightEnabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, statusLightEnabled); + case Attributes::StatusLightBrightness::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, statusLightBrightness); + case Attributes::DepthSensorStatus::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, depthSensorStatus); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events { +namespace VideoStreamChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kVideoStreamID), videoStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStreamType), streamType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kVideoCodec), videoCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinFrameRate), minFrameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxFrameRate), maxFrameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinResolution), minResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxResolution), maxResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinBitRate), minBitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxBitRate), maxBitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinFragmentLen), minFragmentLen)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxFragmentLen), maxFragmentLen)); + return aWriter.EndContainer(outer); +} -} // namespace ContentAppObserver +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kVideoStreamID)) + { + err = DataModel::Decode(reader, videoStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kVideoCodec)) + { + err = DataModel::Decode(reader, videoCodec); + } + else if (__context_tag == to_underlying(Fields::kMinFrameRate)) + { + err = DataModel::Decode(reader, minFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMaxFrameRate)) + { + err = DataModel::Decode(reader, maxFrameRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kMinBitRate)) + { + err = DataModel::Decode(reader, minBitRate); + } + else if (__context_tag == to_underlying(Fields::kMaxBitRate)) + { + err = DataModel::Decode(reader, maxBitRate); + } + else if (__context_tag == to_underlying(Fields::kMinFragmentLen)) + { + err = DataModel::Decode(reader, minFragmentLen); + } + else if (__context_tag == to_underlying(Fields::kMaxFragmentLen)) + { + err = DataModel::Decode(reader, maxFragmentLen); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace VideoStreamChanged. +namespace AudioStreamChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAudioStreamID), audioStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStreamType), streamType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAudioCodec), audioCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kChannelCount), channelCount)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSampleRate), sampleRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitRate), bitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitDepth), bitDepth)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kAudioStreamID)) + { + err = DataModel::Decode(reader, audioStreamID); + } + else if (__context_tag == to_underlying(Fields::kStreamType)) + { + err = DataModel::Decode(reader, streamType); + } + else if (__context_tag == to_underlying(Fields::kAudioCodec)) + { + err = DataModel::Decode(reader, audioCodec); + } + else if (__context_tag == to_underlying(Fields::kChannelCount)) + { + err = DataModel::Decode(reader, channelCount); + } + else if (__context_tag == to_underlying(Fields::kSampleRate)) + { + err = DataModel::Decode(reader, sampleRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kBitDepth)) + { + err = DataModel::Decode(reader, bitDepth); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace AudioStreamChanged. +namespace SnapshotStreamChanged { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kSnapshotStreamID), snapshotStreamID)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kImageCodec), imageCodec)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kFrameRate), frameRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kBitRate), bitRate)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMinResolution), minResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kMaxResolution), maxResolution)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kQuality), quality)); + return aWriter.EndContainer(outer); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kSnapshotStreamID)) + { + err = DataModel::Decode(reader, snapshotStreamID); + } + else if (__context_tag == to_underlying(Fields::kImageCodec)) + { + err = DataModel::Decode(reader, imageCodec); + } + else if (__context_tag == to_underlying(Fields::kFrameRate)) + { + err = DataModel::Decode(reader, frameRate); + } + else if (__context_tag == to_underlying(Fields::kBitRate)) + { + err = DataModel::Decode(reader, bitRate); + } + else if (__context_tag == to_underlying(Fields::kMinResolution)) + { + err = DataModel::Decode(reader, minResolution); + } + else if (__context_tag == to_underlying(Fields::kMaxResolution)) + { + err = DataModel::Decode(reader, maxResolution); + } + else if (__context_tag == to_underlying(Fields::kQuality)) + { + err = DataModel::Decode(reader, quality); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace SnapshotStreamChanged. +} // namespace Events + +} // namespace CameraAvStreamManagement namespace WebRTCTransportProvider { namespace Structs {} // namespace Structs @@ -28965,6 +31077,206 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Structs {} // namespace Structs + +namespace Commands { +namespace Offer { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kSdp), sdp); + encoder.Encode(to_underlying(Fields::kICEServers), ICEServers); + encoder.Encode(to_underlying(Fields::kICETransportPolicy), ICETransportPolicy); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kSdp)) + { + err = DataModel::Decode(reader, sdp); + } + else if (__context_tag == to_underlying(Fields::kICEServers)) + { + err = DataModel::Decode(reader, ICEServers); + } + else if (__context_tag == to_underlying(Fields::kICETransportPolicy)) + { + err = DataModel::Decode(reader, ICETransportPolicy); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Offer. +namespace Answer { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kSdp), sdp); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kSdp)) + { + err = DataModel::Decode(reader, sdp); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace Answer. +namespace ICECandidate { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kICECandidate), ICECandidate); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kICECandidate)) + { + err = DataModel::Decode(reader, ICECandidate); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace ICECandidate. +namespace End { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kWebRTCSessionID), webRTCSessionID); + encoder.Encode(to_underlying(Fields::kReason), reason); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kWebRTCSessionID)) + { + err = DataModel::Decode(reader, webRTCSessionID); + } + else if (__context_tag == to_underlying(Fields::kReason)) + { + err = DataModel::Decode(reader, reason); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace End. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::CurrentSessions::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, currentSessions); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace WebRTCTransportRequestor namespace Chime { namespace Structs { @@ -32988,6 +35300,20 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::ZoneManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } + case Clusters::CameraAvStreamManagement::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::WebRTCTransportProvider::Id: { switch (aCommand) { @@ -32995,6 +35321,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::WebRTCTransportRequestor::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::Chime::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2917e4c924..dd701f8210 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -326,6 +326,33 @@ struct Type using DecodableType = Type; } // namespace OperationalStateStruct +namespace ViewportStruct { +enum class Fields : uint8_t +{ + kX1 = 0, + kY1 = 1, + kX2 = 2, + kY2 = 3, +}; + +struct Type +{ +public: + uint16_t x1 = static_cast(0); + uint16_t y1 = static_cast(0); + uint16_t x2 = static_cast(0); + uint16_t y2 = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ViewportStruct namespace WebRTCSessionStruct { enum class Fields : uint8_t { @@ -6533,6 +6560,18 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::GeneralCommissioning::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TCUpdateDeadline::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TCUpdateDeadline namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -6589,6 +6628,7 @@ struct TypeInfo Attributes::TCMinRequiredVersion::TypeInfo::DecodableType TCMinRequiredVersion = static_cast(0); Attributes::TCAcknowledgements::TypeInfo::DecodableType TCAcknowledgements = static_cast(0); Attributes::TCAcknowledgementsRequired::TypeInfo::DecodableType TCAcknowledgementsRequired = static_cast(0); + Attributes::TCUpdateDeadline::TypeInfo::DecodableType TCUpdateDeadline = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -41265,124 +41305,175 @@ struct TypeInfo }; } // namespace Attributes } // namespace ContentAppObserver -namespace WebRTCTransportProvider { +namespace ZoneManagement { namespace Structs { -namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; -namespace WebRTCSessionStruct = Clusters::detail::Structs::WebRTCSessionStruct; -} // namespace Structs +namespace TwoDCartesianVertexStruct { +enum class Fields : uint8_t +{ + kX = 0, + kY = 1, +}; -namespace Commands { -// Forward-declarations so we can reference these later. +struct Type +{ +public: + uint16_t x = static_cast(0); + uint16_t y = static_cast(0); -namespace SolicitOffer { -struct Type; -struct DecodableType; -} // namespace SolicitOffer + CHIP_ERROR Decode(TLV::TLVReader & reader); -namespace SolicitOfferResponse { -struct Type; -struct DecodableType; -} // namespace SolicitOfferResponse + static constexpr bool kIsFabricScoped = false; -namespace ProvideOffer { -struct Type; -struct DecodableType; -} // namespace ProvideOffer + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; -namespace ProvideOfferResponse { -struct Type; -struct DecodableType; -} // namespace ProvideOfferResponse +using DecodableType = Type; -namespace ProvideAnswer { -struct Type; -struct DecodableType; -} // namespace ProvideAnswer +} // namespace TwoDCartesianVertexStruct +namespace TwoDCartesianZoneStruct { +enum class Fields : uint8_t +{ + kName = 0, + kUse = 1, + kVertices = 2, + kColor = 3, +}; -namespace ProvideICECandidate { -struct Type; -struct DecodableType; -} // namespace ProvideICECandidate +struct Type +{ +public: + chip::CharSpan name; + ZoneUseEnum use = static_cast(0); + DataModel::List vertices; + Optional color; -namespace EndSession { -struct Type; -struct DecodableType; -} // namespace EndSession + static constexpr bool kIsFabricScoped = false; -} // namespace Commands + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; -namespace Commands { -namespace SolicitOffer { +struct DecodableType +{ +public: + chip::CharSpan name; + ZoneUseEnum use = static_cast(0); + DataModel::DecodableList vertices; + Optional color; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace TwoDCartesianZoneStruct +namespace ZoneInformationStruct { enum class Fields : uint8_t { - kStreamType = 0, - kVideoStreamID = 1, - kAudioStreamID = 2, - kICEServers = 3, - kICETransportPolicy = 4, - kMetadataOptions = 5, + kZoneID = 0, + kZoneType = 1, + kZoneSource = 2, }; struct Type { public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SolicitOffer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + uint16_t zoneID = static_cast(0); + ZoneTypeEnum zoneType = static_cast(0); + ZoneSourceEnum zoneSource = static_cast(0); - StreamTypeEnum streamType = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; - Optional> ICEServers; - Optional ICETransportPolicy; - Optional> metadataOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; - using ResponseType = Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType; +using DecodableType = Type; - static constexpr bool MustUseTimedInvoke() { return false; } +} // namespace ZoneInformationStruct +namespace ZoneTriggeringTimeControlStruct { +enum class Fields : uint8_t +{ + kInitialDuration = 0, + kAugmentationDuration = 1, + kMaxDuration = 2, + kBlindDuration = 3, }; -struct DecodableType +struct Type { public: - static constexpr CommandId GetCommandId() { return Commands::SolicitOffer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + uint16_t initialDuration = static_cast(0); + uint16_t augmentationDuration = static_cast(0); + uint32_t maxDuration = static_cast(0); + uint16_t blindDuration = static_cast(0); - StreamTypeEnum streamType = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; - Optional> ICEServers; - Optional ICETransportPolicy; - Optional> metadataOptions; CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; -}; // namespace SolicitOffer -namespace SolicitOfferResponse { + +using DecodableType = Type; + +} // namespace ZoneTriggeringTimeControlStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace CreateTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace CreateTwoDCartesianZone + +namespace CreateTwoDCartesianZoneResponse { +struct Type; +struct DecodableType; +} // namespace CreateTwoDCartesianZoneResponse + +namespace UpdateTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace UpdateTwoDCartesianZone + +namespace GetTwoDCartesianZone { +struct Type; +struct DecodableType; +} // namespace GetTwoDCartesianZone + +namespace GetTwoDCartesianZoneResponse { +struct Type; +struct DecodableType; +} // namespace GetTwoDCartesianZoneResponse + +namespace RemoveZone { +struct Type; +struct DecodableType; +} // namespace RemoveZone + +} // namespace Commands + +namespace Commands { +namespace CreateTwoDCartesianZone { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kDeferredOffer = 1, - kVideoStreamID = 2, - kAudioStreamID = 3, + kZone = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SolicitOfferResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - bool deferredOffer = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; + Structs::TwoDCartesianZoneStruct::Type zone; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -41390,48 +41481,31 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::SolicitOfferResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - bool deferredOffer = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; + Structs::TwoDCartesianZoneStruct::DecodableType zone; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace SolicitOfferResponse -namespace ProvideOffer { +}; // namespace CreateTwoDCartesianZone +namespace CreateTwoDCartesianZoneResponse { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kSdp = 1, - kStreamType = 2, - kVideoStreamID = 3, - kAudioStreamID = 4, - kICEServers = 5, - kICETransportPolicy = 6, - kMetadataOptions = 7, + kZoneID = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ProvideOffer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - DataModel::Nullable webRTCSessionID; - chip::CharSpan sdp; - StreamTypeEnum streamType = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; - Optional> ICEServers; - Optional ICETransportPolicy; - Optional> metadataOptions; + uint16_t zoneID = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - using ResponseType = Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType; + using ResponseType = DataModel::NullObjectType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -41439,38 +41513,29 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ProvideOffer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::CreateTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - DataModel::Nullable webRTCSessionID; - chip::CharSpan sdp; - StreamTypeEnum streamType = static_cast(0); - Optional> videoStreamID; - Optional> audioStreamID; - Optional> ICEServers; - Optional ICETransportPolicy; - Optional> metadataOptions; + uint16_t zoneID = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ProvideOffer -namespace ProvideOfferResponse { +}; // namespace CreateTwoDCartesianZoneResponse +namespace UpdateTwoDCartesianZone { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kVideoStreamID = 1, - kAudioStreamID = 2, + kZoneID = 0, + kZone = 1, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ProvideOfferResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - uint16_t videoStreamID = static_cast(0); - uint16_t audioStreamID = static_cast(0); + uint16_t zoneID = static_cast(0); + Structs::TwoDCartesianZoneStruct::Type zone; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -41482,35 +41547,32 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ProvideOfferResponse::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::UpdateTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - uint16_t videoStreamID = static_cast(0); - uint16_t audioStreamID = static_cast(0); + uint16_t zoneID = static_cast(0); + Structs::TwoDCartesianZoneStruct::DecodableType zone; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ProvideOfferResponse -namespace ProvideAnswer { +}; // namespace UpdateTwoDCartesianZone +namespace GetTwoDCartesianZone { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kSdp = 1, + kZoneID = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ProvideAnswer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan sdp; + Optional> zoneID; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -41518,30 +41580,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ProvideAnswer::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan sdp; + Optional> zoneID; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ProvideAnswer -namespace ProvideICECandidate { +}; // namespace GetTwoDCartesianZone +namespace GetTwoDCartesianZoneResponse { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kICECandidate = 1, + kZones = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidate::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::List zones; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -41553,30 +41612,27 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidate::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::GetTwoDCartesianZoneResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - chip::CharSpan ICECandidate; + DataModel::DecodableList zones; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace ProvideICECandidate -namespace EndSession { +}; // namespace GetTwoDCartesianZoneResponse +namespace RemoveZone { enum class Fields : uint8_t { - kWebRTCSessionID = 0, - kReason = 1, + kZoneID = 0, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - WebRTCEndReasonEnum reason = static_cast(0); + uint16_t zoneID = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -41588,66 +41644,104 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr CommandId GetCommandId() { return Commands::RemoveZone::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } - uint16_t webRTCSessionID = static_cast(0); - WebRTCEndReasonEnum reason = static_cast(0); + uint16_t zoneID = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace EndSession +}; // namespace RemoveZone } // namespace Commands namespace Attributes { -namespace CurrentSessions { +namespace SupportedZoneSources { struct TypeInfo { - using Type = chip::app::DataModel::List; + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedZoneSources::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedZoneSources +namespace Zones { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Zones::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Zones +namespace TimeControl { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType>; + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType>; using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType> &; + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> &; - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSessions::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TimeControl::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace CurrentSessions +} // namespace TimeControl +namespace Sensitivity { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Sensitivity::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Sensitivity namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace GeneratedCommandList namespace AcceptedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace AcceptedCommandList namespace EventList { struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace EventList namespace AttributeList { struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace AttributeList namespace FeatureMap { struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace FeatureMap namespace ClusterRevision { struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } }; } // namespace ClusterRevision @@ -41655,11 +41749,14 @@ struct TypeInfo { struct DecodableType { - static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::CurrentSessions::TypeInfo::DecodableType currentSessions; + Attributes::SupportedZoneSources::TypeInfo::DecodableType supportedZoneSources; + Attributes::Zones::TypeInfo::DecodableType zones; + Attributes::TimeControl::TypeInfo::DecodableType timeControl; + Attributes::Sensitivity::TypeInfo::DecodableType sensitivity = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -41669,7 +41766,2573 @@ struct TypeInfo }; }; } // namespace Attributes -} // namespace WebRTCTransportProvider +namespace Events { +namespace ZoneTriggered { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kZones = 0, + kReason = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneTriggered::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List zones; + ZoneEventTriggeredReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneTriggered::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::DecodableList zones; + ZoneEventTriggeredReasonEnum reason = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ZoneTriggered +namespace ZoneStopped { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kZones = 0, + kReason = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + DataModel::List zones; + ZoneEventStoppedReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::ZoneStopped::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ZoneManagement::Id; } + + DataModel::DecodableList zones; + ZoneEventStoppedReasonEnum reason = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ZoneStopped +} // namespace Events +} // namespace ZoneManagement +namespace CameraAvStreamManagement { +namespace Structs { +namespace VideoResolutionStruct { +enum class Fields : uint8_t +{ + kWidth = 0, + kHeight = 1, +}; + +struct Type +{ +public: + uint16_t width = static_cast(0); + uint16_t height = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace VideoResolutionStruct +namespace VideoStreamStruct { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kStreamType = 1, + kVideoCodec = 2, + kMinFrameRate = 3, + kMaxFrameRate = 4, + kMinResolution = 5, + kMaxResolution = 6, + kMinBitRate = 7, + kMaxBitRate = 8, + kMinFragmentLen = 9, + kMaxFragmentLen = 10, + kWatermarkEnabled = 11, + kOSDEnabled = 12, + kReferenceCount = 13, +}; + +struct Type +{ +public: + uint16_t videoStreamID = static_cast(0); + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint32_t minBitRate = static_cast(0); + uint32_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + Optional watermarkEnabled; + Optional OSDEnabled; + uint8_t referenceCount = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace VideoStreamStruct +namespace SnapshotStreamStruct { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kImageCodec = 1, + kFrameRate = 2, + kBitRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kQuality = 6, + kReferenceCount = 7, +}; + +struct Type +{ +public: + uint16_t snapshotStreamID = static_cast(0); + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint8_t quality = static_cast(0); + uint8_t referenceCount = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace SnapshotStreamStruct +namespace SnapshotParamsStruct { +enum class Fields : uint8_t +{ + kResolution = 0, + kMaxFrameRate = 1, + kImageCodec = 2, +}; + +struct Type +{ +public: + Structs::VideoResolutionStruct::Type resolution; + uint16_t maxFrameRate = static_cast(0); + ImageCodecEnum imageCodec = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace SnapshotParamsStruct +namespace RateDistortionTradeOffPointsStruct { +enum class Fields : uint8_t +{ + kCodec = 0, + kResolution = 1, + kMinBitRate = 2, +}; + +struct Type +{ +public: + VideoCodecEnum codec = static_cast(0); + Structs::VideoResolutionStruct::Type resolution; + uint32_t minBitRate = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace RateDistortionTradeOffPointsStruct +namespace AudioCapabilitiesStruct { +enum class Fields : uint8_t +{ + kMaxNumberOfChannels = 0, + kSupportedCodecs = 1, + kSupportedSampleRates = 2, + kSupportedBitDepths = 3, +}; + +struct Type +{ +public: + uint8_t maxNumberOfChannels = static_cast(0); + DataModel::List supportedCodecs; + DataModel::List supportedSampleRates; + DataModel::List supportedBitDepths; + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + uint8_t maxNumberOfChannels = static_cast(0); + DataModel::DecodableList supportedCodecs; + DataModel::DecodableList supportedSampleRates; + DataModel::DecodableList supportedBitDepths; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; +}; + +} // namespace AudioCapabilitiesStruct +namespace AudioStreamStruct { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, + kStreamType = 1, + kAudioCodec = 2, + kChannelCount = 3, + kSampleRate = 4, + kBitRate = 5, + kBitDepth = 6, + kReferenceCount = 7, +}; + +struct Type +{ +public: + uint16_t audioStreamID = static_cast(0); + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + uint8_t referenceCount = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace AudioStreamStruct +namespace VideoSensorParamsStruct { +enum class Fields : uint8_t +{ + kSensorWidth = 0, + kSensorHeight = 1, + kHDRCapable = 2, + kMaxFPS = 3, + kMaxHDRFPS = 4, +}; + +struct Type +{ +public: + uint16_t sensorWidth = static_cast(0); + uint16_t sensorHeight = static_cast(0); + bool HDRCapable = static_cast(0); + uint16_t maxFPS = static_cast(0); + uint16_t maxHDRFPS = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace VideoSensorParamsStruct +namespace ViewportStruct = Clusters::detail::Structs::ViewportStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace AudioStreamAllocate { +struct Type; +struct DecodableType; +} // namespace AudioStreamAllocate + +namespace AudioStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace AudioStreamAllocateResponse + +namespace AudioStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace AudioStreamDeallocate + +namespace VideoStreamAllocate { +struct Type; +struct DecodableType; +} // namespace VideoStreamAllocate + +namespace VideoStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace VideoStreamAllocateResponse + +namespace VideoStreamModify { +struct Type; +struct DecodableType; +} // namespace VideoStreamModify + +namespace VideoStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace VideoStreamDeallocate + +namespace SnapshotStreamAllocate { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamAllocate + +namespace SnapshotStreamAllocateResponse { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamAllocateResponse + +namespace SnapshotStreamDeallocate { +struct Type; +struct DecodableType; +} // namespace SnapshotStreamDeallocate + +namespace SetStreamPriorities { +struct Type; +struct DecodableType; +} // namespace SetStreamPriorities + +namespace CaptureSnapshot { +struct Type; +struct DecodableType; +} // namespace CaptureSnapshot + +namespace CaptureSnapshotResponse { +struct Type; +struct DecodableType; +} // namespace CaptureSnapshotResponse + +namespace SetViewport { +struct Type; +struct DecodableType; +} // namespace SetViewport + +namespace SetImageRotation { +struct Type; +struct DecodableType; +} // namespace SetImageRotation + +namespace SetImageFlipHorizontal { +struct Type; +struct DecodableType; +} // namespace SetImageFlipHorizontal + +namespace SetImageFlipVertical { +struct Type; +struct DecodableType; +} // namespace SetImageFlipVertical + +} // namespace Commands + +namespace Commands { +namespace AudioStreamAllocate { +enum class Fields : uint8_t +{ + kStreamType = 0, + kAudioCodec = 1, + kChannelCount = 2, + kSampleRate = 3, + kBitRate = 4, + kBitDepth = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + AudioCodecEnum audioCodec = static_cast(0); + uint8_t channelCount = static_cast(0); + uint32_t sampleRate = static_cast(0); + uint32_t bitRate = static_cast(0); + uint8_t bitDepth = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamAllocate +namespace AudioStreamAllocateResponse { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AudioStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamAllocateResponse +namespace AudioStreamDeallocate { +enum class Fields : uint8_t +{ + kAudioStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AudioStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AudioStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AudioStreamDeallocate +namespace VideoStreamAllocate { +enum class Fields : uint8_t +{ + kStreamType = 0, + kVideoCodec = 1, + kMinFrameRate = 2, + kMaxFrameRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kMinBitRate = 6, + kMaxBitRate = 7, + kMinFragmentLen = 8, + kMaxFragmentLen = 9, + kWatermarkEnabled = 10, + kOSDEnabled = 11, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint32_t minBitRate = static_cast(0); + uint32_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + Optional watermarkEnabled; + Optional OSDEnabled; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + StreamTypeEnum streamType = static_cast(0); + VideoCodecEnum videoCodec = static_cast(0); + uint16_t minFrameRate = static_cast(0); + uint16_t maxFrameRate = static_cast(0); + Structs::VideoResolutionStruct::DecodableType minResolution; + Structs::VideoResolutionStruct::DecodableType maxResolution; + uint32_t minBitRate = static_cast(0); + uint32_t maxBitRate = static_cast(0); + uint16_t minFragmentLen = static_cast(0); + uint16_t maxFragmentLen = static_cast(0); + Optional watermarkEnabled; + Optional OSDEnabled; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamAllocate +namespace VideoStreamAllocateResponse { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::VideoStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamAllocateResponse +namespace VideoStreamModify { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kResolution = 1, + kWatermarkEnabled = 2, + kOSDEnabled = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamModify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional resolution; + Optional watermarkEnabled; + Optional OSDEnabled; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::VideoStreamModify::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional resolution; + Optional watermarkEnabled; + Optional OSDEnabled; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamModify +namespace VideoStreamDeallocate { +enum class Fields : uint8_t +{ + kVideoStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::VideoStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::VideoStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace VideoStreamDeallocate +namespace SnapshotStreamAllocate { +enum class Fields : uint8_t +{ + kImageCodec = 0, + kFrameRate = 1, + kBitRate = 2, + kMinResolution = 3, + kMaxResolution = 4, + kQuality = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::Type minResolution; + Structs::VideoResolutionStruct::Type maxResolution; + uint8_t quality = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + ImageCodecEnum imageCodec = static_cast(0); + uint16_t frameRate = static_cast(0); + uint32_t bitRate = static_cast(0); + Structs::VideoResolutionStruct::DecodableType minResolution; + Structs::VideoResolutionStruct::DecodableType maxResolution; + uint8_t quality = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamAllocate +namespace SnapshotStreamAllocateResponse { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamAllocateResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamAllocateResponse +namespace SnapshotStreamDeallocate { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SnapshotStreamDeallocate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SnapshotStreamDeallocate +namespace SetStreamPriorities { +enum class Fields : uint8_t +{ + kStreamPriorities = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetStreamPriorities::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + DataModel::List streamPriorities; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetStreamPriorities::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + DataModel::DecodableList streamPriorities; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetStreamPriorities +namespace CaptureSnapshot { +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kRequestedResolution = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Structs::VideoResolutionStruct::Type requestedResolution; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshot::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Structs::VideoResolutionStruct::DecodableType requestedResolution; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CaptureSnapshot +namespace CaptureSnapshotResponse { +enum class Fields : uint8_t +{ + kData = 0, + kImageCodec = 1, + kResolution = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + chip::ByteSpan data; + ImageCodecEnum imageCodec = static_cast(0); + Structs::VideoResolutionStruct::Type resolution; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::CaptureSnapshotResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + chip::ByteSpan data; + ImageCodecEnum imageCodec = static_cast(0); + Structs::VideoResolutionStruct::DecodableType resolution; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace CaptureSnapshotResponse +namespace SetViewport { +enum class Fields : uint8_t +{ + kViewport = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + Structs::ViewportStruct::Type viewport; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetViewport::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + Structs::ViewportStruct::DecodableType viewport; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetViewport +namespace SetImageRotation { +enum class Fields : uint8_t +{ + kAngle = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageRotation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t angle = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetImageRotation::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t angle = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageRotation +namespace SetImageFlipHorizontal { +enum class Fields : uint8_t +{ + kEnabled = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipHorizontal::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipHorizontal::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageFlipHorizontal +namespace SetImageFlipVertical { +enum class Fields : uint8_t +{ + kEnabled = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipVertical::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SetImageFlipVertical::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + bool enabled = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SetImageFlipVertical +} // namespace Commands + +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxConcurrentVideoEncoders::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxConcurrentVideoEncoders +namespace MaxEncodedPixelRate { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxEncodedPixelRate::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxEncodedPixelRate +namespace VideoSensorParams { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::VideoSensorParams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace VideoSensorParams +namespace NightVisionCapable { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVisionCapable::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVisionCapable +namespace MinViewport { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MinViewport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MinViewport +namespace RateDistortionTradeOffPoints { +struct TypeInfo +{ + using Type = chip::app::DataModel::List< + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type>; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RateDistortionTradeOffPoints::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RateDistortionTradeOffPoints +namespace MaxPreRollBufferSize { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxPreRollBufferSize::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxPreRollBufferSize +namespace MicrophoneCapabilities { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneCapabilities::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneCapabilities +namespace SpeakerCapabilities { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerCapabilities::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerCapabilities +namespace TwoWayTalkSupport { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::TwoWayTalkSupport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace TwoWayTalkSupport +namespace SupportedSnapshotParams { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SupportedSnapshotParams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SupportedSnapshotParams +namespace MaxNetworkBandwidth { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MaxNetworkBandwidth::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MaxNetworkBandwidth +namespace CurrentFrameRate { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentFrameRate::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentFrameRate +namespace HDRModeEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HDRModeEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HDRModeEnabled +namespace CurrentVideoCodecs { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentVideoCodecs::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentVideoCodecs +namespace CurrentSnapshotConfig { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSnapshotConfig::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentSnapshotConfig +namespace FabricsUsingCamera { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::FabricsUsingCamera::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace FabricsUsingCamera +namespace AllocatedVideoStreams { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedVideoStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedVideoStreams +namespace AllocatedAudioStreams { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedAudioStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedAudioStreams +namespace AllocatedSnapshotStreams { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AllocatedSnapshotStreams::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AllocatedSnapshotStreams +namespace RankedVideoStreamPrioritiesList { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::RankedVideoStreamPrioritiesList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace RankedVideoStreamPrioritiesList +namespace SoftRecordingPrivacyModeEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SoftRecordingPrivacyModeEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SoftRecordingPrivacyModeEnabled +namespace SoftLivestreamPrivacyModeEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SoftLivestreamPrivacyModeEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SoftLivestreamPrivacyModeEnabled +namespace HardPrivacyModeOn { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::HardPrivacyModeOn::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace HardPrivacyModeOn +namespace NightVision { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVision::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVision +namespace NightVisionIllum { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NightVisionIllum::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NightVisionIllum +namespace AWBEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AWBEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AWBEnabled +namespace AutoShutterSpeedEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AutoShutterSpeedEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AutoShutterSpeedEnabled +namespace AutoISOEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::AutoISOEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace AutoISOEnabled +namespace Viewport { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::Type; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Viewport::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Viewport +namespace SpeakerMuted { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerMuted::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerMuted +namespace SpeakerVolumeLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerVolumeLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerVolumeLevel +namespace SpeakerMaxLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerMaxLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerMaxLevel +namespace SpeakerMinLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::SpeakerMinLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace SpeakerMinLevel +namespace MicrophoneMuted { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneMuted::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneMuted +namespace MicrophoneVolumeLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneVolumeLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneVolumeLevel +namespace MicrophoneMaxLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneMaxLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneMaxLevel +namespace MicrophoneMinLevel { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneMinLevel::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneMinLevel +namespace MicrophoneAGCEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::MicrophoneAGCEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace MicrophoneAGCEnabled +namespace ImageRotation { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageRotation::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageRotation +namespace ImageFlipHorizontal { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageFlipHorizontal::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageFlipHorizontal +namespace ImageFlipVertical { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ImageFlipVertical::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ImageFlipVertical +namespace LocalVideoRecordingEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LocalVideoRecordingEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace LocalVideoRecordingEnabled +namespace LocalSnapshotRecordingEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::LocalSnapshotRecordingEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace LocalSnapshotRecordingEnabled +namespace StatusLightEnabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StatusLightEnabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StatusLightEnabled +namespace StatusLightBrightness { +struct TypeInfo +{ + using Type = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + using DecodableType = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + using DecodableArgType = chip::app::Clusters::Globals::ThreeLevelAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::StatusLightBrightness::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace StatusLightBrightness +namespace DepthSensorStatus { +struct TypeInfo +{ + using Type = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + using DecodableArgType = chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DepthSensorStatus::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DepthSensorStatus +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::MaxConcurrentVideoEncoders::TypeInfo::DecodableType maxConcurrentVideoEncoders = static_cast(0); + Attributes::MaxEncodedPixelRate::TypeInfo::DecodableType maxEncodedPixelRate = static_cast(0); + Attributes::VideoSensorParams::TypeInfo::DecodableType videoSensorParams; + Attributes::NightVisionCapable::TypeInfo::DecodableType nightVisionCapable = static_cast(0); + Attributes::MinViewport::TypeInfo::DecodableType minViewport; + Attributes::RateDistortionTradeOffPoints::TypeInfo::DecodableType rateDistortionTradeOffPoints; + Attributes::MaxPreRollBufferSize::TypeInfo::DecodableType maxPreRollBufferSize = static_cast(0); + Attributes::MicrophoneCapabilities::TypeInfo::DecodableType microphoneCapabilities; + Attributes::SpeakerCapabilities::TypeInfo::DecodableType speakerCapabilities; + Attributes::TwoWayTalkSupport::TypeInfo::DecodableType twoWayTalkSupport = + static_cast(0); + Attributes::SupportedSnapshotParams::TypeInfo::DecodableType supportedSnapshotParams; + Attributes::MaxNetworkBandwidth::TypeInfo::DecodableType maxNetworkBandwidth = static_cast(0); + Attributes::CurrentFrameRate::TypeInfo::DecodableType currentFrameRate = static_cast(0); + Attributes::HDRModeEnabled::TypeInfo::DecodableType HDRModeEnabled = static_cast(0); + Attributes::CurrentVideoCodecs::TypeInfo::DecodableType currentVideoCodecs; + Attributes::CurrentSnapshotConfig::TypeInfo::DecodableType currentSnapshotConfig; + Attributes::FabricsUsingCamera::TypeInfo::DecodableType fabricsUsingCamera; + Attributes::AllocatedVideoStreams::TypeInfo::DecodableType allocatedVideoStreams; + Attributes::AllocatedAudioStreams::TypeInfo::DecodableType allocatedAudioStreams; + Attributes::AllocatedSnapshotStreams::TypeInfo::DecodableType allocatedSnapshotStreams; + Attributes::RankedVideoStreamPrioritiesList::TypeInfo::DecodableType rankedVideoStreamPrioritiesList; + Attributes::SoftRecordingPrivacyModeEnabled::TypeInfo::DecodableType softRecordingPrivacyModeEnabled = static_cast(0); + Attributes::SoftLivestreamPrivacyModeEnabled::TypeInfo::DecodableType softLivestreamPrivacyModeEnabled = + static_cast(0); + Attributes::HardPrivacyModeOn::TypeInfo::DecodableType hardPrivacyModeOn = static_cast(0); + Attributes::NightVision::TypeInfo::DecodableType nightVision = + static_cast(0); + Attributes::NightVisionIllum::TypeInfo::DecodableType nightVisionIllum = + static_cast(0); + Attributes::AWBEnabled::TypeInfo::DecodableType AWBEnabled = static_cast(0); + Attributes::AutoShutterSpeedEnabled::TypeInfo::DecodableType autoShutterSpeedEnabled = static_cast(0); + Attributes::AutoISOEnabled::TypeInfo::DecodableType autoISOEnabled = static_cast(0); + Attributes::Viewport::TypeInfo::DecodableType viewport; + Attributes::SpeakerMuted::TypeInfo::DecodableType speakerMuted = static_cast(0); + Attributes::SpeakerVolumeLevel::TypeInfo::DecodableType speakerVolumeLevel = static_cast(0); + Attributes::SpeakerMaxLevel::TypeInfo::DecodableType speakerMaxLevel = static_cast(0); + Attributes::SpeakerMinLevel::TypeInfo::DecodableType speakerMinLevel = static_cast(0); + Attributes::MicrophoneMuted::TypeInfo::DecodableType microphoneMuted = static_cast(0); + Attributes::MicrophoneVolumeLevel::TypeInfo::DecodableType microphoneVolumeLevel = static_cast(0); + Attributes::MicrophoneMaxLevel::TypeInfo::DecodableType microphoneMaxLevel = static_cast(0); + Attributes::MicrophoneMinLevel::TypeInfo::DecodableType microphoneMinLevel = static_cast(0); + Attributes::MicrophoneAGCEnabled::TypeInfo::DecodableType microphoneAGCEnabled = static_cast(0); + Attributes::ImageRotation::TypeInfo::DecodableType imageRotation = static_cast(0); + Attributes::ImageFlipHorizontal::TypeInfo::DecodableType imageFlipHorizontal = static_cast(0); + Attributes::ImageFlipVertical::TypeInfo::DecodableType imageFlipVertical = static_cast(0); + Attributes::LocalVideoRecordingEnabled::TypeInfo::DecodableType localVideoRecordingEnabled = static_cast(0); + Attributes::LocalSnapshotRecordingEnabled::TypeInfo::DecodableType localSnapshotRecordingEnabled = static_cast(0); + Attributes::StatusLightEnabled::TypeInfo::DecodableType statusLightEnabled = static_cast(0); + Attributes::StatusLightBrightness::TypeInfo::DecodableType statusLightBrightness = + static_cast(0); + Attributes::DepthSensorStatus::TypeInfo::DecodableType depthSensorStatus = + static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +namespace Events { +namespace VideoStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kVideoStreamID = 0, + kStreamType = 1, + kVideoCodec = 2, + kMinFrameRate = 3, + kMaxFrameRate = 4, + kMinResolution = 5, + kMaxResolution = 6, + kMinBitRate = 7, + kMaxBitRate = 8, + kMinFragmentLen = 9, + kMaxFragmentLen = 10, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::VideoStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t videoStreamID = static_cast(0); + Optional streamType; + Optional videoCodec; + Optional minFrameRate; + Optional maxFrameRate; + Optional minResolution; + Optional maxResolution; + Optional minBitRate; + Optional maxBitRate; + Optional minFragmentLen; + Optional maxFragmentLen; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::VideoStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t videoStreamID = static_cast(0); + Optional streamType; + Optional videoCodec; + Optional minFrameRate; + Optional maxFrameRate; + Optional minResolution; + Optional maxResolution; + Optional minBitRate; + Optional maxBitRate; + Optional minFragmentLen; + Optional maxFragmentLen; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace VideoStreamChanged +namespace AudioStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kAudioStreamID = 0, + kStreamType = 1, + kAudioCodec = 2, + kChannelCount = 3, + kSampleRate = 4, + kBitRate = 5, + kBitDepth = 6, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::AudioStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t audioStreamID = static_cast(0); + Optional streamType; + Optional audioCodec; + Optional channelCount; + Optional sampleRate; + Optional bitRate; + Optional bitDepth; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::AudioStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t audioStreamID = static_cast(0); + Optional streamType; + Optional audioCodec; + Optional channelCount; + Optional sampleRate; + Optional bitRate; + Optional bitDepth; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace AudioStreamChanged +namespace SnapshotStreamChanged { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; + +enum class Fields : uint8_t +{ + kSnapshotStreamID = 0, + kImageCodec = 1, + kFrameRate = 2, + kBitRate = 3, + kMinResolution = 4, + kMaxResolution = 5, + kQuality = 6, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SnapshotStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + static constexpr bool kIsFabricScoped = false; + + uint16_t snapshotStreamID = static_cast(0); + Optional imageCodec; + Optional frameRate; + Optional bitRate; + Optional minResolution; + Optional maxResolution; + Optional quality; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return Events::SnapshotStreamChanged::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::CameraAvStreamManagement::Id; } + + uint16_t snapshotStreamID = static_cast(0); + Optional imageCodec; + Optional frameRate; + Optional bitRate; + Optional minResolution; + Optional maxResolution; + Optional quality; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SnapshotStreamChanged +} // namespace Events +} // namespace CameraAvStreamManagement +namespace WebRTCTransportProvider { +namespace Structs { +namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; +namespace WebRTCSessionStruct = Clusters::detail::Structs::WebRTCSessionStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace SolicitOffer { +struct Type; +struct DecodableType; +} // namespace SolicitOffer + +namespace SolicitOfferResponse { +struct Type; +struct DecodableType; +} // namespace SolicitOfferResponse + +namespace ProvideOffer { +struct Type; +struct DecodableType; +} // namespace ProvideOffer + +namespace ProvideOfferResponse { +struct Type; +struct DecodableType; +} // namespace ProvideOfferResponse + +namespace ProvideAnswer { +struct Type; +struct DecodableType; +} // namespace ProvideAnswer + +namespace ProvideICECandidate { +struct Type; +struct DecodableType; +} // namespace ProvideICECandidate + +namespace EndSession { +struct Type; +struct DecodableType; +} // namespace EndSession + +} // namespace Commands + +namespace Commands { +namespace SolicitOffer { +enum class Fields : uint8_t +{ + kStreamType = 0, + kVideoStreamID = 1, + kAudioStreamID = 2, + kICEServers = 3, + kICETransportPolicy = 4, + kMetadataOptions = 5, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SolicitOffer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + StreamTypeEnum streamType = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + Optional> ICEServers; + Optional ICETransportPolicy; + Optional> metadataOptions; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SolicitOffer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + StreamTypeEnum streamType = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + Optional> ICEServers; + Optional ICETransportPolicy; + Optional> metadataOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SolicitOffer +namespace SolicitOfferResponse { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kDeferredOffer = 1, + kVideoStreamID = 2, + kAudioStreamID = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SolicitOfferResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + bool deferredOffer = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SolicitOfferResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + bool deferredOffer = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SolicitOfferResponse +namespace ProvideOffer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, + kStreamType = 2, + kVideoStreamID = 3, + kAudioStreamID = 4, + kICEServers = 5, + kICETransportPolicy = 6, + kMetadataOptions = 7, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ProvideOffer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + DataModel::Nullable webRTCSessionID; + chip::CharSpan sdp; + StreamTypeEnum streamType = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + Optional> ICEServers; + Optional ICETransportPolicy; + Optional> metadataOptions; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ProvideOffer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + DataModel::Nullable webRTCSessionID; + chip::CharSpan sdp; + StreamTypeEnum streamType = static_cast(0); + Optional> videoStreamID; + Optional> audioStreamID; + Optional> ICEServers; + Optional ICETransportPolicy; + Optional> metadataOptions; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ProvideOffer +namespace ProvideOfferResponse { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kVideoStreamID = 1, + kAudioStreamID = 2, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ProvideOfferResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + uint16_t videoStreamID = static_cast(0); + uint16_t audioStreamID = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ProvideOfferResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + uint16_t videoStreamID = static_cast(0); + uint16_t audioStreamID = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ProvideOfferResponse +namespace ProvideAnswer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ProvideAnswer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ProvideAnswer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ProvideAnswer +namespace ProvideICECandidate { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kICECandidate = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ProvideICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ProvideICECandidate +namespace EndSession { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kReason = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace EndSession +} // namespace Commands + +namespace Attributes { + +namespace CurrentSessions { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSessions::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentSessions +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportProvider::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CurrentSessions::TypeInfo::DecodableType currentSessions; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Structs { +namespace ICEServerStruct = Clusters::detail::Structs::ICEServerStruct; +namespace WebRTCSessionStruct = Clusters::detail::Structs::WebRTCSessionStruct; +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Offer { +struct Type; +struct DecodableType; +} // namespace Offer + +namespace Answer { +struct Type; +struct DecodableType; +} // namespace Answer + +namespace ICECandidate { +struct Type; +struct DecodableType; +} // namespace ICECandidate + +namespace End { +struct Type; +struct DecodableType; +} // namespace End + +} // namespace Commands + +namespace Commands { +namespace Offer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, + kICEServers = 2, + kICETransportPolicy = 3, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Offer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + Optional> ICEServers; + Optional ICETransportPolicy; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Offer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + Optional> ICEServers; + Optional ICETransportPolicy; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Offer +namespace Answer { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kSdp = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Answer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Answer::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan sdp; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Answer +namespace ICECandidate { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kICECandidate = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::ICECandidate::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + chip::CharSpan ICECandidate; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace ICECandidate +namespace End { +enum class Fields : uint8_t +{ + kWebRTCSessionID = 0, + kReason = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::End::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::End::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + uint16_t webRTCSessionID = static_cast(0); + WebRTCEndReasonEnum reason = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace End +} // namespace Commands + +namespace Attributes { + +namespace CurrentSessions { +struct TypeInfo +{ + using Type = + chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType>; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::CurrentSessions::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace CurrentSessions +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::WebRTCTransportRequestor::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::CurrentSessions::TypeInfo::DecodableType currentSessions; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace WebRTCTransportRequestor namespace Chime { namespace Structs { namespace ChimeSoundStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index ca40e31b73..d3cd9efcc6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -1020,6 +1020,10 @@ namespace TCAcknowledgementsRequired { static constexpr AttributeId Id = 0x00000008; } // namespace TCAcknowledgementsRequired +namespace TCUpdateDeadline { +static constexpr AttributeId Id = 0x00000009; +} // namespace TCUpdateDeadline + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList @@ -7313,6 +7317,270 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Attributes { + +namespace SupportedZoneSources { +static constexpr AttributeId Id = 0x00000000; +} // namespace SupportedZoneSources + +namespace Zones { +static constexpr AttributeId Id = 0x00000001; +} // namespace Zones + +namespace TimeControl { +static constexpr AttributeId Id = 0x00000002; +} // namespace TimeControl + +namespace Sensitivity { +static constexpr AttributeId Id = 0x00000003; +} // namespace Sensitivity + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { +namespace Attributes { + +namespace MaxConcurrentVideoEncoders { +static constexpr AttributeId Id = 0x00000000; +} // namespace MaxConcurrentVideoEncoders + +namespace MaxEncodedPixelRate { +static constexpr AttributeId Id = 0x00000001; +} // namespace MaxEncodedPixelRate + +namespace VideoSensorParams { +static constexpr AttributeId Id = 0x00000002; +} // namespace VideoSensorParams + +namespace NightVisionCapable { +static constexpr AttributeId Id = 0x00000003; +} // namespace NightVisionCapable + +namespace MinViewport { +static constexpr AttributeId Id = 0x00000004; +} // namespace MinViewport + +namespace RateDistortionTradeOffPoints { +static constexpr AttributeId Id = 0x00000005; +} // namespace RateDistortionTradeOffPoints + +namespace MaxPreRollBufferSize { +static constexpr AttributeId Id = 0x00000006; +} // namespace MaxPreRollBufferSize + +namespace MicrophoneCapabilities { +static constexpr AttributeId Id = 0x00000007; +} // namespace MicrophoneCapabilities + +namespace SpeakerCapabilities { +static constexpr AttributeId Id = 0x00000008; +} // namespace SpeakerCapabilities + +namespace TwoWayTalkSupport { +static constexpr AttributeId Id = 0x00000009; +} // namespace TwoWayTalkSupport + +namespace SupportedSnapshotParams { +static constexpr AttributeId Id = 0x0000000A; +} // namespace SupportedSnapshotParams + +namespace MaxNetworkBandwidth { +static constexpr AttributeId Id = 0x0000000B; +} // namespace MaxNetworkBandwidth + +namespace CurrentFrameRate { +static constexpr AttributeId Id = 0x0000000C; +} // namespace CurrentFrameRate + +namespace HDRModeEnabled { +static constexpr AttributeId Id = 0x0000000D; +} // namespace HDRModeEnabled + +namespace CurrentVideoCodecs { +static constexpr AttributeId Id = 0x0000000E; +} // namespace CurrentVideoCodecs + +namespace CurrentSnapshotConfig { +static constexpr AttributeId Id = 0x0000000F; +} // namespace CurrentSnapshotConfig + +namespace FabricsUsingCamera { +static constexpr AttributeId Id = 0x00000010; +} // namespace FabricsUsingCamera + +namespace AllocatedVideoStreams { +static constexpr AttributeId Id = 0x00000011; +} // namespace AllocatedVideoStreams + +namespace AllocatedAudioStreams { +static constexpr AttributeId Id = 0x00000012; +} // namespace AllocatedAudioStreams + +namespace AllocatedSnapshotStreams { +static constexpr AttributeId Id = 0x00000013; +} // namespace AllocatedSnapshotStreams + +namespace RankedVideoStreamPrioritiesList { +static constexpr AttributeId Id = 0x00000014; +} // namespace RankedVideoStreamPrioritiesList + +namespace SoftRecordingPrivacyModeEnabled { +static constexpr AttributeId Id = 0x00000015; +} // namespace SoftRecordingPrivacyModeEnabled + +namespace SoftLivestreamPrivacyModeEnabled { +static constexpr AttributeId Id = 0x00000016; +} // namespace SoftLivestreamPrivacyModeEnabled + +namespace HardPrivacyModeOn { +static constexpr AttributeId Id = 0x00000017; +} // namespace HardPrivacyModeOn + +namespace NightVision { +static constexpr AttributeId Id = 0x00000018; +} // namespace NightVision + +namespace NightVisionIllum { +static constexpr AttributeId Id = 0x00000019; +} // namespace NightVisionIllum + +namespace AWBEnabled { +static constexpr AttributeId Id = 0x0000001A; +} // namespace AWBEnabled + +namespace AutoShutterSpeedEnabled { +static constexpr AttributeId Id = 0x0000001B; +} // namespace AutoShutterSpeedEnabled + +namespace AutoISOEnabled { +static constexpr AttributeId Id = 0x0000001C; +} // namespace AutoISOEnabled + +namespace Viewport { +static constexpr AttributeId Id = 0x0000001D; +} // namespace Viewport + +namespace SpeakerMuted { +static constexpr AttributeId Id = 0x0000001E; +} // namespace SpeakerMuted + +namespace SpeakerVolumeLevel { +static constexpr AttributeId Id = 0x0000001F; +} // namespace SpeakerVolumeLevel + +namespace SpeakerMaxLevel { +static constexpr AttributeId Id = 0x00000020; +} // namespace SpeakerMaxLevel + +namespace SpeakerMinLevel { +static constexpr AttributeId Id = 0x00000021; +} // namespace SpeakerMinLevel + +namespace MicrophoneMuted { +static constexpr AttributeId Id = 0x00000022; +} // namespace MicrophoneMuted + +namespace MicrophoneVolumeLevel { +static constexpr AttributeId Id = 0x00000023; +} // namespace MicrophoneVolumeLevel + +namespace MicrophoneMaxLevel { +static constexpr AttributeId Id = 0x00000024; +} // namespace MicrophoneMaxLevel + +namespace MicrophoneMinLevel { +static constexpr AttributeId Id = 0x00000025; +} // namespace MicrophoneMinLevel + +namespace MicrophoneAGCEnabled { +static constexpr AttributeId Id = 0x00000026; +} // namespace MicrophoneAGCEnabled + +namespace ImageRotation { +static constexpr AttributeId Id = 0x00000027; +} // namespace ImageRotation + +namespace ImageFlipHorizontal { +static constexpr AttributeId Id = 0x00000028; +} // namespace ImageFlipHorizontal + +namespace ImageFlipVertical { +static constexpr AttributeId Id = 0x00000029; +} // namespace ImageFlipVertical + +namespace LocalVideoRecordingEnabled { +static constexpr AttributeId Id = 0x0000002A; +} // namespace LocalVideoRecordingEnabled + +namespace LocalSnapshotRecordingEnabled { +static constexpr AttributeId Id = 0x0000002B; +} // namespace LocalSnapshotRecordingEnabled + +namespace StatusLightEnabled { +static constexpr AttributeId Id = 0x0000002C; +} // namespace StatusLightEnabled + +namespace StatusLightBrightness { +static constexpr AttributeId Id = 0x0000002D; +} // namespace StatusLightBrightness + +namespace DepthSensorStatus { +static constexpr AttributeId Id = 0x0000002E; +} // namespace DepthSensorStatus + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { namespace Attributes { @@ -7347,6 +7615,40 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Attributes { + +namespace CurrentSessions { +static constexpr AttributeId Id = 0x00000000; +} // namespace CurrentSessions + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 9c0523e865..e492255152 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -376,9 +376,18 @@ static constexpr ClusterId Id = 0x0000050F; namespace ContentAppObserver { static constexpr ClusterId Id = 0x00000510; } // namespace ContentAppObserver +namespace ZoneManagement { +static constexpr ClusterId Id = 0x00000550; +} // namespace ZoneManagement +namespace CameraAvStreamManagement { +static constexpr ClusterId Id = 0x00000551; +} // namespace CameraAvStreamManagement namespace WebRTCTransportProvider { static constexpr ClusterId Id = 0x00000553; } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +static constexpr ClusterId Id = 0x00000554; +} // namespace WebRTCTransportRequestor namespace Chime { static constexpr ClusterId Id = 0x00000556; } // namespace Chime diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 49e738a1ac..5a07d8ac1b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1803,6 +1803,110 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ContentAppObserver +namespace ZoneManagement { +namespace Commands { + +namespace CreateTwoDCartesianZone { +static constexpr CommandId Id = 0x00000000; +} // namespace CreateTwoDCartesianZone + +namespace CreateTwoDCartesianZoneResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace CreateTwoDCartesianZoneResponse + +namespace UpdateTwoDCartesianZone { +static constexpr CommandId Id = 0x00000002; +} // namespace UpdateTwoDCartesianZone + +namespace GetTwoDCartesianZone { +static constexpr CommandId Id = 0x00000003; +} // namespace GetTwoDCartesianZone + +namespace GetTwoDCartesianZoneResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace GetTwoDCartesianZoneResponse + +namespace RemoveZone { +static constexpr CommandId Id = 0x00000005; +} // namespace RemoveZone + +} // namespace Commands +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { +namespace Commands { + +namespace AudioStreamAllocate { +static constexpr CommandId Id = 0x00000000; +} // namespace AudioStreamAllocate + +namespace AudioStreamAllocateResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace AudioStreamAllocateResponse + +namespace AudioStreamDeallocate { +static constexpr CommandId Id = 0x00000002; +} // namespace AudioStreamDeallocate + +namespace VideoStreamAllocate { +static constexpr CommandId Id = 0x00000003; +} // namespace VideoStreamAllocate + +namespace VideoStreamAllocateResponse { +static constexpr CommandId Id = 0x00000004; +} // namespace VideoStreamAllocateResponse + +namespace VideoStreamModify { +static constexpr CommandId Id = 0x00000005; +} // namespace VideoStreamModify + +namespace VideoStreamDeallocate { +static constexpr CommandId Id = 0x00000006; +} // namespace VideoStreamDeallocate + +namespace SnapshotStreamAllocate { +static constexpr CommandId Id = 0x00000007; +} // namespace SnapshotStreamAllocate + +namespace SnapshotStreamAllocateResponse { +static constexpr CommandId Id = 0x00000008; +} // namespace SnapshotStreamAllocateResponse + +namespace SnapshotStreamDeallocate { +static constexpr CommandId Id = 0x00000009; +} // namespace SnapshotStreamDeallocate + +namespace SetStreamPriorities { +static constexpr CommandId Id = 0x0000000A; +} // namespace SetStreamPriorities + +namespace CaptureSnapshot { +static constexpr CommandId Id = 0x0000000B; +} // namespace CaptureSnapshot + +namespace CaptureSnapshotResponse { +static constexpr CommandId Id = 0x0000000C; +} // namespace CaptureSnapshotResponse + +namespace SetViewport { +static constexpr CommandId Id = 0x0000000D; +} // namespace SetViewport + +namespace SetImageRotation { +static constexpr CommandId Id = 0x0000000E; +} // namespace SetImageRotation + +namespace SetImageFlipHorizontal { +static constexpr CommandId Id = 0x0000000F; +} // namespace SetImageFlipHorizontal + +namespace SetImageFlipVertical { +static constexpr CommandId Id = 0x00000010; +} // namespace SetImageFlipVertical + +} // namespace Commands +} // namespace CameraAvStreamManagement + namespace WebRTCTransportProvider { namespace Commands { @@ -1837,6 +1941,28 @@ static constexpr CommandId Id = 0x00000007; } // namespace Commands } // namespace WebRTCTransportProvider +namespace WebRTCTransportRequestor { +namespace Commands { + +namespace Offer { +static constexpr CommandId Id = 0x00000001; +} // namespace Offer + +namespace Answer { +static constexpr CommandId Id = 0x00000002; +} // namespace Answer + +namespace ICECandidate { +static constexpr CommandId Id = 0x00000003; +} // namespace ICECandidate + +namespace End { +static constexpr CommandId Id = 0x00000004; +} // namespace End + +} // namespace Commands +} // namespace WebRTCTransportRequestor + namespace Chime { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h index 0756af5268..818b5504b2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h @@ -683,6 +683,38 @@ static constexpr EventId Id = 0x00000000; } // namespace Events } // namespace ContentControl +namespace ZoneManagement { +namespace Events { + +namespace ZoneTriggered { +static constexpr EventId Id = 0x00000000; +} // namespace ZoneTriggered + +namespace ZoneStopped { +static constexpr EventId Id = 0x00000001; +} // namespace ZoneStopped + +} // namespace Events +} // namespace ZoneManagement + +namespace CameraAvStreamManagement { +namespace Events { + +namespace VideoStreamChanged { +static constexpr EventId Id = 0x00000000; +} // namespace VideoStreamChanged + +namespace AudioStreamChanged { +static constexpr EventId Id = 0x00000001; +} // namespace AudioStreamChanged + +namespace SnapshotStreamChanged { +static constexpr EventId Id = 0x00000002; +} // namespace SnapshotStreamChanged + +} // namespace Events +} // namespace CameraAvStreamManagement + namespace CommissionerControl { namespace Events { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 4d2c793f47..ddb336fa7d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -152,7 +152,10 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| ZoneManagement | 0x0550 | +| CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | +| WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -2203,6 +2206,7 @@ class OtaSoftwareUpdateRequestorAnnounceOTAProvider : public ClusterCommand | * TCMinRequiredVersion | 0x0006 | | * TCAcknowledgements | 0x0007 | | * TCAcknowledgementsRequired | 0x0008 | +| * TCUpdateDeadline | 0x0009 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -13647,6 +13651,801 @@ class ContentAppObserverContentAppMessage : public ClusterCommand chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster ZoneManagement | 0x0550 | +|------------------------------------------------------------------------------| +| Commands: | | +| * CreateTwoDCartesianZone | 0x00 | +| * UpdateTwoDCartesianZone | 0x02 | +| * GetTwoDCartesianZone | 0x03 | +| * RemoveZone | 0x05 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * SupportedZoneSources | 0x0000 | +| * Zones | 0x0001 | +| * TimeControl | 0x0002 | +| * Sensitivity | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * ZoneTriggered | 0x0000 | +| * ZoneStopped | 0x0001 | +\*----------------------------------------------------------------------------*/ + +/* + * Command CreateTwoDCartesianZone + */ +class ZoneManagementCreateTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementCreateTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("create-two-dcartesian-zone", credsIssuerConfig), mComplex_Zone(&mRequest.zone) + { + AddArgument("Zone", &mComplex_Zone); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +/* + * Command UpdateTwoDCartesianZone + */ +class ZoneManagementUpdateTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementUpdateTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("update-two-dcartesian-zone", credsIssuerConfig), mComplex_Zone(&mRequest.zone) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + AddArgument("Zone", &mComplex_Zone); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + +/* + * Command GetTwoDCartesianZone + */ +class ZoneManagementGetTwoDCartesianZone : public ClusterCommand +{ +public: + ZoneManagementGetTwoDCartesianZone(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("get-two-dcartesian-zone", credsIssuerConfig) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type mRequest; +}; + +/* + * Command RemoveZone + */ +class ZoneManagementRemoveZone : public ClusterCommand +{ +public: + ZoneManagementRemoveZone(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("remove-zone", credsIssuerConfig) + { + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type mRequest; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvStreamManagement | 0x0551 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AudioStreamAllocate | 0x00 | +| * AudioStreamDeallocate | 0x02 | +| * VideoStreamAllocate | 0x03 | +| * VideoStreamModify | 0x05 | +| * VideoStreamDeallocate | 0x06 | +| * SnapshotStreamAllocate | 0x07 | +| * SnapshotStreamDeallocate | 0x09 | +| * SetStreamPriorities | 0x0A | +| * CaptureSnapshot | 0x0B | +| * SetViewport | 0x0D | +| * SetImageRotation | 0x0E | +| * SetImageFlipHorizontal | 0x0F | +| * SetImageFlipVertical | 0x10 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MaxConcurrentVideoEncoders | 0x0000 | +| * MaxEncodedPixelRate | 0x0001 | +| * VideoSensorParams | 0x0002 | +| * NightVisionCapable | 0x0003 | +| * MinViewport | 0x0004 | +| * RateDistortionTradeOffPoints | 0x0005 | +| * MaxPreRollBufferSize | 0x0006 | +| * MicrophoneCapabilities | 0x0007 | +| * SpeakerCapabilities | 0x0008 | +| * TwoWayTalkSupport | 0x0009 | +| * SupportedSnapshotParams | 0x000A | +| * MaxNetworkBandwidth | 0x000B | +| * CurrentFrameRate | 0x000C | +| * HDRModeEnabled | 0x000D | +| * CurrentVideoCodecs | 0x000E | +| * CurrentSnapshotConfig | 0x000F | +| * FabricsUsingCamera | 0x0010 | +| * AllocatedVideoStreams | 0x0011 | +| * AllocatedAudioStreams | 0x0012 | +| * AllocatedSnapshotStreams | 0x0013 | +| * RankedVideoStreamPrioritiesList | 0x0014 | +| * SoftRecordingPrivacyModeEnabled | 0x0015 | +| * SoftLivestreamPrivacyModeEnabled | 0x0016 | +| * HardPrivacyModeOn | 0x0017 | +| * NightVision | 0x0018 | +| * NightVisionIllum | 0x0019 | +| * AWBEnabled | 0x001A | +| * AutoShutterSpeedEnabled | 0x001B | +| * AutoISOEnabled | 0x001C | +| * Viewport | 0x001D | +| * SpeakerMuted | 0x001E | +| * SpeakerVolumeLevel | 0x001F | +| * SpeakerMaxLevel | 0x0020 | +| * SpeakerMinLevel | 0x0021 | +| * MicrophoneMuted | 0x0022 | +| * MicrophoneVolumeLevel | 0x0023 | +| * MicrophoneMaxLevel | 0x0024 | +| * MicrophoneMinLevel | 0x0025 | +| * MicrophoneAGCEnabled | 0x0026 | +| * ImageRotation | 0x0027 | +| * ImageFlipHorizontal | 0x0028 | +| * ImageFlipVertical | 0x0029 | +| * LocalVideoRecordingEnabled | 0x002A | +| * LocalSnapshotRecordingEnabled | 0x002B | +| * StatusLightEnabled | 0x002C | +| * StatusLightBrightness | 0x002D | +| * DepthSensorStatus | 0x002E | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * VideoStreamChanged | 0x0000 | +| * AudioStreamChanged | 0x0001 | +| * SnapshotStreamChanged | 0x0002 | +\*----------------------------------------------------------------------------*/ + +/* + * Command AudioStreamAllocate + */ +class CameraAvStreamManagementAudioStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementAudioStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("audio-stream-allocate", credsIssuerConfig) + { + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("AudioCodec", 0, UINT8_MAX, &mRequest.audioCodec); + AddArgument("ChannelCount", 0, UINT8_MAX, &mRequest.channelCount); + AddArgument("SampleRate", 0, UINT32_MAX, &mRequest.sampleRate); + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); + AddArgument("BitDepth", 0, UINT8_MAX, &mRequest.bitDepth); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type mRequest; +}; + +/* + * Command AudioStreamDeallocate + */ +class CameraAvStreamManagementAudioStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementAudioStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("audio-stream-deallocate", credsIssuerConfig) + { + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type mRequest; +}; + +/* + * Command VideoStreamAllocate + */ +class CameraAvStreamManagementVideoStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-allocate", credsIssuerConfig), mComplex_MinResolution(&mRequest.minResolution), + mComplex_MaxResolution(&mRequest.maxResolution) + { + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("VideoCodec", 0, UINT8_MAX, &mRequest.videoCodec); + AddArgument("MinFrameRate", 0, UINT16_MAX, &mRequest.minFrameRate); + AddArgument("MaxFrameRate", 0, UINT16_MAX, &mRequest.maxFrameRate); + AddArgument("MinResolution", &mComplex_MinResolution); + AddArgument("MaxResolution", &mComplex_MaxResolution); + AddArgument("MinBitRate", 0, UINT32_MAX, &mRequest.minBitRate); + AddArgument("MaxBitRate", 0, UINT32_MAX, &mRequest.maxBitRate); + AddArgument("MinFragmentLen", 0, UINT16_MAX, &mRequest.minFragmentLen); + AddArgument("MaxFragmentLen", 0, UINT16_MAX, &mRequest.maxFragmentLen); + AddArgument("WatermarkEnabled", 0, 1, &mRequest.watermarkEnabled); + AddArgument("OSDEnabled", 0, 1, &mRequest.OSDEnabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type mRequest; + TypedComplexArgument + mComplex_MinResolution; + TypedComplexArgument + mComplex_MaxResolution; +}; + +/* + * Command VideoStreamModify + */ +class CameraAvStreamManagementVideoStreamModify : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamModify(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-modify", credsIssuerConfig), mComplex_Resolution(&mRequest.resolution) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("Resolution", &mComplex_Resolution, "", Argument::kOptional); + AddArgument("WatermarkEnabled", 0, 1, &mRequest.watermarkEnabled); + AddArgument("OSDEnabled", 0, 1, &mRequest.OSDEnabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Type mRequest; + TypedComplexArgument> + mComplex_Resolution; +}; + +/* + * Command VideoStreamDeallocate + */ +class CameraAvStreamManagementVideoStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementVideoStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("video-stream-deallocate", credsIssuerConfig) + { + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type mRequest; +}; + +/* + * Command SnapshotStreamAllocate + */ +class CameraAvStreamManagementSnapshotStreamAllocate : public ClusterCommand +{ +public: + CameraAvStreamManagementSnapshotStreamAllocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("snapshot-stream-allocate", credsIssuerConfig), mComplex_MinResolution(&mRequest.minResolution), + mComplex_MaxResolution(&mRequest.maxResolution) + { + AddArgument("ImageCodec", 0, UINT8_MAX, &mRequest.imageCodec); + AddArgument("FrameRate", 0, UINT16_MAX, &mRequest.frameRate); + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); + AddArgument("MinResolution", &mComplex_MinResolution); + AddArgument("MaxResolution", &mComplex_MaxResolution); + AddArgument("Quality", 0, UINT8_MAX, &mRequest.quality); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type mRequest; + TypedComplexArgument + mComplex_MinResolution; + TypedComplexArgument + mComplex_MaxResolution; +}; + +/* + * Command SnapshotStreamDeallocate + */ +class CameraAvStreamManagementSnapshotStreamDeallocate : public ClusterCommand +{ +public: + CameraAvStreamManagementSnapshotStreamDeallocate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("snapshot-stream-deallocate", credsIssuerConfig) + { + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type mRequest; +}; + +/* + * Command SetStreamPriorities + */ +class CameraAvStreamManagementSetStreamPriorities : public ClusterCommand +{ +public: + CameraAvStreamManagementSetStreamPriorities(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-stream-priorities", credsIssuerConfig), mComplex_StreamPriorities(&mRequest.streamPriorities) + { + AddArgument("StreamPriorities", &mComplex_StreamPriorities); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Type mRequest; + TypedComplexArgument> + mComplex_StreamPriorities; +}; + +/* + * Command CaptureSnapshot + */ +class CameraAvStreamManagementCaptureSnapshot : public ClusterCommand +{ +public: + CameraAvStreamManagementCaptureSnapshot(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("capture-snapshot", credsIssuerConfig), mComplex_RequestedResolution(&mRequest.requestedResolution) + { + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); + AddArgument("RequestedResolution", &mComplex_RequestedResolution); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Type mRequest; + TypedComplexArgument + mComplex_RequestedResolution; +}; + +/* + * Command SetViewport + */ +class CameraAvStreamManagementSetViewport : public ClusterCommand +{ +public: + CameraAvStreamManagementSetViewport(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-viewport", credsIssuerConfig), mComplex_Viewport(&mRequest.viewport) + { + AddArgument("Viewport", &mComplex_Viewport); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +/* + * Command SetImageRotation + */ +class CameraAvStreamManagementSetImageRotation : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageRotation(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-rotation", credsIssuerConfig) + { + AddArgument("Angle", 0, UINT16_MAX, &mRequest.angle); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Type mRequest; +}; + +/* + * Command SetImageFlipHorizontal + */ +class CameraAvStreamManagementSetImageFlipHorizontal : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageFlipHorizontal(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-flip-horizontal", credsIssuerConfig) + { + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type mRequest; +}; + +/* + * Command SetImageFlipVertical + */ +class CameraAvStreamManagementSetImageFlipVertical : public ClusterCommand +{ +public: + CameraAvStreamManagementSetImageFlipVertical(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("set-image-flip-vertical", credsIssuerConfig) + { + AddArgument("Enabled", 0, 1, &mRequest.enabled); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WebRTCTransportProvider | 0x0553 | |------------------------------------------------------------------------------| @@ -13726,19 +14525,201 @@ class WebRTCTransportProviderProvideOffer : public ClusterCommand { AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); AddArgument("Sdp", &mRequest.sdp); - AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); - AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); - AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + AddArgument("ICEServers", &mComplex_ICEServers, "", Argument::kOptional); + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); + AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type mRequest; + TypedComplexArgument>> + mComplex_ICEServers; +}; + +/* + * Command ProvideAnswer + */ +class WebRTCTransportProviderProvideAnswer : public ClusterCommand +{ +public: + WebRTCTransportProviderProvideAnswer(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("provide-answer", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Sdp", &mRequest.sdp); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type mRequest; +}; + +/* + * Command ProvideICECandidate + */ +class WebRTCTransportProviderProvideICECandidate : public ClusterCommand +{ +public: + WebRTCTransportProviderProvideICECandidate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("provide-icecandidate", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("ICECandidate", &mRequest.ICECandidate); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; +}; + +/* + * Command EndSession + */ +class WebRTCTransportProviderEndSession : public ClusterCommand +{ +public: + WebRTCTransportProviderEndSession(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("end-session", credsIssuerConfig) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Reason", 0, UINT8_MAX, &mRequest.reason); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type mRequest; +}; + +/*----------------------------------------------------------------------------*\ +| Cluster WebRTCTransportRequestor | 0x0554 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Offer | 0x01 | +| * Answer | 0x02 | +| * ICECandidate | 0x03 | +| * End | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentSessions | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command Offer + */ +class WebRTCTransportRequestorOffer : public ClusterCommand +{ +public: + WebRTCTransportRequestorOffer(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("offer", credsIssuerConfig), mComplex_ICEServers(&mRequest.ICEServers) + { + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("Sdp", &mRequest.sdp); AddArgument("ICEServers", &mComplex_ICEServers, "", Argument::kOptional); AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); - AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -13747,8 +14728,8 @@ class WebRTCTransportProviderProvideOffer : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -13757,20 +14738,19 @@ class WebRTCTransportProviderProvideOffer : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type mRequest; TypedComplexArgument>> + chip::app::DataModel::List>> mComplex_ICEServers; }; /* - * Command ProvideAnswer + * Command Answer */ -class WebRTCTransportProviderProvideAnswer : public ClusterCommand +class WebRTCTransportRequestorAnswer : public ClusterCommand { public: - WebRTCTransportProviderProvideAnswer(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("provide-answer", credsIssuerConfig) + WebRTCTransportRequestorAnswer(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("answer", credsIssuerConfig) { AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); AddArgument("Sdp", &mRequest.sdp); @@ -13779,8 +14759,8 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -13789,8 +14769,8 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -13799,17 +14779,17 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type mRequest; }; /* - * Command ProvideICECandidate + * Command ICECandidate */ -class WebRTCTransportProviderProvideICECandidate : public ClusterCommand +class WebRTCTransportRequestorICECandidate : public ClusterCommand { public: - WebRTCTransportProviderProvideICECandidate(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("provide-icecandidate", credsIssuerConfig) + WebRTCTransportRequestorICECandidate(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("icecandidate", credsIssuerConfig) { AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); AddArgument("ICECandidate", &mRequest.ICECandidate); @@ -13818,8 +14798,8 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -13828,8 +14808,8 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -13838,17 +14818,16 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; }; /* - * Command EndSession + * Command End */ -class WebRTCTransportProviderEndSession : public ClusterCommand +class WebRTCTransportRequestorEnd : public ClusterCommand { public: - WebRTCTransportProviderEndSession(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("end-session", credsIssuerConfig) + WebRTCTransportRequestorEnd(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("end", credsIssuerConfig) { AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); AddArgument("Reason", 0, UINT8_MAX, &mRequest.reason); @@ -13857,8 +14836,8 @@ class WebRTCTransportProviderEndSession : public ClusterCommand CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -13867,8 +14846,8 @@ class WebRTCTransportProviderEndSession : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -13877,7 +14856,7 @@ class WebRTCTransportProviderEndSession : public ClusterCommand } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type mRequest; }; /*----------------------------------------------------------------------------*\ @@ -16905,6 +17884,7 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo make_unique(Id, "tcacknowledgements", Attributes::TCAcknowledgements::Id, credsIssuerConfig), // make_unique(Id, "tcacknowledgements-required", Attributes::TCAcknowledgementsRequired::Id, credsIssuerConfig), // + make_unique(Id, "tcupdate-deadline", Attributes::TCUpdateDeadline::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -16933,6 +17913,8 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "tcacknowledgements-required", 0, 1, Attributes::TCAcknowledgementsRequired::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "tcupdate-deadline", 0, UINT32_MAX, Attributes::TCUpdateDeadline::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -16959,6 +17941,7 @@ void registerClusterGeneralCommissioning(Commands & commands, CredentialIssuerCo make_unique(Id, "tcacknowledgements", Attributes::TCAcknowledgements::Id, credsIssuerConfig), // make_unique(Id, "tcacknowledgements-required", Attributes::TCAcknowledgementsRequired::Id, credsIssuerConfig), // + make_unique(Id, "tcupdate-deadline", Attributes::TCUpdateDeadline::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -26457,6 +27440,384 @@ void registerClusterContentAppObserver(Commands & commands, CredentialIssuerComm commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterZoneManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::ZoneManagement; + + const char * clusterName = "ZoneManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // + make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // + make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "zones", Attributes::Zones::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "time-control", Attributes::TimeControl::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "sensitivity", 0, UINT8_MAX, Attributes::Sensitivity::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "supported-zone-sources", Attributes::SupportedZoneSources::Id, credsIssuerConfig), // + make_unique(Id, "zones", Attributes::Zones::Id, credsIssuerConfig), // + make_unique(Id, "time-control", Attributes::TimeControl::Id, credsIssuerConfig), // + make_unique(Id, "sensitivity", Attributes::Sensitivity::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "zone-triggered", Events::ZoneTriggered::Id, credsIssuerConfig), // + make_unique(Id, "zone-stopped", Events::ZoneStopped::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "zone-triggered", Events::ZoneTriggered::Id, credsIssuerConfig), // + make_unique(Id, "zone-stopped", Events::ZoneStopped::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} +void registerClusterCameraAvStreamManagement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::CameraAvStreamManagement; + + const char * clusterName = "CameraAvStreamManagement"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "max-concurrent-video-encoders", Attributes::MaxConcurrentVideoEncoders::Id, + credsIssuerConfig), // + make_unique(Id, "max-encoded-pixel-rate", Attributes::MaxEncodedPixelRate::Id, credsIssuerConfig), // + make_unique(Id, "video-sensor-params", Attributes::VideoSensorParams::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-capable", Attributes::NightVisionCapable::Id, credsIssuerConfig), // + make_unique(Id, "min-viewport", Attributes::MinViewport::Id, credsIssuerConfig), // + make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, + credsIssuerConfig), // + make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "two-way-talk-support", Attributes::TwoWayTalkSupport::Id, credsIssuerConfig), // + make_unique(Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, credsIssuerConfig), // + make_unique(Id, "max-network-bandwidth", Attributes::MaxNetworkBandwidth::Id, credsIssuerConfig), // + make_unique(Id, "current-frame-rate", Attributes::CurrentFrameRate::Id, credsIssuerConfig), // + make_unique(Id, "hdrmode-enabled", Attributes::HDRModeEnabled::Id, credsIssuerConfig), // + make_unique(Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, credsIssuerConfig), // + make_unique(Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, credsIssuerConfig), // + make_unique(Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, + credsIssuerConfig), // + make_unique(Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, + credsIssuerConfig), // + make_unique(Id, "soft-recording-privacy-mode-enabled", Attributes::SoftRecordingPrivacyModeEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "soft-livestream-privacy-mode-enabled", Attributes::SoftLivestreamPrivacyModeEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "hard-privacy-mode-on", Attributes::HardPrivacyModeOn::Id, credsIssuerConfig), // + make_unique(Id, "night-vision", Attributes::NightVision::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-illum", Attributes::NightVisionIllum::Id, credsIssuerConfig), // + make_unique(Id, "awbenabled", Attributes::AWBEnabled::Id, credsIssuerConfig), // + make_unique(Id, "auto-shutter-speed-enabled", Attributes::AutoShutterSpeedEnabled::Id, credsIssuerConfig), // + make_unique(Id, "auto-isoenabled", Attributes::AutoISOEnabled::Id, credsIssuerConfig), // + make_unique(Id, "viewport", Attributes::Viewport::Id, credsIssuerConfig), // + make_unique(Id, "speaker-muted", Attributes::SpeakerMuted::Id, credsIssuerConfig), // + make_unique(Id, "speaker-volume-level", Attributes::SpeakerVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-max-level", Attributes::SpeakerMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-min-level", Attributes::SpeakerMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-muted", Attributes::MicrophoneMuted::Id, credsIssuerConfig), // + make_unique(Id, "microphone-volume-level", Attributes::MicrophoneVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-max-level", Attributes::MicrophoneMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-min-level", Attributes::MicrophoneMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-agcenabled", Attributes::MicrophoneAGCEnabled::Id, credsIssuerConfig), // + make_unique(Id, "image-rotation", Attributes::ImageRotation::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-horizontal", Attributes::ImageFlipHorizontal::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-vertical", Attributes::ImageFlipVertical::Id, credsIssuerConfig), // + make_unique(Id, "local-video-recording-enabled", Attributes::LocalVideoRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "local-snapshot-recording-enabled", Attributes::LocalSnapshotRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "status-light-enabled", Attributes::StatusLightEnabled::Id, credsIssuerConfig), // + make_unique(Id, "status-light-brightness", Attributes::StatusLightBrightness::Id, credsIssuerConfig), // + make_unique(Id, "depth-sensor-status", Attributes::DepthSensorStatus::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>(Id, "max-concurrent-video-encoders", 0, UINT8_MAX, + Attributes::MaxConcurrentVideoEncoders::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-encoded-pixel-rate", 0, UINT32_MAX, Attributes::MaxEncodedPixelRate::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "video-sensor-params", Attributes::VideoSensorParams::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "night-vision-capable", 0, 1, Attributes::NightVisionCapable::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "min-viewport", Attributes::MinViewport::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-pre-roll-buffer-size", 0, UINT32_MAX, Attributes::MaxPreRollBufferSize::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>( + Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "two-way-talk-support", 0, UINT8_MAX, Attributes::TwoWayTalkSupport::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "max-network-bandwidth", 0, UINT32_MAX, Attributes::MaxNetworkBandwidth::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "current-frame-rate", 0, UINT16_MAX, Attributes::CurrentFrameRate::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "hdrmode-enabled", 0, 1, Attributes::HDRModeEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "soft-recording-privacy-mode-enabled", 0, 1, + Attributes::SoftRecordingPrivacyModeEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "soft-livestream-privacy-mode-enabled", 0, 1, + Attributes::SoftLivestreamPrivacyModeEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "hard-privacy-mode-on", 0, 1, Attributes::HardPrivacyModeOn::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>( + Id, "night-vision", 0, UINT8_MAX, Attributes::NightVision::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "night-vision-illum", 0, UINT8_MAX, Attributes::NightVisionIllum::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "awbenabled", 0, 1, Attributes::AWBEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "auto-shutter-speed-enabled", 0, 1, Attributes::AutoShutterSpeedEnabled::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "auto-isoenabled", 0, 1, Attributes::AutoISOEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>( + Id, "viewport", Attributes::Viewport::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-muted", 0, 1, Attributes::SpeakerMuted::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "speaker-volume-level", 0, UINT8_MAX, Attributes::SpeakerVolumeLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-max-level", 0, UINT8_MAX, Attributes::SpeakerMaxLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "speaker-min-level", 0, UINT8_MAX, Attributes::SpeakerMinLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "microphone-muted", 0, 1, Attributes::MicrophoneMuted::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "microphone-volume-level", 0, UINT8_MAX, Attributes::MicrophoneVolumeLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "microphone-max-level", 0, UINT8_MAX, Attributes::MicrophoneMaxLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "microphone-min-level", 0, UINT8_MAX, Attributes::MicrophoneMinLevel::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "microphone-agcenabled", 0, 1, Attributes::MicrophoneAGCEnabled::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "image-rotation", 0, UINT16_MAX, Attributes::ImageRotation::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "image-flip-horizontal", 0, 1, Attributes::ImageFlipHorizontal::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "image-flip-vertical", 0, 1, Attributes::ImageFlipVertical::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "local-video-recording-enabled", 0, 1, Attributes::LocalVideoRecordingEnabled::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "local-snapshot-recording-enabled", 0, 1, + Attributes::LocalSnapshotRecordingEnabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>(Id, "status-light-enabled", 0, 1, Attributes::StatusLightEnabled::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "status-light-brightness", 0, UINT8_MAX, Attributes::StatusLightBrightness::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>( + Id, "depth-sensor-status", 0, UINT8_MAX, Attributes::DepthSensorStatus::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "max-concurrent-video-encoders", Attributes::MaxConcurrentVideoEncoders::Id, + credsIssuerConfig), // + make_unique(Id, "max-encoded-pixel-rate", Attributes::MaxEncodedPixelRate::Id, credsIssuerConfig), // + make_unique(Id, "video-sensor-params", Attributes::VideoSensorParams::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-capable", Attributes::NightVisionCapable::Id, credsIssuerConfig), // + make_unique(Id, "min-viewport", Attributes::MinViewport::Id, credsIssuerConfig), // + make_unique(Id, "rate-distortion-trade-off-points", Attributes::RateDistortionTradeOffPoints::Id, + credsIssuerConfig), // + make_unique(Id, "max-pre-roll-buffer-size", Attributes::MaxPreRollBufferSize::Id, credsIssuerConfig), // + make_unique(Id, "microphone-capabilities", Attributes::MicrophoneCapabilities::Id, + credsIssuerConfig), // + make_unique(Id, "speaker-capabilities", Attributes::SpeakerCapabilities::Id, credsIssuerConfig), // + make_unique(Id, "two-way-talk-support", Attributes::TwoWayTalkSupport::Id, credsIssuerConfig), // + make_unique(Id, "supported-snapshot-params", Attributes::SupportedSnapshotParams::Id, + credsIssuerConfig), // + make_unique(Id, "max-network-bandwidth", Attributes::MaxNetworkBandwidth::Id, credsIssuerConfig), // + make_unique(Id, "current-frame-rate", Attributes::CurrentFrameRate::Id, credsIssuerConfig), // + make_unique(Id, "hdrmode-enabled", Attributes::HDRModeEnabled::Id, credsIssuerConfig), // + make_unique(Id, "current-video-codecs", Attributes::CurrentVideoCodecs::Id, credsIssuerConfig), // + make_unique(Id, "current-snapshot-config", Attributes::CurrentSnapshotConfig::Id, credsIssuerConfig), // + make_unique(Id, "fabrics-using-camera", Attributes::FabricsUsingCamera::Id, credsIssuerConfig), // + make_unique(Id, "allocated-video-streams", Attributes::AllocatedVideoStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-audio-streams", Attributes::AllocatedAudioStreams::Id, credsIssuerConfig), // + make_unique(Id, "allocated-snapshot-streams", Attributes::AllocatedSnapshotStreams::Id, + credsIssuerConfig), // + make_unique(Id, "ranked-video-stream-priorities-list", Attributes::RankedVideoStreamPrioritiesList::Id, + credsIssuerConfig), // + make_unique(Id, "soft-recording-privacy-mode-enabled", Attributes::SoftRecordingPrivacyModeEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "soft-livestream-privacy-mode-enabled", + Attributes::SoftLivestreamPrivacyModeEnabled::Id, credsIssuerConfig), // + make_unique(Id, "hard-privacy-mode-on", Attributes::HardPrivacyModeOn::Id, credsIssuerConfig), // + make_unique(Id, "night-vision", Attributes::NightVision::Id, credsIssuerConfig), // + make_unique(Id, "night-vision-illum", Attributes::NightVisionIllum::Id, credsIssuerConfig), // + make_unique(Id, "awbenabled", Attributes::AWBEnabled::Id, credsIssuerConfig), // + make_unique(Id, "auto-shutter-speed-enabled", Attributes::AutoShutterSpeedEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "auto-isoenabled", Attributes::AutoISOEnabled::Id, credsIssuerConfig), // + make_unique(Id, "viewport", Attributes::Viewport::Id, credsIssuerConfig), // + make_unique(Id, "speaker-muted", Attributes::SpeakerMuted::Id, credsIssuerConfig), // + make_unique(Id, "speaker-volume-level", Attributes::SpeakerVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-max-level", Attributes::SpeakerMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "speaker-min-level", Attributes::SpeakerMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-muted", Attributes::MicrophoneMuted::Id, credsIssuerConfig), // + make_unique(Id, "microphone-volume-level", Attributes::MicrophoneVolumeLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-max-level", Attributes::MicrophoneMaxLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-min-level", Attributes::MicrophoneMinLevel::Id, credsIssuerConfig), // + make_unique(Id, "microphone-agcenabled", Attributes::MicrophoneAGCEnabled::Id, credsIssuerConfig), // + make_unique(Id, "image-rotation", Attributes::ImageRotation::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-horizontal", Attributes::ImageFlipHorizontal::Id, credsIssuerConfig), // + make_unique(Id, "image-flip-vertical", Attributes::ImageFlipVertical::Id, credsIssuerConfig), // + make_unique(Id, "local-video-recording-enabled", Attributes::LocalVideoRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "local-snapshot-recording-enabled", Attributes::LocalSnapshotRecordingEnabled::Id, + credsIssuerConfig), // + make_unique(Id, "status-light-enabled", Attributes::StatusLightEnabled::Id, credsIssuerConfig), // + make_unique(Id, "status-light-brightness", Attributes::StatusLightBrightness::Id, credsIssuerConfig), // + make_unique(Id, "depth-sensor-status", Attributes::DepthSensorStatus::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "video-stream-changed", Events::VideoStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "audio-stream-changed", Events::AudioStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "snapshot-stream-changed", Events::SnapshotStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "video-stream-changed", Events::VideoStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "audio-stream-changed", Events::AudioStreamChanged::Id, credsIssuerConfig), // + make_unique(Id, "snapshot-stream-changed", Events::SnapshotStreamChanged::Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::WebRTCTransportProvider; @@ -26518,6 +27879,66 @@ void registerClusterWebRTCTransportProvider(Commands & commands, CredentialIssue commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterWebRTCTransportRequestor(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::WebRTCTransportRequestor; + + const char * clusterName = "WebRTCTransportRequestor"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "current-sessions", Attributes::CurrentSessions::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>>( + Id, "current-sessions", Attributes::CurrentSessions::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "current-sessions", Attributes::CurrentSessions::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::Chime; @@ -27446,7 +28867,10 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); + registerClusterZoneManagement(commands, credsIssuerConfig); + registerClusterCameraAvStreamManagement(commands, credsIssuerConfig); registerClusterWebRTCTransportProvider(commands, credsIssuerConfig); + registerClusterWebRTCTransportRequestor(commands, credsIssuerConfig); registerClusterChime(commands, credsIssuerConfig); registerClusterEcosystemInformation(commands, credsIssuerConfig); registerClusterCommissionerControl(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 76313bf47a..670d306354 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -540,6 +540,47 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Opera ComplexArgumentParser::Finalize(request.operationalStateLabel); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.x1", "x1", value.isMember("x1"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.y1", "y1", value.isMember("y1"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.x2", "x2", value.isMember("x2"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ViewportStruct.y2", "y2", value.isMember("y2"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x1"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x1, value["x1"])); + valueCopy.removeMember("x1"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y1"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y1, value["y1"])); + valueCopy.removeMember("y1"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x2"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x2, value["x2"])); + valueCopy.removeMember("x2"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y2"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y2, value["y2"])); + valueCopy.removeMember("y2"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ViewportStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.x1); + ComplexArgumentParser::Finalize(request.y1); + ComplexArgumentParser::Finalize(request.x2); + ComplexArgumentParser::Finalize(request.y2); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::WebRTCSessionStruct::Type & request, Json::Value & value) @@ -5784,6 +5825,651 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Struct ComplexArgumentParser::Finalize(request.ratingNameDesc); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianVertexStruct.x", "x", value.isMember("x"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianVertexStruct.y", "y", value.isMember("y"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "x"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.x, value["x"])); + valueCopy.removeMember("x"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "y"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.y, value["y"])); + valueCopy.removeMember("y"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.x); + ComplexArgumentParser::Finalize(request.y); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.use", "use", value.isMember("use"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TwoDCartesianZoneStruct.vertices", "vertices", value.isMember("vertices"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "use"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.use, value["use"])); + valueCopy.removeMember("use"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "vertices"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.vertices, value["vertices"])); + valueCopy.removeMember("vertices"); + + if (value.isMember("color")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "color"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.color, value["color"])); + } + valueCopy.removeMember("color"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.use); + ComplexArgumentParser::Finalize(request.vertices); + ComplexArgumentParser::Finalize(request.color); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneID", "zoneID", value.isMember("zoneID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneType", "zoneType", value.isMember("zoneType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ZoneInformationStruct.zoneSource", "zoneSource", value.isMember("zoneSource"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneID, value["zoneID"])); + valueCopy.removeMember("zoneID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneType, value["zoneType"])); + valueCopy.removeMember("zoneType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "zoneSource"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.zoneSource, value["zoneSource"])); + valueCopy.removeMember("zoneSource"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.zoneID); + ComplexArgumentParser::Finalize(request.zoneType); + ComplexArgumentParser::Finalize(request.zoneSource); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.initialDuration", + "initialDuration", value.isMember("initialDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.augmentationDuration", + "augmentationDuration", value.isMember("augmentationDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.maxDuration", "maxDuration", + value.isMember("maxDuration"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ZoneTriggeringTimeControlStruct.blindDuration", "blindDuration", + value.isMember("blindDuration"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "initialDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.initialDuration, value["initialDuration"])); + valueCopy.removeMember("initialDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "augmentationDuration"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.augmentationDuration, value["augmentationDuration"])); + valueCopy.removeMember("augmentationDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxDuration, value["maxDuration"])); + valueCopy.removeMember("maxDuration"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "blindDuration"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.blindDuration, value["blindDuration"])); + valueCopy.removeMember("blindDuration"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.initialDuration); + ComplexArgumentParser::Finalize(request.augmentationDuration); + ComplexArgumentParser::Finalize(request.maxDuration); + ComplexArgumentParser::Finalize(request.blindDuration); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoResolutionStruct.width", "width", value.isMember("width"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoResolutionStruct.height", "height", value.isMember("height"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "width"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.width, value["width"])); + valueCopy.removeMember("width"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "height"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.height, value["height"])); + valueCopy.removeMember("height"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.width); + ComplexArgumentParser::Finalize(request.height); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.videoStreamID", "videoStreamID", + value.isMember("videoStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.streamType", "streamType", value.isMember("streamType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.videoCodec", "videoCodec", value.isMember("videoCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minFrameRate", "minFrameRate", value.isMember("minFrameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxFrameRate", "maxFrameRate", value.isMember("maxFrameRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minResolution", "minResolution", + value.isMember("minResolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxResolution", "maxResolution", + value.isMember("maxResolution"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minBitRate", "minBitRate", value.isMember("minBitRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxBitRate", "maxBitRate", value.isMember("maxBitRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.minFragmentLen", "minFragmentLen", + value.isMember("minFragmentLen"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.maxFragmentLen", "maxFragmentLen", + value.isMember("maxFragmentLen"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "videoStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.videoStreamID, value["videoStreamID"])); + valueCopy.removeMember("videoStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamType, value["streamType"])); + valueCopy.removeMember("streamType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "videoCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.videoCodec, value["videoCodec"])); + valueCopy.removeMember("videoCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minFrameRate, value["minFrameRate"])); + valueCopy.removeMember("minFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFrameRate, value["maxFrameRate"])); + valueCopy.removeMember("maxFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minResolution, value["minResolution"])); + valueCopy.removeMember("minResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxResolution, value["maxResolution"])); + valueCopy.removeMember("maxResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minBitRate, value["minBitRate"])); + valueCopy.removeMember("minBitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxBitRate, value["maxBitRate"])); + valueCopy.removeMember("maxBitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minFragmentLen"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minFragmentLen, value["minFragmentLen"])); + valueCopy.removeMember("minFragmentLen"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFragmentLen"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFragmentLen, value["maxFragmentLen"])); + valueCopy.removeMember("maxFragmentLen"); + + if (value.isMember("watermarkEnabled")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "watermarkEnabled"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.watermarkEnabled, value["watermarkEnabled"])); + } + valueCopy.removeMember("watermarkEnabled"); + + if (value.isMember("OSDEnabled")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "OSDEnabled"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.OSDEnabled, value["OSDEnabled"])); + } + valueCopy.removeMember("OSDEnabled"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.videoStreamID); + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.videoCodec); + ComplexArgumentParser::Finalize(request.minFrameRate); + ComplexArgumentParser::Finalize(request.maxFrameRate); + ComplexArgumentParser::Finalize(request.minResolution); + ComplexArgumentParser::Finalize(request.maxResolution); + ComplexArgumentParser::Finalize(request.minBitRate); + ComplexArgumentParser::Finalize(request.maxBitRate); + ComplexArgumentParser::Finalize(request.minFragmentLen); + ComplexArgumentParser::Finalize(request.maxFragmentLen); + ComplexArgumentParser::Finalize(request.watermarkEnabled); + ComplexArgumentParser::Finalize(request.OSDEnabled); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.snapshotStreamID", "snapshotStreamID", + value.isMember("snapshotStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.imageCodec", "imageCodec", value.isMember("imageCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.frameRate", "frameRate", value.isMember("frameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.bitRate", "bitRate", value.isMember("bitRate"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.minResolution", "minResolution", + value.isMember("minResolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.maxResolution", "maxResolution", + value.isMember("maxResolution"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.quality", "quality", value.isMember("quality"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "snapshotStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.snapshotStreamID, value["snapshotStreamID"])); + valueCopy.removeMember("snapshotStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "imageCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.imageCodec, value["imageCodec"])); + valueCopy.removeMember("imageCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "frameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.frameRate, value["frameRate"])); + valueCopy.removeMember("frameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitRate, value["bitRate"])); + valueCopy.removeMember("bitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minResolution, value["minResolution"])); + valueCopy.removeMember("minResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxResolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxResolution, value["maxResolution"])); + valueCopy.removeMember("maxResolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "quality"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.quality, value["quality"])); + valueCopy.removeMember("quality"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.snapshotStreamID); + ComplexArgumentParser::Finalize(request.imageCodec); + ComplexArgumentParser::Finalize(request.frameRate); + ComplexArgumentParser::Finalize(request.bitRate); + ComplexArgumentParser::Finalize(request.minResolution); + ComplexArgumentParser::Finalize(request.maxResolution); + ComplexArgumentParser::Finalize(request.quality); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotParamsStruct.resolution", "resolution", value.isMember("resolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("SnapshotParamsStruct.maxFrameRate", "maxFrameRate", + value.isMember("maxFrameRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("SnapshotParamsStruct.imageCodec", "imageCodec", value.isMember("imageCodec"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "resolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.resolution, value["resolution"])); + valueCopy.removeMember("resolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFrameRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFrameRate, value["maxFrameRate"])); + valueCopy.removeMember("maxFrameRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "imageCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.imageCodec, value["imageCodec"])); + valueCopy.removeMember("imageCodec"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.resolution); + ComplexArgumentParser::Finalize(request.maxFrameRate); + ComplexArgumentParser::Finalize(request.imageCodec); +} + +CHIP_ERROR ComplexArgumentParser::Setup( + const char * label, chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("RateDistortionTradeOffPointsStruct.codec", "codec", value.isMember("codec"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("RateDistortionTradeOffPointsStruct.resolution", "resolution", + value.isMember("resolution"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("RateDistortionTradeOffPointsStruct.minBitRate", "minBitRate", + value.isMember("minBitRate"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "codec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.codec, value["codec"])); + valueCopy.removeMember("codec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "resolution"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.resolution, value["resolution"])); + valueCopy.removeMember("resolution"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "minBitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.minBitRate, value["minBitRate"])); + valueCopy.removeMember("minBitRate"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.codec); + ComplexArgumentParser::Finalize(request.resolution); + ComplexArgumentParser::Finalize(request.minBitRate); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.maxNumberOfChannels", + "maxNumberOfChannels", value.isMember("maxNumberOfChannels"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedCodecs", "supportedCodecs", + value.isMember("supportedCodecs"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedSampleRates", + "supportedSampleRates", value.isMember("supportedSampleRates"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioCapabilitiesStruct.supportedBitDepths", + "supportedBitDepths", value.isMember("supportedBitDepths"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxNumberOfChannels"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxNumberOfChannels, value["maxNumberOfChannels"])); + valueCopy.removeMember("maxNumberOfChannels"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedCodecs"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.supportedCodecs, value["supportedCodecs"])); + valueCopy.removeMember("supportedCodecs"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedSampleRates"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.supportedSampleRates, value["supportedSampleRates"])); + valueCopy.removeMember("supportedSampleRates"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "supportedBitDepths"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.supportedBitDepths, value["supportedBitDepths"])); + valueCopy.removeMember("supportedBitDepths"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.maxNumberOfChannels); + ComplexArgumentParser::Finalize(request.supportedCodecs); + ComplexArgumentParser::Finalize(request.supportedSampleRates); + ComplexArgumentParser::Finalize(request.supportedBitDepths); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.audioStreamID", "audioStreamID", + value.isMember("audioStreamID"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.streamType", "streamType", value.isMember("streamType"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.audioCodec", "audioCodec", value.isMember("audioCodec"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.channelCount", "channelCount", value.isMember("channelCount"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.sampleRate", "sampleRate", value.isMember("sampleRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.bitRate", "bitRate", value.isMember("bitRate"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.bitDepth", "bitDepth", value.isMember("bitDepth"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AudioStreamStruct.referenceCount", "referenceCount", + value.isMember("referenceCount"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioStreamID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioStreamID, value["audioStreamID"])); + valueCopy.removeMember("audioStreamID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "streamType"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.streamType, value["streamType"])); + valueCopy.removeMember("streamType"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "audioCodec"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.audioCodec, value["audioCodec"])); + valueCopy.removeMember("audioCodec"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "channelCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.channelCount, value["channelCount"])); + valueCopy.removeMember("channelCount"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sampleRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sampleRate, value["sampleRate"])); + valueCopy.removeMember("sampleRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitRate"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitRate, value["bitRate"])); + valueCopy.removeMember("bitRate"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "bitDepth"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.bitDepth, value["bitDepth"])); + valueCopy.removeMember("bitDepth"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "referenceCount"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.referenceCount, value["referenceCount"])); + valueCopy.removeMember("referenceCount"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.audioStreamID); + ComplexArgumentParser::Finalize(request.streamType); + ComplexArgumentParser::Finalize(request.audioCodec); + ComplexArgumentParser::Finalize(request.channelCount); + ComplexArgumentParser::Finalize(request.sampleRate); + ComplexArgumentParser::Finalize(request.bitRate); + ComplexArgumentParser::Finalize(request.bitDepth); + ComplexArgumentParser::Finalize(request.referenceCount); +} + +CHIP_ERROR +ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.sensorWidth", "sensorWidth", + value.isMember("sensorWidth"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.sensorHeight", "sensorHeight", + value.isMember("sensorHeight"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.HDRCapable", "HDRCapable", value.isMember("HDRCapable"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.maxFPS", "maxFPS", value.isMember("maxFPS"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("VideoSensorParamsStruct.maxHDRFPS", "maxHDRFPS", value.isMember("maxHDRFPS"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensorWidth"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensorWidth, value["sensorWidth"])); + valueCopy.removeMember("sensorWidth"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "sensorHeight"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.sensorHeight, value["sensorHeight"])); + valueCopy.removeMember("sensorHeight"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "HDRCapable"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.HDRCapable, value["HDRCapable"])); + valueCopy.removeMember("HDRCapable"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxFPS"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxFPS, value["maxFPS"])); + valueCopy.removeMember("maxFPS"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "maxHDRFPS"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.maxHDRFPS, value["maxHDRFPS"])); + valueCopy.removeMember("maxHDRFPS"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize( + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.sensorWidth); + ComplexArgumentParser::Finalize(request.sensorHeight); + ComplexArgumentParser::Finalize(request.HDRCapable); + ComplexArgumentParser::Finalize(request.maxFPS); + ComplexArgumentParser::Finalize(request.maxHDRFPS); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 777f61afb9..38b3aee08f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -86,6 +86,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ViewportStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::detail::Structs::ViewportStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::WebRTCSessionStruct::Type & request, Json::Value & value); @@ -668,6 +673,75 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl: static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 479deb7799..d49df9e342 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -465,6 +465,47 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("X1", indent + 1, value.x1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X1'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Y1", indent + 1, value.y1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y1'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("X2", indent + 1, value.x2); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X2'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Y2", indent + 1, value.y2); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y2'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::WebRTCSessionStruct::DecodableType & value) { @@ -5103,23 +5144,24 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("ChimeID", indent + 1, value.chimeID); + CHIP_ERROR err = LogValue("X", indent + 1, value.x); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'X'"); return err; } } { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + CHIP_ERROR err = LogValue("Y", indent + 1, value.y); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Y'"); return err; } } @@ -5130,70 +5172,72 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceName'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceNameLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); return err; } } { - CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); + CHIP_ERROR err = LogValue("Use", indent + 1, value.use); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Use'"); return err; } } { - CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); + CHIP_ERROR err = LogValue("Vertices", indent + 1, value.vertices); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Vertices'"); return err; } } { - CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); + CHIP_ERROR err = LogValue("Color", indent + 1, value.color); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Color'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); + CHIP_ERROR err = LogValue("ZoneID", indent + 1, value.zoneID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneID'"); return err; } } { - CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); + CHIP_ERROR err = LogValue("ZoneType", indent + 1, value.zoneType); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneType'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("ZoneSource", indent + 1, value.zoneSource); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ZoneSource'"); return err; } } @@ -5202,40 +5246,40 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); + CHIP_ERROR err = LogValue("InitialDuration", indent + 1, value.initialDuration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'InitialDuration'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); + CHIP_ERROR err = LogValue("AugmentationDuration", indent + 1, value.augmentationDuration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AugmentationDuration'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); + CHIP_ERROR err = LogValue("MaxDuration", indent + 1, value.maxDuration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxDuration'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("BlindDuration", indent + 1, value.blindDuration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BlindDuration'"); return err; } } @@ -5244,153 +5288,146 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("Width", indent + 1, value.width); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Width'"); return err; } } { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("Height", indent + 1, value.height); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Height'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); + CHIP_ERROR err = LogValue("VideoStreamID", indent + 1, value.videoStreamID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'VideoStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("E", indent + 1, value.e); + CHIP_ERROR err = LogValue("StreamType", indent + 1, value.streamType); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamType'"); return err; } } { - CHIP_ERROR err = LogValue("F", indent + 1, value.f); + CHIP_ERROR err = LogValue("VideoCodec", indent + 1, value.videoCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'VideoCodec'"); return err; } } { - CHIP_ERROR err = LogValue("G", indent + 1, value.g); + CHIP_ERROR err = LogValue("MinFrameRate", indent + 1, value.minFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("H", indent + 1, value.h); + CHIP_ERROR err = LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'H'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("I", indent + 1, value.i); + CHIP_ERROR err = LogValue("MinResolution", indent + 1, value.minResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinResolution'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("FabricSensitiveInt8u", indent + 1, value.fabricSensitiveInt8u); + CHIP_ERROR err = LogValue("MaxResolution", indent + 1, value.maxResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxResolution'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalFabricSensitiveInt8u", indent + 1, value.optionalFabricSensitiveInt8u); + CHIP_ERROR err = LogValue("MinBitRate", indent + 1, value.minBitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalFabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinBitRate'"); return err; } } { - CHIP_ERROR err = LogValue("NullableFabricSensitiveInt8u", indent + 1, value.nullableFabricSensitiveInt8u); + CHIP_ERROR err = LogValue("MaxBitRate", indent + 1, value.maxBitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableFabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxBitRate'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalFabricSensitiveInt8u", indent + 1, value.nullableOptionalFabricSensitiveInt8u); + CHIP_ERROR err = LogValue("MinFragmentLen", indent + 1, value.minFragmentLen); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, - "Struct truncated due to invalid value for 'NullableOptionalFabricSensitiveInt8u'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinFragmentLen'"); return err; } } { - CHIP_ERROR err = LogValue("FabricSensitiveCharString", indent + 1, value.fabricSensitiveCharString); + CHIP_ERROR err = LogValue("MaxFragmentLen", indent + 1, value.maxFragmentLen); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveCharString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFragmentLen'"); return err; } } { - CHIP_ERROR err = LogValue("FabricSensitiveStruct", indent + 1, value.fabricSensitiveStruct); + CHIP_ERROR err = LogValue("WatermarkEnabled", indent + 1, value.watermarkEnabled); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'WatermarkEnabled'"); return err; } } { - CHIP_ERROR err = LogValue("FabricSensitiveInt8uList", indent + 1, value.fabricSensitiveInt8uList); + CHIP_ERROR err = LogValue("OSDEnabled", indent + 1, value.OSDEnabled); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8uList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OSDEnabled'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } @@ -5401,102 +5438,138 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType & value) + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("NullableInt", indent + 1, value.nullableInt); + CHIP_ERROR err = LogValue("SnapshotStreamID", indent + 1, value.snapshotStreamID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SnapshotStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalInt", indent + 1, value.optionalInt); + CHIP_ERROR err = LogValue("ImageCodec", indent + 1, value.imageCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ImageCodec'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalInt", indent + 1, value.nullableOptionalInt); + CHIP_ERROR err = LogValue("FrameRate", indent + 1, value.frameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalInt'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("NullableString", indent + 1, value.nullableString); + CHIP_ERROR err = LogValue("BitRate", indent + 1, value.bitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitRate'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalString", indent + 1, value.optionalString); + CHIP_ERROR err = LogValue("MinResolution", indent + 1, value.minResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinResolution'"); return err; } } { - CHIP_ERROR err = LogValue("NullableOptionalString", indent + 1, value.nullableOptionalString); + CHIP_ERROR err = LogValue("MaxResolution", indent + 1, value.maxResolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalString'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxResolution'"); return err; } } { - CHIP_ERROR err = LogValue("NullableStruct", indent + 1, value.nullableStruct); + CHIP_ERROR err = LogValue("Quality", indent + 1, value.quality); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Quality'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalStruct", indent + 1, value.optionalStruct); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("NullableOptionalStruct", indent + 1, value.nullableOptionalStruct); + CHIP_ERROR err = LogValue("Resolution", indent + 1, value.resolution); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalStruct'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Resolution'"); return err; } } { - CHIP_ERROR err = LogValue("NullableList", indent + 1, value.nullableList); + CHIP_ERROR err = LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFrameRate'"); return err; } } { - CHIP_ERROR err = LogValue("OptionalList", indent + 1, value.optionalList); + CHIP_ERROR err = LogValue("ImageCodec", indent + 1, value.imageCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ImageCodec'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("NullableOptionalList", indent + 1, value.nullableOptionalList); + CHIP_ERROR err = LogValue("Codec", indent + 1, value.codec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalList'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Codec'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Resolution", indent + 1, value.resolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Resolution'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MinBitRate", indent + 1, value.minBitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MinBitRate'"); return err; } } @@ -5505,39 +5578,40 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::NestedStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); + CHIP_ERROR err = LogValue("MaxNumberOfChannels", indent + 1, value.maxNumberOfChannels); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxNumberOfChannels'"); return err; } } { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("SupportedCodecs", indent + 1, value.supportedCodecs); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedCodecs'"); return err; } } { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("SupportedSampleRates", indent + 1, value.supportedSampleRates); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedSampleRates'"); return err; } } { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); + CHIP_ERROR err = LogValue("SupportedBitDepths", indent + 1, value.supportedBitDepths); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SupportedBitDepths'"); return err; } } @@ -5546,80 +5620,72 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::NestedStructList::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); + CHIP_ERROR err = LogValue("AudioStreamID", indent + 1, value.audioStreamID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioStreamID'"); return err; } } { - CHIP_ERROR err = LogValue("B", indent + 1, value.b); + CHIP_ERROR err = LogValue("StreamType", indent + 1, value.streamType); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StreamType'"); return err; } } { - CHIP_ERROR err = LogValue("C", indent + 1, value.c); + CHIP_ERROR err = LogValue("AudioCodec", indent + 1, value.audioCodec); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AudioCodec'"); return err; } } { - CHIP_ERROR err = LogValue("D", indent + 1, value.d); + CHIP_ERROR err = LogValue("ChannelCount", indent + 1, value.channelCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChannelCount'"); return err; } } { - CHIP_ERROR err = LogValue("E", indent + 1, value.e); + CHIP_ERROR err = LogValue("SampleRate", indent + 1, value.sampleRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SampleRate'"); return err; } } { - CHIP_ERROR err = LogValue("F", indent + 1, value.f); + CHIP_ERROR err = LogValue("BitRate", indent + 1, value.bitRate); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitRate'"); return err; } } { - CHIP_ERROR err = LogValue("G", indent + 1, value.g); + CHIP_ERROR err = LogValue("BitDepth", indent + 1, value.bitDepth); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BitDepth'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::DoubleNestedStructList::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("A", indent + 1, value.a); + CHIP_ERROR err = LogValue("ReferenceCount", indent + 1, value.referenceCount); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ReferenceCount'"); return err; } } @@ -5628,23 +5694,48 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::UnitTesting::Structs::TestListStructOctet::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue( + const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("Member1", indent + 1, value.member1); + CHIP_ERROR err = LogValue("SensorWidth", indent + 1, value.sensorWidth); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Member1'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SensorWidth'"); return err; } } { - CHIP_ERROR err = LogValue("Member2", indent + 1, value.member2); + CHIP_ERROR err = LogValue("SensorHeight", indent + 1, value.sensorHeight); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Member2'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SensorHeight'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("HDRCapable", indent + 1, value.HDRCapable); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'HDRCapable'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxFPS", indent + 1, value.maxFPS); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxFPS'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MaxHDRFPS", indent + 1, value.maxHDRFPS); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MaxHDRFPS'"); return err; } } @@ -5654,94 +5745,96 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccessControl::Events::AccessControlEntryChanged::DecodableType & value) + const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AdminNodeID", indent + 1, value.adminNodeID); + CHIP_ERROR err = LogValue("ChimeID", indent + 1, value.chimeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminNodeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminPasscodeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ChangeType", indent + 1, value.changeType); + CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChangeType'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceName'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("LatestValue", indent + 1, value.latestValue); + CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LatestValue'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceNameLastEdit'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccessControl::Events::AccessControlExtensionChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AdminNodeID", indent + 1, value.adminNodeID); + CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminNodeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); + CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminPasscodeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ChangeType", indent + 1, value.changeType); + CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChangeType'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("LatestValue", indent + 1, value.latestValue); + CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LatestValue'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -5749,39 +5842,41 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccessControl::Events::FabricRestrictionReviewUpdate::DecodableType & value) + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Token", indent + 1, value.token); + CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Token'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Instruction", indent + 1, value.instruction); + CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Instruction'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ARLRequestFlowUrl", indent + 1, value.ARLRequestFlowUrl); + CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ARLRequestFlowUrl'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -5789,85 +5884,80 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Actions::Events::StateChanged::DecodableType & value) + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ActionID", indent + 1, value.actionID); + CHIP_ERROR err = LogValue("A", indent + 1, value.a); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActionID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("InvokeID", indent + 1, value.invokeID); + CHIP_ERROR err = LogValue("B", indent + 1, value.b); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'InvokeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); + CHIP_ERROR err = LogValue("C", indent + 1, value.c); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Actions::Events::ActionFailed::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ActionID", indent + 1, value.actionID); + CHIP_ERROR err = LogValue("D", indent + 1, value.d); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActionID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("InvokeID", indent + 1, value.invokeID); + CHIP_ERROR err = LogValue("E", indent + 1, value.e); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'InvokeID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); + CHIP_ERROR err = LogValue("F", indent + 1, value.f); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Error", indent + 1, value.error); + CHIP_ERROR err = LogValue("G", indent + 1, value.g); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Error'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BasicInformation::Events::StartUp::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); + CHIP_ERROR err = LogValue("H", indent + 1, value.h); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'H'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("I", indent + 1, value.i); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'"); return err; } } @@ -5875,103 +5965,73 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BasicInformation::Events::ShutDown::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BasicInformation::Events::Leave::DecodableType & value) + const chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("FabricSensitiveInt8u", indent + 1, value.fabricSensitiveInt8u); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8u'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BasicInformation::Events::ReachableChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ReachableNewValue", indent + 1, value.reachableNewValue); + CHIP_ERROR err = LogValue("OptionalFabricSensitiveInt8u", indent + 1, value.optionalFabricSensitiveInt8u); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReachableNewValue'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalFabricSensitiveInt8u'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PreviousState", indent + 1, value.previousState); + CHIP_ERROR err = LogValue("NullableFabricSensitiveInt8u", indent + 1, value.nullableFabricSensitiveInt8u); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousState'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableFabricSensitiveInt8u'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); + CHIP_ERROR err = LogValue("NullableOptionalFabricSensitiveInt8u", indent + 1, value.nullableOptionalFabricSensitiveInt8u); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); + DataModelLogger::LogString(indent + 1, + "Struct truncated due to invalid value for 'NullableOptionalFabricSensitiveInt8u'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + CHIP_ERROR err = LogValue("FabricSensitiveCharString", indent + 1, value.fabricSensitiveCharString); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveCharString'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("TargetSoftwareVersion", indent + 1, value.targetSoftwareVersion); + CHIP_ERROR err = LogValue("FabricSensitiveStruct", indent + 1, value.fabricSensitiveStruct); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TargetSoftwareVersion'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveStruct'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); + CHIP_ERROR err = LogValue("FabricSensitiveInt8uList", indent + 1, value.fabricSensitiveInt8uList); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricSensitiveInt8uList'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ProductID", indent + 1, value.productID); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ProductID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -5979,135 +6039,105 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType & value) + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Structs::NullablesAndOptionalsStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); + CHIP_ERROR err = LogValue("NullableInt", indent + 1, value.nullableInt); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableInt'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("BytesDownloaded", indent + 1, value.bytesDownloaded); + CHIP_ERROR err = LogValue("OptionalInt", indent + 1, value.optionalInt); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BytesDownloaded'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalInt'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ProgressPercent", indent + 1, value.progressPercent); + CHIP_ERROR err = LogValue("NullableOptionalInt", indent + 1, value.nullableOptionalInt); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ProgressPercent'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalInt'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PlatformCode", indent + 1, value.platformCode); + CHIP_ERROR err = LogValue("NullableString", indent + 1, value.nullableString); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlatformCode'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableString'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PowerSource::Events::WiredFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("OptionalString", indent + 1, value.optionalString); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalString'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("NullableOptionalString", indent + 1, value.nullableOptionalString); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalString'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PowerSource::Events::BatFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("NullableStruct", indent + 1, value.nullableStruct); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableStruct'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("OptionalStruct", indent + 1, value.optionalStruct); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalStruct'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PowerSource::Events::BatChargeFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("NullableOptionalStruct", indent + 1, value.nullableOptionalStruct); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalStruct'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("NullableList", indent + 1, value.nullableList); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableList'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("OptionalList", indent + 1, value.optionalList); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OptionalList'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("NullableOptionalList", indent + 1, value.nullableOptionalList); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'NullableOptionalList'"); return err; } } @@ -6115,47 +6145,40 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Events::RadioFaultChange::DecodableType & value) + const chip::app::Clusters::UnitTesting::Structs::NestedStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("A", indent + 1, value.a); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("B", indent + 1, value.b); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Events::NetworkFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("C", indent + 1, value.c); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("D", indent + 1, value.d); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); return err; } } @@ -6163,87 +6186,64 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Events::BootReason::DecodableType & value) + const chip::app::Clusters::UnitTesting::Structs::NestedStructList::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("BootReason", indent + 1, value.bootReason); + CHIP_ERROR err = LogValue("A", indent + 1, value.a); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BootReason'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SoftwareDiagnostics::Events::SoftwareFault::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Id", indent + 1, value.id); + CHIP_ERROR err = LogValue("B", indent + 1, value.b); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Id'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'B'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Name", indent + 1, value.name); + CHIP_ERROR err = LogValue("C", indent + 1, value.c); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Name'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'C'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FaultRecording", indent + 1, value.faultRecording); + CHIP_ERROR err = LogValue("D", indent + 1, value.d); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultRecording'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ConnectionStatus", indent + 1, value.connectionStatus); + CHIP_ERROR err = LogValue("E", indent + 1, value.e); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionStatus'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'E'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ThreadNetworkDiagnostics::Events::NetworkFaultChange::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); + CHIP_ERROR err = LogValue("F", indent + 1, value.f); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'F'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + CHIP_ERROR err = LogValue("G", indent + 1, value.g); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'G'"); return err; } } @@ -6251,15 +6251,16 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const WiFiNetworkDiagnostics::Events::Disconnection::DecodableType & value) + const chip::app::Clusters::UnitTesting::Structs::DoubleNestedStructList::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ReasonCode", indent + 1, value.reasonCode); + CHIP_ERROR err = LogValue("A", indent + 1, value.a); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReasonCode'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'A'"); return err; } } @@ -6267,23 +6268,24 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType & value) + const chip::app::Clusters::UnitTesting::Structs::TestListStructOctet::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AssociationFailureCause", indent + 1, value.associationFailureCause); + CHIP_ERROR err = LogValue("Member1", indent + 1, value.member1); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AssociationFailureCause'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Member1'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Status", indent + 1, value.status); + CHIP_ERROR err = LogValue("Member2", indent + 1, value.member2); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Status'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Member2'"); return err; } } @@ -6291,39 +6293,48 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType & value) + const AccessControl::Events::AccessControlEntryChanged::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ConnectionStatus", indent + 1, value.connectionStatus); + CHIP_ERROR err = DataModelLogger::LogValue("AdminNodeID", indent + 1, value.adminNodeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionStatus'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminNodeID'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TimeSynchronization::Events::DSTTableEmpty::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TimeSynchronization::Events::DSTStatus::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("DSTOffsetActive", indent + 1, value.DSTOffsetActive); + CHIP_ERROR err = DataModelLogger::LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DSTOffsetActive'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminPasscodeID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ChangeType", indent + 1, value.changeType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChangeType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("LatestValue", indent + 1, value.latestValue); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LatestValue'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -6332,22 +6343,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TimeSynchronization::Events::TimeZoneStatus::DecodableType & value) + const AccessControl::Events::AccessControlExtensionChanged::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Offset", indent + 1, value.offset); + CHIP_ERROR err = DataModelLogger::LogValue("AdminNodeID", indent + 1, value.adminNodeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Offset'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminNodeID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Name", indent + 1, value.name); + CHIP_ERROR err = DataModelLogger::LogValue("AdminPasscodeID", indent + 1, value.adminPasscodeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Name'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AdminPasscodeID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ChangeType", indent + 1, value.changeType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChangeType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("LatestValue", indent + 1, value.latestValue); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LatestValue'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -6356,78 +6391,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TimeSynchronization::Events::TimeFailure::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TimeSynchronization::Events::MissingTrustedTimeSource::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BridgedDeviceBasicInformation::Events::StartUp::DecodableType & value) + const AccessControl::Events::FabricRestrictionReviewUpdate::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); + CHIP_ERROR err = DataModelLogger::LogValue("Token", indent + 1, value.token); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Token'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BridgedDeviceBasicInformation::Events::ShutDown::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BridgedDeviceBasicInformation::Events::Leave::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BridgedDeviceBasicInformation::Events::ReachableChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ReachableNewValue", indent + 1, value.reachableNewValue); + CHIP_ERROR err = DataModelLogger::LogValue("Instruction", indent + 1, value.instruction); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReachableNewValue'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Instruction'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BridgedDeviceBasicInformation::Events::ActiveChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PromisedActiveDuration", indent + 1, value.promisedActiveDuration); + CHIP_ERROR err = DataModelLogger::LogValue("ARLRequestFlowUrl", indent + 1, value.ARLRequestFlowUrl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PromisedActiveDuration'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ARLRequestFlowUrl'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -6435,14 +6430,30 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::SwitchLatched::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Actions::Events::StateChanged::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); + CHIP_ERROR err = DataModelLogger::LogValue("ActionID", indent + 1, value.actionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("InvokeID", indent + 1, value.invokeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'InvokeID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); return err; } } @@ -6450,14 +6461,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sw return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::InitialPress::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Actions::Events::ActionFailed::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); + CHIP_ERROR err = DataModelLogger::LogValue("ActionID", indent + 1, value.actionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ActionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("InvokeID", indent + 1, value.invokeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'InvokeID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Error", indent + 1, value.error); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Error'"); return err; } } @@ -6465,14 +6500,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sw return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::LongPress::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BasicInformation::Events::StartUp::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); + CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); return err; } } @@ -6480,14 +6516,23 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sw return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::ShortRelease::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BasicInformation::Events::ShutDown::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BasicInformation::Events::Leave::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); return err; } } @@ -6495,14 +6540,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sw return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::LongRelease::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BasicInformation::Events::ReachableChanged::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); + CHIP_ERROR err = DataModelLogger::LogValue("ReachableNewValue", indent + 1, value.reachableNewValue); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReachableNewValue'"); return err; } } @@ -6511,47 +6557,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Sw return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Switch::Events::MultiPressOngoing::DecodableType & value) + const OtaSoftwareUpdateRequestor::Events::StateTransition::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); + CHIP_ERROR err = DataModelLogger::LogValue("PreviousState", indent + 1, value.previousState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousState'"); return err; } } { - CHIP_ERROR err = - DataModelLogger::LogValue("CurrentNumberOfPressesCounted", indent + 1, value.currentNumberOfPressesCounted); + CHIP_ERROR err = DataModelLogger::LogValue("NewState", indent + 1, value.newState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentNumberOfPressesCounted'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewState'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Switch::Events::MultiPressComplete::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("TotalNumberOfPressesCounted", indent + 1, value.totalNumberOfPressesCounted); + CHIP_ERROR err = DataModelLogger::LogValue("TargetSoftwareVersion", indent + 1, value.targetSoftwareVersion); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalNumberOfPressesCounted'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TargetSoftwareVersion'"); return err; } } @@ -6560,30 +6597,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BooleanState::Events::StateChange::DecodableType & value) + const OtaSoftwareUpdateRequestor::Events::VersionApplied::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("StateValue", indent + 1, value.stateValue); + CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StateValue'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OvenCavityOperationalState::Events::OperationalError::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + CHIP_ERROR err = DataModelLogger::LogValue("ProductID", indent + 1, value.productID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ProductID'"); return err; } } @@ -6592,30 +6621,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OvenCavityOperationalState::Events::OperationCompletion::DecodableType & value) + const OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); + CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + CHIP_ERROR err = DataModelLogger::LogValue("BytesDownloaded", indent + 1, value.bytesDownloaded); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BytesDownloaded'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + CHIP_ERROR err = DataModelLogger::LogValue("ProgressPercent", indent + 1, value.progressPercent); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ProgressPercent'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PlatformCode", indent + 1, value.platformCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlatformCode'"); return err; } } @@ -6624,38 +6661,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RefrigeratorAlarm::Events::Notify::DecodableType & value) + const PowerSource::Events::WiredFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Active", indent + 1, value.active); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Active'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Inactive", indent + 1, value.inactive); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PowerSource::Events::BatFaultChange::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6664,14 +6709,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value) + const PowerSource::Events::BatChargeFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6679,30 +6732,23 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::COAlarm::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::LowBattery::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6711,70 +6757,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::HardwareFault::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::EndOfService::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::SelfTestComplete::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::AlarmMuted::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::MuteEnded::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType & value) + const GeneralDiagnostics::Events::RadioFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6782,46 +6780,23 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::AllClear::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DishwasherAlarm::Events::Notify::DecodableType & value) + const GeneralDiagnostics::Events::NetworkFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Active", indent + 1, value.active); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Active'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Inactive", indent + 1, value.inactive); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6830,14 +6805,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OperationalState::Events::OperationalError::DecodableType & value) + const GeneralDiagnostics::Events::BootReason::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + CHIP_ERROR err = DataModelLogger::LogValue("BootReason", indent + 1, value.bootReason); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BootReason'"); return err; } } @@ -6846,46 +6821,30 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OperationalState::Events::OperationCompletion::DecodableType & value) + const SoftwareDiagnostics::Events::SoftwareFault::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + CHIP_ERROR err = DataModelLogger::LogValue("Id", indent + 1, value.id); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Id'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + CHIP_ERROR err = DataModelLogger::LogValue("Name", indent + 1, value.name); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Name'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcOperationalState::Events::OperationalError::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); + CHIP_ERROR err = DataModelLogger::LogValue("FaultRecording", indent + 1, value.faultRecording); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultRecording'"); return err; } } @@ -6894,30 +6853,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const RvcOperationalState::Events::OperationCompletion::DecodableType & value) + const ThreadNetworkDiagnostics::Events::ConnectionStatus::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + CHIP_ERROR err = DataModelLogger::LogValue("ConnectionStatus", indent + 1, value.connectionStatus); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionStatus'"); return err; } } @@ -6926,22 +6869,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BooleanStateConfiguration::Events::AlarmsStateChanged::DecodableType & value) + const ThreadNetworkDiagnostics::Events::NetworkFaultChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmsActive", indent + 1, value.alarmsActive); + CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsActive'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmsSuppressed", indent + 1, value.alarmsSuppressed); + CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsSuppressed'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'"); return err; } } @@ -6950,14 +6893,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const BooleanStateConfiguration::Events::SensorFault::DecodableType & value) + const WiFiNetworkDiagnostics::Events::Disconnection::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SensorFault", indent + 1, value.sensorFault); + CHIP_ERROR err = DataModelLogger::LogValue("ReasonCode", indent + 1, value.reasonCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SensorFault'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReasonCode'"); return err; } } @@ -6966,22 +6909,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType & value) + const WiFiNetworkDiagnostics::Events::AssociationFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ValveState", indent + 1, value.valveState); + CHIP_ERROR err = DataModelLogger::LogValue("AssociationFailureCause", indent + 1, value.associationFailureCause); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AssociationFailureCause'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ValveLevel", indent + 1, value.valveLevel); + CHIP_ERROR err = DataModelLogger::LogValue("Status", indent + 1, value.status); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveLevel'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Status'"); return err; } } @@ -6990,14 +6933,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ValveConfigurationAndControl::Events::ValveFault::DecodableType & value) + const WiFiNetworkDiagnostics::Events::ConnectionStatus::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("ValveFault", indent + 1, value.valveFault); + CHIP_ERROR err = DataModelLogger::LogValue("ConnectionStatus", indent + 1, value.connectionStatus); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveFault'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ConnectionStatus'"); return err; } } @@ -7006,38 +6949,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ElectricalPowerMeasurement::Events::MeasurementPeriodRanges::DecodableType & value) + const TimeSynchronization::Events::DSTTableEmpty::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("Ranges", indent + 1, value.ranges); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Ranges'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ElectricalEnergyMeasurement::Events::CumulativeEnergyMeasured::DecodableType & value) + const TimeSynchronization::Events::DSTStatus::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyImported", indent + 1, value.energyImported); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyImported'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyExported", indent + 1, value.energyExported); + CHIP_ERROR err = DataModelLogger::LogValue("DSTOffsetActive", indent + 1, value.DSTOffsetActive); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyExported'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DSTOffsetActive'"); return err; } } @@ -7046,22 +6973,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ElectricalEnergyMeasurement::Events::PeriodicEnergyMeasured::DecodableType & value) + const TimeSynchronization::Events::TimeZoneStatus::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyImported", indent + 1, value.energyImported); + CHIP_ERROR err = DataModelLogger::LogValue("Offset", indent + 1, value.offset); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyImported'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Offset'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyExported", indent + 1, value.energyExported); + CHIP_ERROR err = DataModelLogger::LogValue("Name", indent + 1, value.name); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyExported'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Name'"); return err; } } @@ -7070,23 +6997,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const WaterHeaterManagement::Events::BoostStarted::DecodableType & value) + const TimeSynchronization::Events::TimeFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("BoostInfo", indent + 1, value.boostInfo); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BoostInfo'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const WaterHeaterManagement::Events::BoostEnded::DecodableType & value) + const TimeSynchronization::Events::MissingTrustedTimeSource::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); DataModelLogger::LogString(indent, "}"); @@ -7094,86 +7013,107 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType & value) + const BridgedDeviceBasicInformation::Events::StartUp::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EventID", indent + 1, value.eventID); + CHIP_ERROR err = DataModelLogger::LogValue("SoftwareVersion", indent + 1, value.softwareVersion); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EventID'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("TransitionIndex", indent + 1, value.transitionIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TransitionIndex'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Status", indent + 1, value.status); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Status'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Criticality", indent + 1, value.criticality); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Criticality'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Control", indent + 1, value.control); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Control'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SoftwareVersion'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BridgedDeviceBasicInformation::Events::ShutDown::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BridgedDeviceBasicInformation::Events::Leave::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BridgedDeviceBasicInformation::Events::ReachableChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("TemperatureControl", indent + 1, value.temperatureControl); + CHIP_ERROR err = DataModelLogger::LogValue("ReachableNewValue", indent + 1, value.reachableNewValue); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TemperatureControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ReachableNewValue'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BridgedDeviceBasicInformation::Events::ActiveChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AverageLoadControl", indent + 1, value.averageLoadControl); + CHIP_ERROR err = DataModelLogger::LogValue("PromisedActiveDuration", indent + 1, value.promisedActiveDuration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AverageLoadControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PromisedActiveDuration'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::SwitchLatched::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("DutyCycleControl", indent + 1, value.dutyCycleControl); + CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DutyCycleControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::InitialPress::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("PowerSavingsControl", indent + 1, value.powerSavingsControl); + CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PowerSavingsControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::LongPress::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("HeatingSourceControl", indent + 1, value.heatingSourceControl); + CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'HeatingSourceControl'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); return err; } } @@ -7181,15 +7121,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Messages::Events::MessageQueued::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::ShortRelease::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); + CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); return err; } } @@ -7197,15 +7136,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Messages::Events::MessagePresented::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Switch::Events::LongRelease::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); + CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); return err; } } @@ -7214,38 +7152,23 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Messages::Events::MessageComplete::DecodableType & value) + const Switch::Events::MultiPressOngoing::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("ResponseID", indent + 1, value.responseID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ResponseID'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Reply", indent + 1, value.reply); + CHIP_ERROR err = DataModelLogger::LogValue("NewPosition", indent + 1, value.newPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reply'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'NewPosition'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FutureMessagesPreference", indent + 1, value.futureMessagesPreference); + CHIP_ERROR err = + DataModelLogger::LogValue("CurrentNumberOfPressesCounted", indent + 1, value.currentNumberOfPressesCounted); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FutureMessagesPreference'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentNumberOfPressesCounted'"); return err; } } @@ -7254,38 +7177,22 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DeviceEnergyManagement::Events::PowerAdjustStart::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DeviceEnergyManagement::Events::PowerAdjustEnd::DecodableType & value) + const Switch::Events::MultiPressComplete::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Cause", indent + 1, value.cause); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Cause'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Duration", indent + 1, value.duration); + CHIP_ERROR err = DataModelLogger::LogValue("PreviousPosition", indent + 1, value.previousPosition); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Duration'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PreviousPosition'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyUse", indent + 1, value.energyUse); + CHIP_ERROR err = DataModelLogger::LogValue("TotalNumberOfPressesCounted", indent + 1, value.totalNumberOfPressesCounted); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyUse'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalNumberOfPressesCounted'"); return err; } } @@ -7294,22 +7201,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DeviceEnergyManagement::Events::Paused::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DeviceEnergyManagement::Events::Resumed::DecodableType & value) + const BooleanState::Events::StateChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Cause", indent + 1, value.cause); + CHIP_ERROR err = DataModelLogger::LogValue("StateValue", indent + 1, value.stateValue); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Cause'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StateValue'"); return err; } } @@ -7318,14 +7217,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const EnergyEvse::Events::EVConnected::DecodableType & value) + const OvenCavityOperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); return err; } } @@ -7334,46 +7233,30 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const EnergyEvse::Events::EVNotDetected::DecodableType & value) + const OvenCavityOperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("SessionDuration", indent + 1, value.sessionDuration); + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionDuration'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyCharged", indent + 1, value.sessionEnergyCharged); + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyCharged'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyDischarged", indent + 1, value.sessionEnergyDischarged); + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyDischarged'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); return err; } } @@ -7382,38 +7265,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const EnergyEvse::Events::EnergyTransferStarted::DecodableType & value) + const RefrigeratorAlarm::Events::Notify::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + CHIP_ERROR err = DataModelLogger::LogValue("Active", indent + 1, value.active); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Active'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + CHIP_ERROR err = DataModelLogger::LogValue("Inactive", indent + 1, value.inactive); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("MaximumCurrent", indent + 1, value.maximumCurrent); + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumCurrent'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("MaximumDischargeCurrent", indent + 1, value.maximumDischargeCurrent); + CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumDischargeCurrent'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); return err; } } @@ -7422,46 +7305,117 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const EnergyEvse::Events::EnergyTransferStopped::DecodableType & value) + const SmokeCoAlarm::Events::SmokeAlarm::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::COAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); return err; } } - { - CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); - if (err != CHIP_NO_ERROR) + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::LowBattery::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); + if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::HardwareFault::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::EndOfService::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::SelfTestComplete::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::AlarmMuted::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::MuteEnded::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::InterconnectSmokeAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyTransferred", indent + 1, value.energyTransferred); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyTransferred'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SmokeCoAlarm::Events::InterconnectCOAlarm::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("EnergyDischarged", indent + 1, value.energyDischarged); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmSeverityLevel", indent + 1, value.alarmSeverityLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyDischarged'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmSeverityLevel'"); return err; } } @@ -7469,38 +7423,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Fault::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const SmokeCoAlarm::Events::AllClear::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DishwasherAlarm::Events::Notify::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); + CHIP_ERROR err = DataModelLogger::LogValue("Active", indent + 1, value.active); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Active'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + CHIP_ERROR err = DataModelLogger::LogValue("Inactive", indent + 1, value.inactive); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Inactive'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FaultStatePreviousState", indent + 1, value.faultStatePreviousState); + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStatePreviousState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FaultStateCurrentState", indent + 1, value.faultStateCurrentState); + CHIP_ERROR err = DataModelLogger::LogValue("Mask", indent + 1, value.mask); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStateCurrentState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Mask'"); return err; } } @@ -7508,14 +7470,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const En return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Rfid::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const OperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Uid", indent + 1, value.uid); + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Uid'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); return err; } } @@ -7524,14 +7487,30 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const En return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DoorLock::Events::DoorLockAlarm::DecodableType & value) + const OperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AlarmCode", indent + 1, value.alarmCode); + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmCode'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); return err; } } @@ -7540,14 +7519,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DoorLock::Events::DoorStateChange::DecodableType & value) + const RvcOperationalState::Events::OperationalError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("DoorState", indent + 1, value.doorState); + CHIP_ERROR err = DataModelLogger::LogValue("ErrorState", indent + 1, value.errorState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DoorState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ErrorState'"); return err; } } @@ -7556,54 +7535,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DoorLock::Events::LockOperation::DecodableType & value) + const RvcOperationalState::Events::OperationCompletion::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("LockOperationType", indent + 1, value.lockOperationType); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockOperationType'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); + CHIP_ERROR err = DataModelLogger::LogValue("CompletionErrorCode", indent + 1, value.completionErrorCode); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CompletionErrorCode'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); + CHIP_ERROR err = DataModelLogger::LogValue("TotalOperationalTime", indent + 1, value.totalOperationalTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TotalOperationalTime'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = DataModelLogger::LogValue("PausedTime", indent + 1, value.pausedTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PausedTime'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const BooleanStateConfiguration::Events::AlarmsStateChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmsActive", indent + 1, value.alarmsActive); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsActive'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Credentials", indent + 1, value.credentials); + CHIP_ERROR err = DataModelLogger::LogValue("AlarmsSuppressed", indent + 1, value.alarmsSuppressed); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Credentials'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmsSuppressed'"); return err; } } @@ -7612,62 +7591,94 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DoorLock::Events::LockOperationError::DecodableType & value) + const BooleanStateConfiguration::Events::SensorFault::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("LockOperationType", indent + 1, value.lockOperationType); + CHIP_ERROR err = DataModelLogger::LogValue("SensorFault", indent + 1, value.sensorFault); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockOperationType'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SensorFault'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ValveConfigurationAndControl::Events::ValveStateChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); + CHIP_ERROR err = DataModelLogger::LogValue("ValveState", indent + 1, value.valveState); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveState'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("OperationError", indent + 1, value.operationError); + CHIP_ERROR err = DataModelLogger::LogValue("ValveLevel", indent + 1, value.valveLevel); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationError'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveLevel'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ValveConfigurationAndControl::Events::ValveFault::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); + CHIP_ERROR err = DataModelLogger::LogValue("ValveFault", indent + 1, value.valveFault); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ValveFault'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ElectricalPowerMeasurement::Events::MeasurementPeriodRanges::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = DataModelLogger::LogValue("Ranges", indent + 1, value.ranges); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Ranges'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ElectricalEnergyMeasurement::Events::CumulativeEnergyMeasured::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); + CHIP_ERROR err = DataModelLogger::LogValue("EnergyImported", indent + 1, value.energyImported); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyImported'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Credentials", indent + 1, value.credentials); + CHIP_ERROR err = DataModelLogger::LogValue("EnergyExported", indent + 1, value.energyExported); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Credentials'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyExported'"); return err; } } @@ -7676,62 +7687,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DoorLock::Events::LockUserChange::DecodableType & value) + const ElectricalEnergyMeasurement::Events::PeriodicEnergyMeasured::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("LockDataType", indent + 1, value.lockDataType); + CHIP_ERROR err = DataModelLogger::LogValue("EnergyImported", indent + 1, value.energyImported); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockDataType'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyImported'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("DataOperationType", indent + 1, value.dataOperationType); + CHIP_ERROR err = DataModelLogger::LogValue("EnergyExported", indent + 1, value.energyExported); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DataOperationType'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyExported'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const WaterHeaterManagement::Events::BoostStarted::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("DataIndex", indent + 1, value.dataIndex); + CHIP_ERROR err = DataModelLogger::LogValue("BoostInfo", indent + 1, value.boostInfo); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DataIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BoostInfo'"); return err; } } @@ -7740,262 +7727,94 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::DryRunning::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::PumpBlocked::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::SensorFailure::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::GeneralFault::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::Leakage::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::AirDetection::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OccupancySensing::Events::OccupancyChanged::DecodableType & value) + const WaterHeaterManagement::Events::BoostEnded::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = DataModelLogger::LogValue("Occupancy", indent + 1, value.occupancy); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Occupancy'"); - return err; - } - } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TargetNavigator::Events::TargetUpdated::DecodableType & value) + const DemandResponseLoadControl::Events::LoadControlEventStatusChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("TargetList", indent + 1, value.targetList); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TargetList'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("CurrentTarget", indent + 1, value.currentTarget); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentTarget'"); - return err; - } - } - { - CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + CHIP_ERROR err = DataModelLogger::LogValue("EventID", indent + 1, value.eventID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EventID'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const MediaPlayback::Events::StateChanged::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("CurrentState", indent + 1, value.currentState); + CHIP_ERROR err = DataModelLogger::LogValue("TransitionIndex", indent + 1, value.transitionIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentState'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TransitionIndex'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("StartTime", indent + 1, value.startTime); + CHIP_ERROR err = DataModelLogger::LogValue("Status", indent + 1, value.status); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StartTime'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Status'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Duration", indent + 1, value.duration); + CHIP_ERROR err = DataModelLogger::LogValue("Criticality", indent + 1, value.criticality); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Duration'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Criticality'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SampledPosition", indent + 1, value.sampledPosition); + CHIP_ERROR err = DataModelLogger::LogValue("Control", indent + 1, value.control); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampledPosition'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Control'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("PlaybackSpeed", indent + 1, value.playbackSpeed); + CHIP_ERROR err = DataModelLogger::LogValue("TemperatureControl", indent + 1, value.temperatureControl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlaybackSpeed'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TemperatureControl'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeEnd", indent + 1, value.seekRangeEnd); + CHIP_ERROR err = DataModelLogger::LogValue("AverageLoadControl", indent + 1, value.averageLoadControl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeEnd'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AverageLoadControl'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeStart", indent + 1, value.seekRangeStart); + CHIP_ERROR err = DataModelLogger::LogValue("DutyCycleControl", indent + 1, value.dutyCycleControl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeStart'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DutyCycleControl'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + CHIP_ERROR err = DataModelLogger::LogValue("PowerSavingsControl", indent + 1, value.powerSavingsControl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PowerSavingsControl'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("AudioAdvanceUnmuted", indent + 1, value.audioAdvanceUnmuted); + CHIP_ERROR err = DataModelLogger::LogValue("HeatingSourceControl", indent + 1, value.heatingSourceControl); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioAdvanceUnmuted'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'HeatingSourceControl'"); return err; } } @@ -8004,14 +7823,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccountLogin::Events::LoggedOut::DecodableType & value) + const Messages::Events::MessageQueued::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Node", indent + 1, value.node); + CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Node'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); return err; } } @@ -8020,46 +7839,54 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value) + const Messages::Events::MessagePresented::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const CommissionerControl::Events::CommissioningRequestResult::DecodableType & value) + const Messages::Events::MessageComplete::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("RequestID", indent + 1, value.requestID); + CHIP_ERROR err = DataModelLogger::LogValue("MessageID", indent + 1, value.messageID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'RequestID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MessageID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("ClientNodeID", indent + 1, value.clientNodeID); + CHIP_ERROR err = DataModelLogger::LogValue("ResponseID", indent + 1, value.responseID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ClientNodeID'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ResponseID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("StatusCode", indent + 1, value.statusCode); + CHIP_ERROR err = DataModelLogger::LogValue("Reply", indent + 1, value.reply); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StatusCode'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reply'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = DataModelLogger::LogValue("FutureMessagesPreference", indent + 1, value.futureMessagesPreference); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FutureMessagesPreference'"); return err; } } @@ -8067,54 +7894,127 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const UnitTesting::Events::TestEvent::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DeviceEnergyManagement::Events::PowerAdjustStart::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DeviceEnergyManagement::Events::PowerAdjustEnd::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Arg1", indent + 1, value.arg1); + CHIP_ERROR err = DataModelLogger::LogValue("Cause", indent + 1, value.cause); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg1'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Cause'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Arg2", indent + 1, value.arg2); + CHIP_ERROR err = DataModelLogger::LogValue("Duration", indent + 1, value.duration); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg2'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Duration'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Arg3", indent + 1, value.arg3); + CHIP_ERROR err = DataModelLogger::LogValue("EnergyUse", indent + 1, value.energyUse); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg3'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyUse'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DeviceEnergyManagement::Events::Paused::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DeviceEnergyManagement::Events::Resumed::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Cause", indent + 1, value.cause); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Cause'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const EnergyEvse::Events::EVConnected::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Arg4", indent + 1, value.arg4); + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg4'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const EnergyEvse::Events::EVNotDetected::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Arg5", indent + 1, value.arg5); + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg5'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("Arg6", indent + 1, value.arg6); + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg6'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionDuration", indent + 1, value.sessionDuration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionDuration'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyCharged", indent + 1, value.sessionEnergyCharged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyCharged'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SessionEnergyDischarged", indent + 1, value.sessionEnergyDischarged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionEnergyDischarged'"); return err; } } @@ -8123,14 +8023,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const Un return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const UnitTesting::Events::TestFabricScopedEvent::DecodableType & value) + const EnergyEvse::Events::EnergyTransferStarted::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaximumCurrent", indent + 1, value.maximumCurrent); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumCurrent'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaximumDischargeCurrent", indent + 1, value.maximumDischargeCurrent); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaximumDischargeCurrent'"); return err; } } @@ -8139,14 +8063,46 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const UnitTesting::Events::TestDifferentVendorMeiEvent::DecodableType & value) + const EnergyEvse::Events::EnergyTransferStopped::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Arg1", indent + 1, value.arg1); + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg1'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("EnergyTransferred", indent + 1, value.energyTransferred); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyTransferred'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("EnergyDischarged", indent + 1, value.energyDischarged); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EnergyDischarged'"); return err; } } @@ -8154,23 +8110,38 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const SampleMei::Events::PingCountEvent::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Fault::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("Count", indent + 1, value.count); + CHIP_ERROR err = DataModelLogger::LogValue("SessionID", indent + 1, value.sessionID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Count'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SessionID'"); return err; } } { - CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = DataModelLogger::LogValue("State", indent + 1, value.state); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'State'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FaultStatePreviousState", indent + 1, value.faultStatePreviousState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStatePreviousState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FaultStateCurrentState", indent + 1, value.faultStateCurrentState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FaultStateCurrentState'"); return err; } } @@ -8178,178 +8149,1120 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } - -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Groups::Commands::AddGroupResponse::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Events::Rfid::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); + { + CHIP_ERROR err = DataModelLogger::LogValue("Uid", indent + 1, value.uid); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Uid'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Groups::Commands::ViewGroupResponse::DecodableType & value) + const DoorLock::Events::DoorLockAlarm::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupName", indent + 1, value.groupName)); + { + CHIP_ERROR err = DataModelLogger::LogValue("AlarmCode", indent + 1, value.alarmCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AlarmCode'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Groups::Commands::GetGroupMembershipResponse::DecodableType & value) + const DoorLock::Events::DoorStateChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("capacity", indent + 1, value.capacity)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupList", indent + 1, value.groupList)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Groups::Commands::RemoveGroupResponse::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); + { + CHIP_ERROR err = DataModelLogger::LogValue("DoorState", indent + 1, value.doorState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DoorState'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccessControl::Commands::ReviewFabricRestrictionsResponse::DecodableType & value) + const DoorLock::Events::LockOperation::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("token", indent + 1, value.token)); + { + CHIP_ERROR err = DataModelLogger::LogValue("LockOperationType", indent + 1, value.lockOperationType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockOperationType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Credentials", indent + 1, value.credentials); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Credentials'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & value) + const DoorLock::Events::LockOperationError::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("delayedActionTime", indent + 1, value.delayedActionTime)); - ReturnErrorOnFailure(DataModelLogger::LogValue("imageURI", indent + 1, value.imageURI)); - ReturnErrorOnFailure(DataModelLogger::LogValue("softwareVersion", indent + 1, value.softwareVersion)); - ReturnErrorOnFailure(DataModelLogger::LogValue("softwareVersionString", indent + 1, value.softwareVersionString)); - ReturnErrorOnFailure(DataModelLogger::LogValue("updateToken", indent + 1, value.updateToken)); - ReturnErrorOnFailure(DataModelLogger::LogValue("userConsentNeeded", indent + 1, value.userConsentNeeded)); - ReturnErrorOnFailure(DataModelLogger::LogValue("metadataForRequestor", indent + 1, value.metadataForRequestor)); + { + CHIP_ERROR err = DataModelLogger::LogValue("LockOperationType", indent + 1, value.lockOperationType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockOperationType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("OperationError", indent + 1, value.operationError); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationError'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Credentials", indent + 1, value.credentials); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Credentials'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & value) + const DoorLock::Events::LockUserChange::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("action", indent + 1, value.action)); - ReturnErrorOnFailure(DataModelLogger::LogValue("delayedActionTime", indent + 1, value.delayedActionTime)); + { + CHIP_ERROR err = DataModelLogger::LogValue("LockDataType", indent + 1, value.lockDataType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'LockDataType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("DataOperationType", indent + 1, value.dataOperationType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DataOperationType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("OperationSource", indent + 1, value.operationSource); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'OperationSource'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("UserIndex", indent + 1, value.userIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'UserIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SourceNode", indent + 1, value.sourceNode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SourceNode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("DataIndex", indent + 1, value.dataIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'DataIndex'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::SupplyVoltageLow::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::SupplyVoltageHigh::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::PowerMissingPhase::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralCommissioning::Commands::SetTCAcknowledgementsResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::SystemPressureLow::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::SystemPressureHigh::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); - ReturnErrorOnFailure(DataModelLogger::LogValue("wiFiScanResults", indent + 1, value.wiFiScanResults)); - ReturnErrorOnFailure(DataModelLogger::LogValue("threadScanResults", indent + 1, value.threadScanResults)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::DryRunning::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); - ReturnErrorOnFailure(DataModelLogger::LogValue("networkIndex", indent + 1, value.networkIndex)); - ReturnErrorOnFailure(DataModelLogger::LogValue("clientIdentity", indent + 1, value.clientIdentity)); - ReturnErrorOnFailure(DataModelLogger::LogValue("possessionSignature", indent + 1, value.possessionSignature)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::MotorTemperatureHigh::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); - ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); - ReturnErrorOnFailure(DataModelLogger::LogValue("errorValue", indent + 1, value.errorValue)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const NetworkCommissioning::Commands::QueryIdentityResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::PumpMotorFatalFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("identity", indent + 1, value.identity)); - ReturnErrorOnFailure(DataModelLogger::LogValue("possessionSignature", indent + 1, value.possessionSignature)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::ElectronicTemperatureHigh::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("logContent", indent + 1, value.logContent)); - ReturnErrorOnFailure(DataModelLogger::LogValue("UTCTimeStamp", indent + 1, value.UTCTimeStamp)); - ReturnErrorOnFailure(DataModelLogger::LogValue("timeSinceBoot", indent + 1, value.timeSinceBoot)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::PumpBlocked::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("systemTimeMs", indent + 1, value.systemTimeMs)); - ReturnErrorOnFailure(DataModelLogger::LogValue("posixTimeMs", indent + 1, value.posixTimeMs)); DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType & value) + const PumpConfigurationAndControl::Events::SensorFailure::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("payload", indent + 1, value.payload)); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::ElectronicNonFatalFailure::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::ElectronicFatalFailure::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::GeneralFault::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::Leakage::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::AirDetection::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const PumpConfigurationAndControl::Events::TurbineOperation::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const OccupancySensing::Events::OccupancyChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Occupancy", indent + 1, value.occupancy); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Occupancy'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const TargetNavigator::Events::TargetUpdated::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("TargetList", indent + 1, value.targetList); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'TargetList'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentTarget", indent + 1, value.currentTarget); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentTarget'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const MediaPlayback::Events::StateChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("CurrentState", indent + 1, value.currentState); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'CurrentState'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StartTime", indent + 1, value.startTime); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StartTime'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Duration", indent + 1, value.duration); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Duration'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SampledPosition", indent + 1, value.sampledPosition); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampledPosition'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("PlaybackSpeed", indent + 1, value.playbackSpeed); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'PlaybackSpeed'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeEnd", indent + 1, value.seekRangeEnd); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeEnd'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SeekRangeStart", indent + 1, value.seekRangeStart); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SeekRangeStart'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Data", indent + 1, value.data); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Data'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioAdvanceUnmuted", indent + 1, value.audioAdvanceUnmuted); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioAdvanceUnmuted'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const AccountLogin::Events::LoggedOut::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Node", indent + 1, value.node); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Node'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Events::ZoneTriggered::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Zones", indent + 1, value.zones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Zones'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ZoneManagement::Events::ZoneStopped::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Zones", indent + 1, value.zones); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Zones'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Reason", indent + 1, value.reason); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Reason'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("VideoStreamID", indent + 1, value.videoStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'VideoStreamID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StreamType", indent + 1, value.streamType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StreamType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("VideoCodec", indent + 1, value.videoCodec); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'VideoCodec'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinFrameRate", indent + 1, value.minFrameRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinFrameRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxFrameRate", indent + 1, value.maxFrameRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxFrameRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinResolution", indent + 1, value.minResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxResolution", indent + 1, value.maxResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinBitRate", indent + 1, value.minBitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinBitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxBitRate", indent + 1, value.maxBitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxBitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinFragmentLen", indent + 1, value.minFragmentLen); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinFragmentLen'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxFragmentLen", indent + 1, value.maxFragmentLen); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxFragmentLen'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioStreamID", indent + 1, value.audioStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioStreamID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StreamType", indent + 1, value.streamType); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StreamType'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("AudioCodec", indent + 1, value.audioCodec); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AudioCodec'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ChannelCount", indent + 1, value.channelCount); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ChannelCount'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("SampleRate", indent + 1, value.sampleRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SampleRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("BitRate", indent + 1, value.bitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("BitDepth", indent + 1, value.bitDepth); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitDepth'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("SnapshotStreamID", indent + 1, value.snapshotStreamID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'SnapshotStreamID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ImageCodec", indent + 1, value.imageCodec); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ImageCodec'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FrameRate", indent + 1, value.frameRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FrameRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("BitRate", indent + 1, value.bitRate); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'BitRate'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MinResolution", indent + 1, value.minResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MinResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("MaxResolution", indent + 1, value.maxResolution); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'MaxResolution'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Quality", indent + 1, value.quality); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Quality'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const CommissionerControl::Events::CommissioningRequestResult::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("RequestID", indent + 1, value.requestID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'RequestID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ClientNodeID", indent + 1, value.clientNodeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ClientNodeID'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("StatusCode", indent + 1, value.statusCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StatusCode'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const UnitTesting::Events::TestEvent::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg1", indent + 1, value.arg1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg1'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg2", indent + 1, value.arg2); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg2'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg3", indent + 1, value.arg3); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg3'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg4", indent + 1, value.arg4); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg4'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg5", indent + 1, value.arg5); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg5'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg6", indent + 1, value.arg6); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg6'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const UnitTesting::Events::TestFabricScopedEvent::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const UnitTesting::Events::TestDifferentVendorMeiEvent::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Arg1", indent + 1, value.arg1); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Arg1'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SampleMei::Events::PingCountEvent::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = DataModelLogger::LogValue("Count", indent + 1, value.count); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Count'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Groups::Commands::AddGroupResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Groups::Commands::ViewGroupResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); + ReturnErrorOnFailure(DataModelLogger::LogValue("groupName", indent + 1, value.groupName)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Groups::Commands::GetGroupMembershipResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("capacity", indent + 1, value.capacity)); + ReturnErrorOnFailure(DataModelLogger::LogValue("groupList", indent + 1, value.groupList)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Groups::Commands::RemoveGroupResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const AccessControl::Commands::ReviewFabricRestrictionsResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("token", indent + 1, value.token)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("delayedActionTime", indent + 1, value.delayedActionTime)); + ReturnErrorOnFailure(DataModelLogger::LogValue("imageURI", indent + 1, value.imageURI)); + ReturnErrorOnFailure(DataModelLogger::LogValue("softwareVersion", indent + 1, value.softwareVersion)); + ReturnErrorOnFailure(DataModelLogger::LogValue("softwareVersionString", indent + 1, value.softwareVersionString)); + ReturnErrorOnFailure(DataModelLogger::LogValue("updateToken", indent + 1, value.updateToken)); + ReturnErrorOnFailure(DataModelLogger::LogValue("userConsentNeeded", indent + 1, value.userConsentNeeded)); + ReturnErrorOnFailure(DataModelLogger::LogValue("metadataForRequestor", indent + 1, value.metadataForRequestor)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("action", indent + 1, value.action)); + ReturnErrorOnFailure(DataModelLogger::LogValue("delayedActionTime", indent + 1, value.delayedActionTime)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralCommissioning::Commands::SetTCAcknowledgementsResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("errorCode", indent + 1, value.errorCode)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + ReturnErrorOnFailure(DataModelLogger::LogValue("wiFiScanResults", indent + 1, value.wiFiScanResults)); + ReturnErrorOnFailure(DataModelLogger::LogValue("threadScanResults", indent + 1, value.threadScanResults)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + ReturnErrorOnFailure(DataModelLogger::LogValue("networkIndex", indent + 1, value.networkIndex)); + ReturnErrorOnFailure(DataModelLogger::LogValue("clientIdentity", indent + 1, value.clientIdentity)); + ReturnErrorOnFailure(DataModelLogger::LogValue("possessionSignature", indent + 1, value.possessionSignature)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("networkingStatus", indent + 1, value.networkingStatus)); + ReturnErrorOnFailure(DataModelLogger::LogValue("debugText", indent + 1, value.debugText)); + ReturnErrorOnFailure(DataModelLogger::LogValue("errorValue", indent + 1, value.errorValue)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const NetworkCommissioning::Commands::QueryIdentityResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("identity", indent + 1, value.identity)); + ReturnErrorOnFailure(DataModelLogger::LogValue("possessionSignature", indent + 1, value.possessionSignature)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("logContent", indent + 1, value.logContent)); + ReturnErrorOnFailure(DataModelLogger::LogValue("UTCTimeStamp", indent + 1, value.UTCTimeStamp)); + ReturnErrorOnFailure(DataModelLogger::LogValue("timeSinceBoot", indent + 1, value.timeSinceBoot)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralDiagnostics::Commands::TimeSnapshotResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("systemTimeMs", indent + 1, value.systemTimeMs)); + ReturnErrorOnFailure(DataModelLogger::LogValue("posixTimeMs", indent + 1, value.posixTimeMs)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const GeneralDiagnostics::Commands::PayloadTestResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("payload", indent + 1, value.payload)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } @@ -8760,7 +9673,60 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Channel::Commands::ChangeChannelResponse::DecodableType & value) + const Channel::Commands::ChangeChannelResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Channel::Commands::ProgramGuideResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("paging", indent + 1, value.paging)); + ReturnErrorOnFailure(DataModelLogger::LogValue("programList", indent + 1, value.programList)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const TargetNavigator::Commands::NavigateTargetResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const MediaPlayback::Commands::PlaybackResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const KeypadInput::Commands::SendKeyResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ContentLauncher::Commands::LauncherResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const ApplicationLauncher::Commands::LauncherResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -8769,81 +9735,79 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Channel::Commands::ProgramGuideResponse::DecodableType & value) + const AccountLogin::Commands::GetSetupPINResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("paging", indent + 1, value.paging)); - ReturnErrorOnFailure(DataModelLogger::LogValue("programList", indent + 1, value.programList)); + ReturnErrorOnFailure(DataModelLogger::LogValue("setupPIN", indent + 1, value.setupPIN)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const TargetNavigator::Commands::NavigateTargetResponse::DecodableType & value) + const ContentControl::Commands::ResetPINResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("PINCode", indent + 1, value.PINCode)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const MediaPlayback::Commands::PlaybackResponse::DecodableType & value) + const ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("encodingHint", indent + 1, value.encodingHint)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const KeypadInput::Commands::SendKeyResponse::DecodableType & value) + const ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); + ReturnErrorOnFailure(DataModelLogger::LogValue("zoneID", indent + 1, value.zoneID)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ContentLauncher::Commands::LauncherResponse::DecodableType & value) + const ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("zones", indent + 1, value.zones)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ApplicationLauncher::Commands::LauncherResponse::DecodableType & value) + const CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); + ReturnErrorOnFailure(DataModelLogger::LogValue("audioStreamID", indent + 1, value.audioStreamID)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const AccountLogin::Commands::GetSetupPINResponse::DecodableType & value) + const CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("setupPIN", indent + 1, value.setupPIN)); + ReturnErrorOnFailure(DataModelLogger::LogValue("videoStreamID", indent + 1, value.videoStreamID)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ContentControl::Commands::ResetPINResponse::DecodableType & value) +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("PINCode", indent + 1, value.PINCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("snapshotStreamID", indent + 1, value.snapshotStreamID)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value) + const CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); ReturnErrorOnFailure(DataModelLogger::LogValue("data", indent + 1, value.data)); - ReturnErrorOnFailure(DataModelLogger::LogValue("encodingHint", indent + 1, value.encodingHint)); + ReturnErrorOnFailure(DataModelLogger::LogValue("imageCodec", indent + 1, value.imageCodec)); + ReturnErrorOnFailure(DataModelLogger::LogValue("resolution", indent + 1, value.resolution)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } @@ -10259,6 +11223,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("TCAcknowledgementsRequired", 1, value); } + case GeneralCommissioning::Attributes::TCUpdateDeadline::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TCUpdateDeadline", 1, value); + } case GeneralCommissioning::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -14618,124 +15587,341 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP case WindowCovering::Attributes::CurrentPositionLift::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionLift", 1, value); + return DataModelLogger::LogValue("CurrentPositionLift", 1, value); + } + case WindowCovering::Attributes::CurrentPositionTilt::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPositionTilt", 1, value); + } + case WindowCovering::Attributes::NumberOfActuationsLift::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfActuationsLift", 1, value); + } + case WindowCovering::Attributes::NumberOfActuationsTilt::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfActuationsTilt", 1, value); + } + case WindowCovering::Attributes::ConfigStatus::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ConfigStatus", 1, value); + } + case WindowCovering::Attributes::CurrentPositionLiftPercentage::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPositionLiftPercentage", 1, value); + } + case WindowCovering::Attributes::CurrentPositionTiltPercentage::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPositionTiltPercentage", 1, value); + } + case WindowCovering::Attributes::OperationalStatus::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OperationalStatus", 1, value); + } + case WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TargetPositionLiftPercent100ths", 1, value); + } + case WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TargetPositionTiltPercent100ths", 1, value); + } + case WindowCovering::Attributes::EndProductType::Id: { + chip::app::Clusters::WindowCovering::EndProductType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EndProductType", 1, value); + } + case WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPositionLiftPercent100ths", 1, value); + } + case WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentPositionTiltPercent100ths", 1, value); + } + case WindowCovering::Attributes::InstalledOpenLimitLift::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InstalledOpenLimitLift", 1, value); + } + case WindowCovering::Attributes::InstalledClosedLimitLift::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InstalledClosedLimitLift", 1, value); + } + case WindowCovering::Attributes::InstalledOpenLimitTilt::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InstalledOpenLimitTilt", 1, value); + } + case WindowCovering::Attributes::InstalledClosedLimitTilt::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InstalledClosedLimitTilt", 1, value); + } + case WindowCovering::Attributes::Mode::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Mode", 1, value); + } + case WindowCovering::Attributes::SafetyStatus::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SafetyStatus", 1, value); + } + case WindowCovering::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WindowCovering::Id); + } + case WindowCovering::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WindowCovering::Id); + } + case WindowCovering::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case WindowCovering::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WindowCovering::Id); + } + case WindowCovering::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case WindowCovering::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } + case ServiceArea::Id: { + switch (path.mAttributeId) + { + case ServiceArea::Attributes::SupportedAreas::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedAreas", 1, value); + } + case ServiceArea::Attributes::SupportedMaps::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedMaps", 1, value); + } + case ServiceArea::Attributes::SelectedAreas::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SelectedAreas", 1, value); + } + case ServiceArea::Attributes::CurrentArea::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentArea", 1, value); + } + case ServiceArea::Attributes::EstimatedEndTime::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EstimatedEndTime", 1, value); + } + case ServiceArea::Attributes::Progress::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Progress", 1, value); + } + case ServiceArea::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ServiceArea::Id); + } + case ServiceArea::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ServiceArea::Id); + } + case ServiceArea::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case ServiceArea::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ServiceArea::Id); + } + case ServiceArea::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case ServiceArea::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } + case PumpConfigurationAndControl::Id: { + switch (path.mAttributeId) + { + case PumpConfigurationAndControl::Attributes::MaxPressure::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxPressure", 1, value); + } + case PumpConfigurationAndControl::Attributes::MaxSpeed::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxSpeed", 1, value); + } + case PumpConfigurationAndControl::Attributes::MaxFlow::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxFlow", 1, value); + } + case PumpConfigurationAndControl::Attributes::MinConstPressure::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinConstPressure", 1, value); + } + case PumpConfigurationAndControl::Attributes::MaxConstPressure::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxConstPressure", 1, value); } - case WindowCovering::Attributes::CurrentPositionTilt::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::MinCompPressure::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionTilt", 1, value); + return DataModelLogger::LogValue("MinCompPressure", 1, value); } - case WindowCovering::Attributes::NumberOfActuationsLift::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::MaxCompPressure::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfActuationsLift", 1, value); + return DataModelLogger::LogValue("MaxCompPressure", 1, value); } - case WindowCovering::Attributes::NumberOfActuationsTilt::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::MinConstSpeed::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfActuationsTilt", 1, value); + return DataModelLogger::LogValue("MinConstSpeed", 1, value); } - case WindowCovering::Attributes::ConfigStatus::Id: { - chip::BitMask value; + case PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ConfigStatus", 1, value); + return DataModelLogger::LogValue("MaxConstSpeed", 1, value); } - case WindowCovering::Attributes::CurrentPositionLiftPercentage::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::MinConstFlow::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionLiftPercentage", 1, value); + return DataModelLogger::LogValue("MinConstFlow", 1, value); } - case WindowCovering::Attributes::CurrentPositionTiltPercentage::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::MaxConstFlow::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionTiltPercentage", 1, value); + return DataModelLogger::LogValue("MaxConstFlow", 1, value); } - case WindowCovering::Attributes::OperationalStatus::Id: { - chip::BitMask value; + case PumpConfigurationAndControl::Attributes::MinConstTemp::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OperationalStatus", 1, value); + return DataModelLogger::LogValue("MinConstTemp", 1, value); } - case WindowCovering::Attributes::TargetPositionLiftPercent100ths::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::MaxConstTemp::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TargetPositionLiftPercent100ths", 1, value); + return DataModelLogger::LogValue("MaxConstTemp", 1, value); } - case WindowCovering::Attributes::TargetPositionTiltPercent100ths::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::PumpStatus::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TargetPositionTiltPercent100ths", 1, value); + return DataModelLogger::LogValue("PumpStatus", 1, value); } - case WindowCovering::Attributes::EndProductType::Id: { - chip::app::Clusters::WindowCovering::EndProductType value; + case PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id: { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EndProductType", 1, value); + return DataModelLogger::LogValue("EffectiveOperationMode", 1, value); } - case WindowCovering::Attributes::CurrentPositionLiftPercent100ths::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id: { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionLiftPercent100ths", 1, value); + return DataModelLogger::LogValue("EffectiveControlMode", 1, value); } - case WindowCovering::Attributes::CurrentPositionTiltPercent100ths::Id: { - chip::app::DataModel::Nullable value; + case PumpConfigurationAndControl::Attributes::Capacity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentPositionTiltPercent100ths", 1, value); + return DataModelLogger::LogValue("Capacity", 1, value); } - case WindowCovering::Attributes::InstalledOpenLimitLift::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::Speed::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InstalledOpenLimitLift", 1, value); + return DataModelLogger::LogValue("Speed", 1, value); } - case WindowCovering::Attributes::InstalledClosedLimitLift::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InstalledClosedLimitLift", 1, value); + return DataModelLogger::LogValue("LifetimeRunningHours", 1, value); } - case WindowCovering::Attributes::InstalledOpenLimitTilt::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::Power::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InstalledOpenLimitTilt", 1, value); + return DataModelLogger::LogValue("Power", 1, value); } - case WindowCovering::Attributes::InstalledClosedLimitTilt::Id: { - uint16_t value; + case PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InstalledClosedLimitTilt", 1, value); + return DataModelLogger::LogValue("LifetimeEnergyConsumed", 1, value); } - case WindowCovering::Attributes::Mode::Id: { - chip::BitMask value; + case PumpConfigurationAndControl::Attributes::OperationMode::Id: { + chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Mode", 1, value); + return DataModelLogger::LogValue("OperationMode", 1, value); } - case WindowCovering::Attributes::SafetyStatus::Id: { - chip::BitMask value; + case PumpConfigurationAndControl::Attributes::ControlMode::Id: { + chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SafetyStatus", 1, value); + return DataModelLogger::LogValue("ControlMode", 1, value); } - case WindowCovering::Attributes::GeneratedCommandList::Id: { + case PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WindowCovering::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PumpConfigurationAndControl::Id); } - case WindowCovering::Attributes::AcceptedCommandList::Id: { + case PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WindowCovering::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PumpConfigurationAndControl::Id); } - case WindowCovering::Attributes::EventList::Id: { + case PumpConfigurationAndControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case WindowCovering::Attributes::AttributeList::Id: { + case PumpConfigurationAndControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, WindowCovering::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PumpConfigurationAndControl::Id); } - case WindowCovering::Attributes::FeatureMap::Id: { + case PumpConfigurationAndControl::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case WindowCovering::Attributes::ClusterRevision::Id: { + case PumpConfigurationAndControl::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -14743,700 +15929,779 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ServiceArea::Id: { + case Thermostat::Id: { switch (path.mAttributeId) { - case ServiceArea::Attributes::SupportedAreas::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::LocalTemperature::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SupportedAreas", 1, value); + return DataModelLogger::LogValue("LocalTemperature", 1, value); } - case ServiceArea::Attributes::SupportedMaps::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::OutdoorTemperature::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SupportedMaps", 1, value); + return DataModelLogger::LogValue("OutdoorTemperature", 1, value); } - case ServiceArea::Attributes::SelectedAreas::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::Occupancy::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SelectedAreas", 1, value); + return DataModelLogger::LogValue("Occupancy", 1, value); } - case ServiceArea::Attributes::CurrentArea::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::AbsMinHeatSetpointLimit::Id: { + int16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentArea", 1, value); + return DataModelLogger::LogValue("AbsMinHeatSetpointLimit", 1, value); } - case ServiceArea::Attributes::EstimatedEndTime::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id: { + int16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EstimatedEndTime", 1, value); + return DataModelLogger::LogValue("AbsMaxHeatSetpointLimit", 1, value); } - case ServiceArea::Attributes::Progress::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::AbsMinCoolSetpointLimit::Id: { + int16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Progress", 1, value); + return DataModelLogger::LogValue("AbsMinCoolSetpointLimit", 1, value); } - case ServiceArea::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id: { + int16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ServiceArea::Id); + return DataModelLogger::LogValue("AbsMaxCoolSetpointLimit", 1, value); } - case ServiceArea::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::PICoolingDemand::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ServiceArea::Id); + return DataModelLogger::LogValue("PICoolingDemand", 1, value); } - case ServiceArea::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::PIHeatingDemand::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("PIHeatingDemand", 1, value); } - case ServiceArea::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::HVACSystemTypeConfiguration::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HVACSystemTypeConfiguration", 1, value); + } + case Thermostat::Attributes::LocalTemperatureCalibration::Id: { + int8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LocalTemperatureCalibration", 1, value); + } + case Thermostat::Attributes::OccupiedCoolingSetpoint::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OccupiedCoolingSetpoint", 1, value); + } + case Thermostat::Attributes::OccupiedHeatingSetpoint::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("OccupiedHeatingSetpoint", 1, value); + } + case Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UnoccupiedCoolingSetpoint", 1, value); + } + case Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UnoccupiedHeatingSetpoint", 1, value); + } + case Thermostat::Attributes::MinHeatSetpointLimit::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinHeatSetpointLimit", 1, value); + } + case Thermostat::Attributes::MaxHeatSetpointLimit::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxHeatSetpointLimit", 1, value); + } + case Thermostat::Attributes::MinCoolSetpointLimit::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinCoolSetpointLimit", 1, value); + } + case Thermostat::Attributes::MaxCoolSetpointLimit::Id: { + int16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxCoolSetpointLimit", 1, value); + } + case Thermostat::Attributes::MinSetpointDeadBand::Id: { + int8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinSetpointDeadBand", 1, value); + } + case Thermostat::Attributes::RemoteSensing::Id: { + chip::BitMask value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("RemoteSensing", 1, value); + } + case Thermostat::Attributes::ControlSequenceOfOperation::Id: { + chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ControlSequenceOfOperation", 1, value); + } + case Thermostat::Attributes::SystemMode::Id: { + chip::app::Clusters::Thermostat::SystemModeEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SystemMode", 1, value); + } + case Thermostat::Attributes::ThermostatRunningMode::Id: { + chip::app::Clusters::Thermostat::ThermostatRunningModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ServiceArea::Id); + return DataModelLogger::LogValue("ThermostatRunningMode", 1, value); } - case ServiceArea::Attributes::FeatureMap::Id: { - uint32_t value; + case Thermostat::Attributes::StartOfWeek::Id: { + chip::app::Clusters::Thermostat::StartOfWeekEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("StartOfWeek", 1, value); } - case ServiceArea::Attributes::ClusterRevision::Id: { - uint16_t value; + case Thermostat::Attributes::NumberOfWeeklyTransitions::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("NumberOfWeeklyTransitions", 1, value); } + case Thermostat::Attributes::NumberOfDailyTransitions::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("NumberOfDailyTransitions", 1, value); } - break; - } - case PumpConfigurationAndControl::Id: { - switch (path.mAttributeId) - { - case PumpConfigurationAndControl::Attributes::MaxPressure::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::TemperatureSetpointHold::Id: { + chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxPressure", 1, value); + return DataModelLogger::LogValue("TemperatureSetpointHold", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxSpeed::Id: { + case Thermostat::Attributes::TemperatureSetpointHoldDuration::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxSpeed", 1, value); + return DataModelLogger::LogValue("TemperatureSetpointHoldDuration", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxFlow::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ThermostatProgrammingOperationMode::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxFlow", 1, value); + return DataModelLogger::LogValue("ThermostatProgrammingOperationMode", 1, value); } - case PumpConfigurationAndControl::Attributes::MinConstPressure::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ThermostatRunningState::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinConstPressure", 1, value); + return DataModelLogger::LogValue("ThermostatRunningState", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxConstPressure::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::SetpointChangeSource::Id: { + chip::app::Clusters::Thermostat::SetpointChangeSourceEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxConstPressure", 1, value); + return DataModelLogger::LogValue("SetpointChangeSource", 1, value); } - case PumpConfigurationAndControl::Attributes::MinCompPressure::Id: { + case Thermostat::Attributes::SetpointChangeAmount::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinCompPressure", 1, value); + return DataModelLogger::LogValue("SetpointChangeAmount", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxCompPressure::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::SetpointChangeSourceTimestamp::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxCompPressure", 1, value); + return DataModelLogger::LogValue("SetpointChangeSourceTimestamp", 1, value); } - case PumpConfigurationAndControl::Attributes::MinConstSpeed::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::OccupiedSetback::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinConstSpeed", 1, value); + return DataModelLogger::LogValue("OccupiedSetback", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxConstSpeed::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::OccupiedSetbackMin::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxConstSpeed", 1, value); + return DataModelLogger::LogValue("OccupiedSetbackMin", 1, value); } - case PumpConfigurationAndControl::Attributes::MinConstFlow::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::OccupiedSetbackMax::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinConstFlow", 1, value); + return DataModelLogger::LogValue("OccupiedSetbackMax", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxConstFlow::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::UnoccupiedSetback::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxConstFlow", 1, value); + return DataModelLogger::LogValue("UnoccupiedSetback", 1, value); } - case PumpConfigurationAndControl::Attributes::MinConstTemp::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::UnoccupiedSetbackMin::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinConstTemp", 1, value); + return DataModelLogger::LogValue("UnoccupiedSetbackMin", 1, value); } - case PumpConfigurationAndControl::Attributes::MaxConstTemp::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::UnoccupiedSetbackMax::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxConstTemp", 1, value); + return DataModelLogger::LogValue("UnoccupiedSetbackMax", 1, value); } - case PumpConfigurationAndControl::Attributes::PumpStatus::Id: { - chip::BitMask value; + case Thermostat::Attributes::EmergencyHeatDelta::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PumpStatus", 1, value); + return DataModelLogger::LogValue("EmergencyHeatDelta", 1, value); } - case PumpConfigurationAndControl::Attributes::EffectiveOperationMode::Id: { - chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + case Thermostat::Attributes::ACType::Id: { + chip::app::Clusters::Thermostat::ACTypeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EffectiveOperationMode", 1, value); + return DataModelLogger::LogValue("ACType", 1, value); } - case PumpConfigurationAndControl::Attributes::EffectiveControlMode::Id: { - chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + case Thermostat::Attributes::ACCapacity::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EffectiveControlMode", 1, value); + return DataModelLogger::LogValue("ACCapacity", 1, value); } - case PumpConfigurationAndControl::Attributes::Capacity::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ACRefrigerantType::Id: { + chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Capacity", 1, value); + return DataModelLogger::LogValue("ACRefrigerantType", 1, value); } - case PumpConfigurationAndControl::Attributes::Speed::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ACCompressorType::Id: { + chip::app::Clusters::Thermostat::ACCompressorTypeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Speed", 1, value); + return DataModelLogger::LogValue("ACCompressorType", 1, value); } - case PumpConfigurationAndControl::Attributes::LifetimeRunningHours::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ACErrorCode::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LifetimeRunningHours", 1, value); + return DataModelLogger::LogValue("ACErrorCode", 1, value); } - case PumpConfigurationAndControl::Attributes::Power::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ACLouverPosition::Id: { + chip::app::Clusters::Thermostat::ACLouverPositionEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Power", 1, value); + return DataModelLogger::LogValue("ACLouverPosition", 1, value); } - case PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::ACCoilTemperature::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LifetimeEnergyConsumed", 1, value); + return DataModelLogger::LogValue("ACCoilTemperature", 1, value); } - case PumpConfigurationAndControl::Attributes::OperationMode::Id: { - chip::app::Clusters::PumpConfigurationAndControl::OperationModeEnum value; + case Thermostat::Attributes::ACCapacityformat::Id: { + chip::app::Clusters::Thermostat::ACCapacityFormatEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OperationMode", 1, value); + return DataModelLogger::LogValue("ACCapacityformat", 1, value); } - case PumpConfigurationAndControl::Attributes::ControlMode::Id: { - chip::app::Clusters::PumpConfigurationAndControl::ControlModeEnum value; + case Thermostat::Attributes::PresetTypes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ControlMode", 1, value); + return DataModelLogger::LogValue("PresetTypes", 1, value); } - case PumpConfigurationAndControl::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::ScheduleTypes::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PumpConfigurationAndControl::Id); + return DataModelLogger::LogValue("ScheduleTypes", 1, value); } - case PumpConfigurationAndControl::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::NumberOfPresets::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PumpConfigurationAndControl::Id); + return DataModelLogger::LogValue("NumberOfPresets", 1, value); } - case PumpConfigurationAndControl::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::NumberOfSchedules::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("NumberOfSchedules", 1, value); } - case PumpConfigurationAndControl::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case Thermostat::Attributes::NumberOfScheduleTransitions::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, PumpConfigurationAndControl::Id); + return DataModelLogger::LogValue("NumberOfScheduleTransitions", 1, value); } - case PumpConfigurationAndControl::Attributes::FeatureMap::Id: { - uint32_t value; + case Thermostat::Attributes::NumberOfScheduleTransitionPerDay::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("NumberOfScheduleTransitionPerDay", 1, value); } - case PumpConfigurationAndControl::Attributes::ClusterRevision::Id: { - uint16_t value; + case Thermostat::Attributes::ActivePresetHandle::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("ActivePresetHandle", 1, value); } + case Thermostat::Attributes::ActiveScheduleHandle::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveScheduleHandle", 1, value); } - break; - } - case Thermostat::Id: { - switch (path.mAttributeId) - { - case Thermostat::Attributes::LocalTemperature::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::Presets::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LocalTemperature", 1, value); + return DataModelLogger::LogValue("Presets", 1, value); } - case Thermostat::Attributes::OutdoorTemperature::Id: { - chip::app::DataModel::Nullable value; + case Thermostat::Attributes::Schedules::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OutdoorTemperature", 1, value); + return DataModelLogger::LogValue("Schedules", 1, value); } - case Thermostat::Attributes::Occupancy::Id: { - chip::BitMask value; + case Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Occupancy", 1, value); + return DataModelLogger::LogValue("SetpointHoldExpiryTimestamp", 1, value); } - case Thermostat::Attributes::AbsMinHeatSetpointLimit::Id: { - int16_t value; + case Thermostat::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AbsMinHeatSetpointLimit", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Thermostat::Id); } - case Thermostat::Attributes::AbsMaxHeatSetpointLimit::Id: { - int16_t value; + case Thermostat::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AbsMaxHeatSetpointLimit", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Thermostat::Id); } - case Thermostat::Attributes::AbsMinCoolSetpointLimit::Id: { - int16_t value; + case Thermostat::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AbsMinCoolSetpointLimit", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id: { - int16_t value; + case Thermostat::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AbsMaxCoolSetpointLimit", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Thermostat::Id); } - case Thermostat::Attributes::PICoolingDemand::Id: { - uint8_t value; + case Thermostat::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PICoolingDemand", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case Thermostat::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case Thermostat::Attributes::PIHeatingDemand::Id: { - uint8_t value; + } + break; + } + case FanControl::Id: { + switch (path.mAttributeId) + { + case FanControl::Attributes::FanMode::Id: { + chip::app::Clusters::FanControl::FanModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PIHeatingDemand", 1, value); + return DataModelLogger::LogValue("FanMode", 1, value); } - case Thermostat::Attributes::HVACSystemTypeConfiguration::Id: { - chip::BitMask value; + case FanControl::Attributes::FanModeSequence::Id: { + chip::app::Clusters::FanControl::FanModeSequenceEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("HVACSystemTypeConfiguration", 1, value); + return DataModelLogger::LogValue("FanModeSequence", 1, value); } - case Thermostat::Attributes::LocalTemperatureCalibration::Id: { - int8_t value; + case FanControl::Attributes::PercentSetting::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LocalTemperatureCalibration", 1, value); + return DataModelLogger::LogValue("PercentSetting", 1, value); } - case Thermostat::Attributes::OccupiedCoolingSetpoint::Id: { - int16_t value; + case FanControl::Attributes::PercentCurrent::Id: { + chip::Percent value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupiedCoolingSetpoint", 1, value); + return DataModelLogger::LogValue("PercentCurrent", 1, value); } - case Thermostat::Attributes::OccupiedHeatingSetpoint::Id: { - int16_t value; + case FanControl::Attributes::SpeedMax::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupiedHeatingSetpoint", 1, value); + return DataModelLogger::LogValue("SpeedMax", 1, value); } - case Thermostat::Attributes::UnoccupiedCoolingSetpoint::Id: { - int16_t value; + case FanControl::Attributes::SpeedSetting::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UnoccupiedCoolingSetpoint", 1, value); + return DataModelLogger::LogValue("SpeedSetting", 1, value); } - case Thermostat::Attributes::UnoccupiedHeatingSetpoint::Id: { - int16_t value; + case FanControl::Attributes::SpeedCurrent::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UnoccupiedHeatingSetpoint", 1, value); + return DataModelLogger::LogValue("SpeedCurrent", 1, value); } - case Thermostat::Attributes::MinHeatSetpointLimit::Id: { - int16_t value; + case FanControl::Attributes::RockSupport::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinHeatSetpointLimit", 1, value); + return DataModelLogger::LogValue("RockSupport", 1, value); } - case Thermostat::Attributes::MaxHeatSetpointLimit::Id: { - int16_t value; + case FanControl::Attributes::RockSetting::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxHeatSetpointLimit", 1, value); + return DataModelLogger::LogValue("RockSetting", 1, value); } - case Thermostat::Attributes::MinCoolSetpointLimit::Id: { - int16_t value; + case FanControl::Attributes::WindSupport::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinCoolSetpointLimit", 1, value); + return DataModelLogger::LogValue("WindSupport", 1, value); } - case Thermostat::Attributes::MaxCoolSetpointLimit::Id: { - int16_t value; + case FanControl::Attributes::WindSetting::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxCoolSetpointLimit", 1, value); + return DataModelLogger::LogValue("WindSetting", 1, value); } - case Thermostat::Attributes::MinSetpointDeadBand::Id: { - int8_t value; + case FanControl::Attributes::AirflowDirection::Id: { + chip::app::Clusters::FanControl::AirflowDirectionEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinSetpointDeadBand", 1, value); + return DataModelLogger::LogValue("AirflowDirection", 1, value); } - case Thermostat::Attributes::RemoteSensing::Id: { - chip::BitMask value; + case FanControl::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RemoteSensing", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FanControl::Id); } - case Thermostat::Attributes::ControlSequenceOfOperation::Id: { - chip::app::Clusters::Thermostat::ControlSequenceOfOperationEnum value; + case FanControl::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ControlSequenceOfOperation", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FanControl::Id); } - case Thermostat::Attributes::SystemMode::Id: { - chip::app::Clusters::Thermostat::SystemModeEnum value; + case FanControl::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SystemMode", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case Thermostat::Attributes::ThermostatRunningMode::Id: { - chip::app::Clusters::Thermostat::ThermostatRunningModeEnum value; + case FanControl::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThermostatRunningMode", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FanControl::Id); } - case Thermostat::Attributes::StartOfWeek::Id: { - chip::app::Clusters::Thermostat::StartOfWeekEnum value; + case FanControl::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartOfWeek", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Thermostat::Attributes::NumberOfWeeklyTransitions::Id: { - uint8_t value; + case FanControl::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfWeeklyTransitions", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case Thermostat::Attributes::NumberOfDailyTransitions::Id: { - uint8_t value; + } + break; + } + case ThermostatUserInterfaceConfiguration::Id: { + switch (path.mAttributeId) + { + case ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id: { + chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfDailyTransitions", 1, value); + return DataModelLogger::LogValue("TemperatureDisplayMode", 1, value); } - case Thermostat::Attributes::TemperatureSetpointHold::Id: { - chip::app::Clusters::Thermostat::TemperatureSetpointHoldEnum value; + case ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id: { + chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TemperatureSetpointHold", 1, value); + return DataModelLogger::LogValue("KeypadLockout", 1, value); } - case Thermostat::Attributes::TemperatureSetpointHoldDuration::Id: { - chip::app::DataModel::Nullable value; + case ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id: { + chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TemperatureSetpointHoldDuration", 1, value); + return DataModelLogger::LogValue("ScheduleProgrammingVisibility", 1, value); } - case Thermostat::Attributes::ThermostatProgrammingOperationMode::Id: { - chip::BitMask value; + case ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThermostatProgrammingOperationMode", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + ThermostatUserInterfaceConfiguration::Id); } - case Thermostat::Attributes::ThermostatRunningState::Id: { - chip::BitMask value; + case ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThermostatRunningState", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThermostatUserInterfaceConfiguration::Id); } - case Thermostat::Attributes::SetpointChangeSource::Id: { - chip::app::Clusters::Thermostat::SetpointChangeSourceEnum value; + case ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SetpointChangeSource", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case Thermostat::Attributes::SetpointChangeAmount::Id: { - chip::app::DataModel::Nullable value; + case ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SetpointChangeAmount", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThermostatUserInterfaceConfiguration::Id); } - case Thermostat::Attributes::SetpointChangeSourceTimestamp::Id: { + case ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SetpointChangeSourceTimestamp", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Thermostat::Attributes::OccupiedSetback::Id: { - chip::app::DataModel::Nullable value; + case ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupiedSetback", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case Thermostat::Attributes::OccupiedSetbackMin::Id: { - chip::app::DataModel::Nullable value; + } + break; + } + case ColorControl::Id: { + switch (path.mAttributeId) + { + case ColorControl::Attributes::CurrentHue::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupiedSetbackMin", 1, value); + return DataModelLogger::LogValue("CurrentHue", 1, value); } - case Thermostat::Attributes::OccupiedSetbackMax::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::CurrentSaturation::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupiedSetbackMax", 1, value); + return DataModelLogger::LogValue("CurrentSaturation", 1, value); } - case Thermostat::Attributes::UnoccupiedSetback::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::RemainingTime::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UnoccupiedSetback", 1, value); + return DataModelLogger::LogValue("RemainingTime", 1, value); } - case Thermostat::Attributes::UnoccupiedSetbackMin::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::CurrentX::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UnoccupiedSetbackMin", 1, value); + return DataModelLogger::LogValue("CurrentX", 1, value); } - case Thermostat::Attributes::UnoccupiedSetbackMax::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::CurrentY::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UnoccupiedSetbackMax", 1, value); + return DataModelLogger::LogValue("CurrentY", 1, value); } - case Thermostat::Attributes::EmergencyHeatDelta::Id: { - uint8_t value; + case ColorControl::Attributes::DriftCompensation::Id: { + chip::app::Clusters::ColorControl::DriftCompensationEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EmergencyHeatDelta", 1, value); + return DataModelLogger::LogValue("DriftCompensation", 1, value); } - case Thermostat::Attributes::ACType::Id: { - chip::app::Clusters::Thermostat::ACTypeEnum value; + case ColorControl::Attributes::CompensationText::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACType", 1, value); + return DataModelLogger::LogValue("CompensationText", 1, value); } - case Thermostat::Attributes::ACCapacity::Id: { + case ColorControl::Attributes::ColorTemperatureMireds::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCapacity", 1, value); + return DataModelLogger::LogValue("ColorTemperatureMireds", 1, value); } - case Thermostat::Attributes::ACRefrigerantType::Id: { - chip::app::Clusters::Thermostat::ACRefrigerantTypeEnum value; + case ColorControl::Attributes::ColorMode::Id: { + chip::app::Clusters::ColorControl::ColorModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACRefrigerantType", 1, value); + return DataModelLogger::LogValue("ColorMode", 1, value); } - case Thermostat::Attributes::ACCompressorType::Id: { - chip::app::Clusters::Thermostat::ACCompressorTypeEnum value; + case ColorControl::Attributes::Options::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCompressorType", 1, value); + return DataModelLogger::LogValue("Options", 1, value); } - case Thermostat::Attributes::ACErrorCode::Id: { - chip::BitMask value; + case ColorControl::Attributes::NumberOfPrimaries::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACErrorCode", 1, value); + return DataModelLogger::LogValue("NumberOfPrimaries", 1, value); } - case Thermostat::Attributes::ACLouverPosition::Id: { - chip::app::Clusters::Thermostat::ACLouverPositionEnum value; + case ColorControl::Attributes::Primary1X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACLouverPosition", 1, value); + return DataModelLogger::LogValue("Primary1X", 1, value); } - case Thermostat::Attributes::ACCoilTemperature::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::Primary1Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCoilTemperature", 1, value); + return DataModelLogger::LogValue("Primary1Y", 1, value); } - case Thermostat::Attributes::ACCapacityformat::Id: { - chip::app::Clusters::Thermostat::ACCapacityFormatEnum value; + case ColorControl::Attributes::Primary1Intensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCapacityformat", 1, value); + return DataModelLogger::LogValue("Primary1Intensity", 1, value); } - case Thermostat::Attributes::PresetTypes::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary2X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PresetTypes", 1, value); + return DataModelLogger::LogValue("Primary2X", 1, value); } - case Thermostat::Attributes::ScheduleTypes::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary2Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScheduleTypes", 1, value); + return DataModelLogger::LogValue("Primary2Y", 1, value); } - case Thermostat::Attributes::NumberOfPresets::Id: { - uint8_t value; + case ColorControl::Attributes::Primary2Intensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfPresets", 1, value); + return DataModelLogger::LogValue("Primary2Intensity", 1, value); } - case Thermostat::Attributes::NumberOfSchedules::Id: { - uint8_t value; + case ColorControl::Attributes::Primary3X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfSchedules", 1, value); + return DataModelLogger::LogValue("Primary3X", 1, value); } - case Thermostat::Attributes::NumberOfScheduleTransitions::Id: { - uint8_t value; + case ColorControl::Attributes::Primary3Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfScheduleTransitions", 1, value); + return DataModelLogger::LogValue("Primary3Y", 1, value); } - case Thermostat::Attributes::NumberOfScheduleTransitionPerDay::Id: { + case ColorControl::Attributes::Primary3Intensity::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfScheduleTransitionPerDay", 1, value); + return DataModelLogger::LogValue("Primary3Intensity", 1, value); } - case Thermostat::Attributes::ActivePresetHandle::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::Primary4X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActivePresetHandle", 1, value); + return DataModelLogger::LogValue("Primary4X", 1, value); } - case Thermostat::Attributes::ActiveScheduleHandle::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::Primary4Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveScheduleHandle", 1, value); + return DataModelLogger::LogValue("Primary4Y", 1, value); } - case Thermostat::Attributes::Presets::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary4Intensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Presets", 1, value); + return DataModelLogger::LogValue("Primary4Intensity", 1, value); } - case Thermostat::Attributes::Schedules::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary5X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Schedules", 1, value); + return DataModelLogger::LogValue("Primary5X", 1, value); } - case Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::Primary5Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SetpointHoldExpiryTimestamp", 1, value); + return DataModelLogger::LogValue("Primary5Y", 1, value); } - case Thermostat::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary5Intensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Thermostat::Id); + return DataModelLogger::LogValue("Primary5Intensity", 1, value); } - case Thermostat::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary6X::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Thermostat::Id); + return DataModelLogger::LogValue("Primary6X", 1, value); } - case Thermostat::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary6Y::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("Primary6Y", 1, value); } - case Thermostat::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::Primary6Intensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, Thermostat::Id); + return DataModelLogger::LogValue("Primary6Intensity", 1, value); } - case Thermostat::Attributes::FeatureMap::Id: { - uint32_t value; + case ColorControl::Attributes::WhitePointX::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("WhitePointX", 1, value); } - case Thermostat::Attributes::ClusterRevision::Id: { + case ColorControl::Attributes::WhitePointY::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } + return DataModelLogger::LogValue("WhitePointY", 1, value); } - break; - } - case FanControl::Id: { - switch (path.mAttributeId) - { - case FanControl::Attributes::FanMode::Id: { - chip::app::Clusters::FanControl::FanModeEnum value; + case ColorControl::Attributes::ColorPointRX::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FanMode", 1, value); + return DataModelLogger::LogValue("ColorPointRX", 1, value); } - case FanControl::Attributes::FanModeSequence::Id: { - chip::app::Clusters::FanControl::FanModeSequenceEnum value; + case ColorControl::Attributes::ColorPointRY::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FanModeSequence", 1, value); + return DataModelLogger::LogValue("ColorPointRY", 1, value); } - case FanControl::Attributes::PercentSetting::Id: { - chip::app::DataModel::Nullable value; + case ColorControl::Attributes::ColorPointRIntensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PercentSetting", 1, value); + return DataModelLogger::LogValue("ColorPointRIntensity", 1, value); } - case FanControl::Attributes::PercentCurrent::Id: { - chip::Percent value; + case ColorControl::Attributes::ColorPointGX::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PercentCurrent", 1, value); + return DataModelLogger::LogValue("ColorPointGX", 1, value); } - case FanControl::Attributes::SpeedMax::Id: { - uint8_t value; + case ColorControl::Attributes::ColorPointGY::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SpeedMax", 1, value); + return DataModelLogger::LogValue("ColorPointGY", 1, value); } - case FanControl::Attributes::SpeedSetting::Id: { + case ColorControl::Attributes::ColorPointGIntensity::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SpeedSetting", 1, value); + return DataModelLogger::LogValue("ColorPointGIntensity", 1, value); } - case FanControl::Attributes::SpeedCurrent::Id: { - uint8_t value; + case ColorControl::Attributes::ColorPointBX::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SpeedCurrent", 1, value); + return DataModelLogger::LogValue("ColorPointBX", 1, value); } - case FanControl::Attributes::RockSupport::Id: { - chip::BitMask value; + case ColorControl::Attributes::ColorPointBY::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RockSupport", 1, value); + return DataModelLogger::LogValue("ColorPointBY", 1, value); } - case FanControl::Attributes::RockSetting::Id: { - chip::BitMask value; + case ColorControl::Attributes::ColorPointBIntensity::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RockSetting", 1, value); + return DataModelLogger::LogValue("ColorPointBIntensity", 1, value); } - case FanControl::Attributes::WindSupport::Id: { - chip::BitMask value; + case ColorControl::Attributes::EnhancedCurrentHue::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("WindSupport", 1, value); + return DataModelLogger::LogValue("EnhancedCurrentHue", 1, value); } - case FanControl::Attributes::WindSetting::Id: { - chip::BitMask value; + case ColorControl::Attributes::EnhancedColorMode::Id: { + chip::app::Clusters::ColorControl::EnhancedColorModeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("WindSetting", 1, value); + return DataModelLogger::LogValue("EnhancedColorMode", 1, value); } - case FanControl::Attributes::AirflowDirection::Id: { - chip::app::Clusters::FanControl::AirflowDirectionEnum value; + case ColorControl::Attributes::ColorLoopActive::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AirflowDirection", 1, value); + return DataModelLogger::LogValue("ColorLoopActive", 1, value); } - case FanControl::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::ColorLoopDirection::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FanControl::Id); + return DataModelLogger::LogValue("ColorLoopDirection", 1, value); } - case FanControl::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::ColorLoopTime::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FanControl::Id); + return DataModelLogger::LogValue("ColorLoopTime", 1, value); } - case FanControl::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::ColorLoopStartEnhancedHue::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("ColorLoopStartEnhancedHue", 1, value); } - case FanControl::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, FanControl::Id); + return DataModelLogger::LogValue("ColorLoopStoredEnhancedHue", 1, value); } - case FanControl::Attributes::FeatureMap::Id: { - uint32_t value; + case ColorControl::Attributes::ColorCapabilities::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("ColorCapabilities", 1, value); } - case FanControl::Attributes::ClusterRevision::Id: { + case ColorControl::Attributes::ColorTempPhysicalMinMireds::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } + return DataModelLogger::LogValue("ColorTempPhysicalMinMireds", 1, value); } - break; - } - case ThermostatUserInterfaceConfiguration::Id: { - switch (path.mAttributeId) - { - case ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::TemperatureDisplayModeEnum value; + case ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TemperatureDisplayMode", 1, value); + return DataModelLogger::LogValue("ColorTempPhysicalMaxMireds", 1, value); } - case ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::KeypadLockoutEnum value; + case ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("KeypadLockout", 1, value); + return DataModelLogger::LogValue("CoupleColorTempToLevelMinMireds", 1, value); } - case ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id: { - chip::app::Clusters::ThermostatUserInterfaceConfiguration::ScheduleProgrammingVisibilityEnum value; + case ColorControl::Attributes::StartUpColorTemperatureMireds::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScheduleProgrammingVisibility", 1, value); + return DataModelLogger::LogValue("StartUpColorTemperatureMireds", 1, value); } - case ThermostatUserInterfaceConfiguration::Attributes::GeneratedCommandList::Id: { + case ColorControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - ThermostatUserInterfaceConfiguration::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ColorControl::Id); } - case ThermostatUserInterfaceConfiguration::Attributes::AcceptedCommandList::Id: { + case ColorControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThermostatUserInterfaceConfiguration::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ColorControl::Id); } - case ThermostatUserInterfaceConfiguration::Attributes::EventList::Id: { + case ColorControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ThermostatUserInterfaceConfiguration::Attributes::AttributeList::Id: { + case ColorControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThermostatUserInterfaceConfiguration::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ColorControl::Id); } - case ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::Id: { + case ColorControl::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::Id: { + case ColorControl::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -15444,295 +16709,303 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ColorControl::Id: { + case BallastConfiguration::Id: { switch (path.mAttributeId) { - case ColorControl::Attributes::CurrentHue::Id: { + case BallastConfiguration::Attributes::PhysicalMinLevel::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentHue", 1, value); + return DataModelLogger::LogValue("PhysicalMinLevel", 1, value); } - case ColorControl::Attributes::CurrentSaturation::Id: { + case BallastConfiguration::Attributes::PhysicalMaxLevel::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentSaturation", 1, value); - } - case ColorControl::Attributes::RemainingTime::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RemainingTime", 1, value); + return DataModelLogger::LogValue("PhysicalMaxLevel", 1, value); } - case ColorControl::Attributes::CurrentX::Id: { - uint16_t value; + case BallastConfiguration::Attributes::BallastStatus::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentX", 1, value); + return DataModelLogger::LogValue("BallastStatus", 1, value); } - case ColorControl::Attributes::CurrentY::Id: { - uint16_t value; + case BallastConfiguration::Attributes::MinLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentY", 1, value); + return DataModelLogger::LogValue("MinLevel", 1, value); } - case ColorControl::Attributes::DriftCompensation::Id: { - chip::app::Clusters::ColorControl::DriftCompensationEnum value; + case BallastConfiguration::Attributes::MaxLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("DriftCompensation", 1, value); + return DataModelLogger::LogValue("MaxLevel", 1, value); } - case ColorControl::Attributes::CompensationText::Id: { - chip::CharSpan value; + case BallastConfiguration::Attributes::IntrinsicBallastFactor::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CompensationText", 1, value); + return DataModelLogger::LogValue("IntrinsicBallastFactor", 1, value); } - case ColorControl::Attributes::ColorTemperatureMireds::Id: { - uint16_t value; + case BallastConfiguration::Attributes::BallastFactorAdjustment::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorTemperatureMireds", 1, value); + return DataModelLogger::LogValue("BallastFactorAdjustment", 1, value); } - case ColorControl::Attributes::ColorMode::Id: { - chip::app::Clusters::ColorControl::ColorModeEnum value; + case BallastConfiguration::Attributes::LampQuantity::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorMode", 1, value); + return DataModelLogger::LogValue("LampQuantity", 1, value); } - case ColorControl::Attributes::Options::Id: { - chip::BitMask value; + case BallastConfiguration::Attributes::LampType::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Options", 1, value); + return DataModelLogger::LogValue("LampType", 1, value); } - case ColorControl::Attributes::NumberOfPrimaries::Id: { - chip::app::DataModel::Nullable value; + case BallastConfiguration::Attributes::LampManufacturer::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfPrimaries", 1, value); + return DataModelLogger::LogValue("LampManufacturer", 1, value); } - case ColorControl::Attributes::Primary1X::Id: { - uint16_t value; + case BallastConfiguration::Attributes::LampRatedHours::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary1X", 1, value); + return DataModelLogger::LogValue("LampRatedHours", 1, value); } - case ColorControl::Attributes::Primary1Y::Id: { - uint16_t value; + case BallastConfiguration::Attributes::LampBurnHours::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary1Y", 1, value); + return DataModelLogger::LogValue("LampBurnHours", 1, value); } - case ColorControl::Attributes::Primary1Intensity::Id: { - chip::app::DataModel::Nullable value; + case BallastConfiguration::Attributes::LampAlarmMode::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary1Intensity", 1, value); + return DataModelLogger::LogValue("LampAlarmMode", 1, value); } - case ColorControl::Attributes::Primary2X::Id: { - uint16_t value; + case BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary2X", 1, value); + return DataModelLogger::LogValue("LampBurnHoursTripPoint", 1, value); } - case ColorControl::Attributes::Primary2Y::Id: { - uint16_t value; + case BallastConfiguration::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary2Y", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BallastConfiguration::Id); } - case ColorControl::Attributes::Primary2Intensity::Id: { - chip::app::DataModel::Nullable value; + case BallastConfiguration::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary2Intensity", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BallastConfiguration::Id); } - case ColorControl::Attributes::Primary3X::Id: { - uint16_t value; + case BallastConfiguration::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary3X", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case ColorControl::Attributes::Primary3Y::Id: { - uint16_t value; + case BallastConfiguration::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary3Y", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, BallastConfiguration::Id); } - case ColorControl::Attributes::Primary3Intensity::Id: { - chip::app::DataModel::Nullable value; + case BallastConfiguration::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary3Intensity", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ColorControl::Attributes::Primary4X::Id: { + case BallastConfiguration::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary4X", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case ColorControl::Attributes::Primary4Y::Id: { - uint16_t value; + } + break; + } + case IlluminanceMeasurement::Id: { + switch (path.mAttributeId) + { + case IlluminanceMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary4Y", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case ColorControl::Attributes::Primary4Intensity::Id: { - chip::app::DataModel::Nullable value; + case IlluminanceMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary4Intensity", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case ColorControl::Attributes::Primary5X::Id: { - uint16_t value; + case IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary5X", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case ColorControl::Attributes::Primary5Y::Id: { + case IlluminanceMeasurement::Attributes::Tolerance::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary5Y", 1, value); + return DataModelLogger::LogValue("Tolerance", 1, value); } - case ColorControl::Attributes::Primary5Intensity::Id: { - chip::app::DataModel::Nullable value; + case IlluminanceMeasurement::Attributes::LightSensorType::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary5Intensity", 1, value); + return DataModelLogger::LogValue("LightSensorType", 1, value); } - case ColorControl::Attributes::Primary6X::Id: { - uint16_t value; + case IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary6X", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IlluminanceMeasurement::Id); } - case ColorControl::Attributes::Primary6Y::Id: { - uint16_t value; + case IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary6Y", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IlluminanceMeasurement::Id); } - case ColorControl::Attributes::Primary6Intensity::Id: { - chip::app::DataModel::Nullable value; + case IlluminanceMeasurement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Primary6Intensity", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case ColorControl::Attributes::WhitePointX::Id: { - uint16_t value; + case IlluminanceMeasurement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("WhitePointX", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, IlluminanceMeasurement::Id); } - case ColorControl::Attributes::WhitePointY::Id: { - uint16_t value; + case IlluminanceMeasurement::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("WhitePointY", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ColorControl::Attributes::ColorPointRX::Id: { + case IlluminanceMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointRX", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case ColorControl::Attributes::ColorPointRY::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointRY", 1, value); } - case ColorControl::Attributes::ColorPointRIntensity::Id: { - chip::app::DataModel::Nullable value; + break; + } + case TemperatureMeasurement::Id: { + switch (path.mAttributeId) + { + case TemperatureMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointRIntensity", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case ColorControl::Attributes::ColorPointGX::Id: { - uint16_t value; + case TemperatureMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointGX", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case ColorControl::Attributes::ColorPointGY::Id: { - uint16_t value; + case TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointGY", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case ColorControl::Attributes::ColorPointGIntensity::Id: { - chip::app::DataModel::Nullable value; + case TemperatureMeasurement::Attributes::Tolerance::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointGIntensity", 1, value); + return DataModelLogger::LogValue("Tolerance", 1, value); } - case ColorControl::Attributes::ColorPointBX::Id: { - uint16_t value; + case TemperatureMeasurement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointBX", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureMeasurement::Id); } - case ColorControl::Attributes::ColorPointBY::Id: { - uint16_t value; + case TemperatureMeasurement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointBY", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureMeasurement::Id); } - case ColorControl::Attributes::ColorPointBIntensity::Id: { - chip::app::DataModel::Nullable value; + case TemperatureMeasurement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorPointBIntensity", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case ColorControl::Attributes::EnhancedCurrentHue::Id: { - uint16_t value; + case TemperatureMeasurement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EnhancedCurrentHue", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureMeasurement::Id); } - case ColorControl::Attributes::EnhancedColorMode::Id: { - chip::app::Clusters::ColorControl::EnhancedColorModeEnum value; + case TemperatureMeasurement::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EnhancedColorMode", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ColorControl::Attributes::ColorLoopActive::Id: { - uint8_t value; + case TemperatureMeasurement::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorLoopActive", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case ColorControl::Attributes::ColorLoopDirection::Id: { - uint8_t value; + } + break; + } + case PressureMeasurement::Id: { + switch (path.mAttributeId) + { + case PressureMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorLoopDirection", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case ColorControl::Attributes::ColorLoopTime::Id: { - uint16_t value; + case PressureMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorLoopTime", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case ColorControl::Attributes::ColorLoopStartEnhancedHue::Id: { - uint16_t value; + case PressureMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorLoopStartEnhancedHue", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case ColorControl::Attributes::ColorLoopStoredEnhancedHue::Id: { + case PressureMeasurement::Attributes::Tolerance::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorLoopStoredEnhancedHue", 1, value); + return DataModelLogger::LogValue("Tolerance", 1, value); } - case ColorControl::Attributes::ColorCapabilities::Id: { - chip::BitMask value; + case PressureMeasurement::Attributes::ScaledValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorCapabilities", 1, value); + return DataModelLogger::LogValue("ScaledValue", 1, value); } - case ColorControl::Attributes::ColorTempPhysicalMinMireds::Id: { - uint16_t value; + case PressureMeasurement::Attributes::MinScaledValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorTempPhysicalMinMireds", 1, value); + return DataModelLogger::LogValue("MinScaledValue", 1, value); } - case ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id: { - uint16_t value; + case PressureMeasurement::Attributes::MaxScaledValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ColorTempPhysicalMaxMireds", 1, value); + return DataModelLogger::LogValue("MaxScaledValue", 1, value); } - case ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id: { + case PressureMeasurement::Attributes::ScaledTolerance::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CoupleColorTempToLevelMinMireds", 1, value); + return DataModelLogger::LogValue("ScaledTolerance", 1, value); } - case ColorControl::Attributes::StartUpColorTemperatureMireds::Id: { - chip::app::DataModel::Nullable value; + case PressureMeasurement::Attributes::Scale::Id: { + int8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartUpColorTemperatureMireds", 1, value); + return DataModelLogger::LogValue("Scale", 1, value); } - case ColorControl::Attributes::GeneratedCommandList::Id: { + case PressureMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ColorControl::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PressureMeasurement::Id); } - case ColorControl::Attributes::AcceptedCommandList::Id: { + case PressureMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ColorControl::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PressureMeasurement::Id); } - case ColorControl::Attributes::EventList::Id: { + case PressureMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ColorControl::Attributes::AttributeList::Id: { + case PressureMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ColorControl::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, PressureMeasurement::Id); } - case ColorControl::Attributes::FeatureMap::Id: { + case PressureMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ColorControl::Attributes::ClusterRevision::Id: { + case PressureMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -15740,105 +17013,111 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case BallastConfiguration::Id: { + case FlowMeasurement::Id: { switch (path.mAttributeId) { - case BallastConfiguration::Attributes::PhysicalMinLevel::Id: { - uint8_t value; + case FlowMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PhysicalMinLevel", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case BallastConfiguration::Attributes::PhysicalMaxLevel::Id: { - uint8_t value; + case FlowMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PhysicalMaxLevel", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case BallastConfiguration::Attributes::BallastStatus::Id: { - chip::BitMask value; + case FlowMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("BallastStatus", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case BallastConfiguration::Attributes::MinLevel::Id: { - uint8_t value; + case FlowMeasurement::Attributes::Tolerance::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinLevel", 1, value); + return DataModelLogger::LogValue("Tolerance", 1, value); } - case BallastConfiguration::Attributes::MaxLevel::Id: { - uint8_t value; + case FlowMeasurement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxLevel", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FlowMeasurement::Id); } - case BallastConfiguration::Attributes::IntrinsicBallastFactor::Id: { - chip::app::DataModel::Nullable value; + case FlowMeasurement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("IntrinsicBallastFactor", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FlowMeasurement::Id); } - case BallastConfiguration::Attributes::BallastFactorAdjustment::Id: { - chip::app::DataModel::Nullable value; + case FlowMeasurement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("BallastFactorAdjustment", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case BallastConfiguration::Attributes::LampQuantity::Id: { - uint8_t value; + case FlowMeasurement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampQuantity", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FlowMeasurement::Id); } - case BallastConfiguration::Attributes::LampType::Id: { - chip::CharSpan value; + case FlowMeasurement::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampType", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case BallastConfiguration::Attributes::LampManufacturer::Id: { - chip::CharSpan value; + case FlowMeasurement::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampManufacturer", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case BallastConfiguration::Attributes::LampRatedHours::Id: { - chip::app::DataModel::Nullable value; + } + break; + } + case RelativeHumidityMeasurement::Id: { + switch (path.mAttributeId) + { + case RelativeHumidityMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampRatedHours", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case BallastConfiguration::Attributes::LampBurnHours::Id: { - chip::app::DataModel::Nullable value; + case RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampBurnHours", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case BallastConfiguration::Attributes::LampAlarmMode::Id: { - chip::BitMask value; + case RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampAlarmMode", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case BallastConfiguration::Attributes::LampBurnHoursTripPoint::Id: { - chip::app::DataModel::Nullable value; + case RelativeHumidityMeasurement::Attributes::Tolerance::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LampBurnHoursTripPoint", 1, value); + return DataModelLogger::LogValue("Tolerance", 1, value); } - case BallastConfiguration::Attributes::GeneratedCommandList::Id: { + case RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BallastConfiguration::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RelativeHumidityMeasurement::Id); } - case BallastConfiguration::Attributes::AcceptedCommandList::Id: { + case RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BallastConfiguration::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RelativeHumidityMeasurement::Id); } - case BallastConfiguration::Attributes::EventList::Id: { + case RelativeHumidityMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case BallastConfiguration::Attributes::AttributeList::Id: { + case RelativeHumidityMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, BallastConfiguration::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RelativeHumidityMeasurement::Id); } - case BallastConfiguration::Attributes::FeatureMap::Id: { + case RelativeHumidityMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case BallastConfiguration::Attributes::ClusterRevision::Id: { + case RelativeHumidityMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -15846,60 +17125,105 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case IlluminanceMeasurement::Id: { + case OccupancySensing::Id: { switch (path.mAttributeId) { - case IlluminanceMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case OccupancySensing::Attributes::Occupancy::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("Occupancy", 1, value); } - case IlluminanceMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case OccupancySensing::Attributes::OccupancySensorType::Id: { + chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("OccupancySensorType", 1, value); } - case IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogValue("OccupancySensorTypeBitmap", 1, value); } - case IlluminanceMeasurement::Attributes::Tolerance::Id: { + case OccupancySensing::Attributes::HoldTime::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Tolerance", 1, value); + return DataModelLogger::LogValue("HoldTime", 1, value); + } + case OccupancySensing::Attributes::HoldTimeLimits::Id: { + chip::app::Clusters::OccupancySensing::Structs::HoldTimeLimitsStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HoldTimeLimits", 1, value); + } + case OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PIROccupiedToUnoccupiedDelay", 1, value); + } + case OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PIRUnoccupiedToOccupiedDelay", 1, value); + } + case OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PIRUnoccupiedToOccupiedThreshold", 1, value); + } + case OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UltrasonicOccupiedToUnoccupiedDelay", 1, value); + } + case OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UltrasonicUnoccupiedToOccupiedDelay", 1, value); + } + case OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("UltrasonicUnoccupiedToOccupiedThreshold", 1, value); + } + case OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalContactOccupiedToUnoccupiedDelay", 1, value); + } + case OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PhysicalContactUnoccupiedToOccupiedDelay", 1, value); } - case IlluminanceMeasurement::Attributes::LightSensorType::Id: { - chip::app::DataModel::Nullable value; + case OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LightSensorType", 1, value); + return DataModelLogger::LogValue("PhysicalContactUnoccupiedToOccupiedThreshold", 1, value); } - case IlluminanceMeasurement::Attributes::GeneratedCommandList::Id: { + case OccupancySensing::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, IlluminanceMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OccupancySensing::Id); } - case IlluminanceMeasurement::Attributes::AcceptedCommandList::Id: { + case OccupancySensing::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, IlluminanceMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OccupancySensing::Id); } - case IlluminanceMeasurement::Attributes::EventList::Id: { + case OccupancySensing::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case IlluminanceMeasurement::Attributes::AttributeList::Id: { + case OccupancySensing::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, IlluminanceMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OccupancySensing::Id); } - case IlluminanceMeasurement::Attributes::FeatureMap::Id: { + case OccupancySensing::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case IlluminanceMeasurement::Attributes::ClusterRevision::Id: { + case OccupancySensing::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -15907,55 +17231,92 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case TemperatureMeasurement::Id: { + case CarbonMonoxideConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case TemperatureMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case TemperatureMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case TemperatureMeasurement::Attributes::Tolerance::Id: { - uint16_t value; + case CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Tolerance", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case TemperatureMeasurement::Attributes::GeneratedCommandList::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + float value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Uncertainty", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementUnitEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeasurementUnit", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementMediumEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeasurementMedium", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::LevelValueEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LevelValue", 1, value); + } + case CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TemperatureMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } - case TemperatureMeasurement::Attributes::AcceptedCommandList::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TemperatureMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonMonoxideConcentrationMeasurement::Id); } - case TemperatureMeasurement::Attributes::EventList::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case TemperatureMeasurement::Attributes::AttributeList::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, TemperatureMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonMonoxideConcentrationMeasurement::Id); } - case TemperatureMeasurement::Attributes::FeatureMap::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case TemperatureMeasurement::Attributes::ClusterRevision::Id: { + case CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -15963,80 +17324,92 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case PressureMeasurement::Id: { + case CarbonDioxideConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case PressureMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case PressureMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case PressureMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case PressureMeasurement::Attributes::Tolerance::Id: { - uint16_t value; + case CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Tolerance", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case PressureMeasurement::Attributes::ScaledValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScaledValue", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case PressureMeasurement::Attributes::MinScaledValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinScaledValue", 1, value); + return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case PressureMeasurement::Attributes::MaxScaledValue::Id: { - chip::app::DataModel::Nullable value; + case CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxScaledValue", 1, value); + return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case PressureMeasurement::Attributes::ScaledTolerance::Id: { - uint16_t value; + case CarbonDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScaledTolerance", 1, value); + return DataModelLogger::LogValue("Uncertainty", 1, value); } - case PressureMeasurement::Attributes::Scale::Id: { - int8_t value; + case CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Scale", 1, value); + return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case PressureMeasurement::Attributes::GeneratedCommandList::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementMediumEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MeasurementMedium", 1, value); + } + case CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::CarbonDioxideConcentrationMeasurement::LevelValueEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("LevelValue", 1, value); + } + case CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, PressureMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } - case PressureMeasurement::Attributes::AcceptedCommandList::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, PressureMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + CarbonDioxideConcentrationMeasurement::Id); } - case PressureMeasurement::Attributes::EventList::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case PressureMeasurement::Attributes::AttributeList::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, PressureMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonDioxideConcentrationMeasurement::Id); } - case PressureMeasurement::Attributes::FeatureMap::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case PressureMeasurement::Attributes::ClusterRevision::Id: { + case CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16044,111 +17417,92 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case FlowMeasurement::Id: { + case NitrogenDioxideConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case FlowMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case FlowMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case FlowMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case FlowMeasurement::Attributes::Tolerance::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Tolerance", 1, value); - } - case FlowMeasurement::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, FlowMeasurement::Id); - } - case FlowMeasurement::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FlowMeasurement::Id); + return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case FlowMeasurement::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case FlowMeasurement::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, FlowMeasurement::Id); + return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case FlowMeasurement::Attributes::FeatureMap::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case FlowMeasurement::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } + return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - break; - } - case RelativeHumidityMeasurement::Id: { - switch (path.mAttributeId) - { - case RelativeHumidityMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("Uncertainty", 1, value); } - case RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case RelativeHumidityMeasurement::Attributes::Tolerance::Id: { - uint16_t value; + case NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Tolerance", 1, value); + return DataModelLogger::LogValue("LevelValue", 1, value); } - case RelativeHumidityMeasurement::Attributes::GeneratedCommandList::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RelativeHumidityMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } - case RelativeHumidityMeasurement::Attributes::AcceptedCommandList::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RelativeHumidityMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + NitrogenDioxideConcentrationMeasurement::Id); } - case RelativeHumidityMeasurement::Attributes::EventList::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RelativeHumidityMeasurement::Attributes::AttributeList::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, RelativeHumidityMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, NitrogenDioxideConcentrationMeasurement::Id); } - case RelativeHumidityMeasurement::Attributes::FeatureMap::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RelativeHumidityMeasurement::Attributes::ClusterRevision::Id: { + case NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16156,105 +17510,90 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case OccupancySensing::Id: { + case OzoneConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case OccupancySensing::Attributes::Occupancy::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Occupancy", 1, value); - } - case OccupancySensing::Attributes::OccupancySensorType::Id: { - chip::app::Clusters::OccupancySensing::OccupancySensorTypeEnum value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupancySensorType", 1, value); - } - case OccupancySensing::Attributes::OccupancySensorTypeBitmap::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OccupancySensorTypeBitmap", 1, value); - } - case OccupancySensing::Attributes::HoldTime::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("HoldTime", 1, value); + return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case OccupancySensing::Attributes::HoldTimeLimits::Id: { - chip::app::Clusters::OccupancySensing::Structs::HoldTimeLimitsStruct::DecodableType value; + case OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("HoldTimeLimits", 1, value); + return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case OccupancySensing::Attributes::PIROccupiedToUnoccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PIROccupiedToUnoccupiedDelay", 1, value); + return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case OccupancySensing::Attributes::PIRUnoccupiedToOccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PIRUnoccupiedToOccupiedDelay", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case OccupancySensing::Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { - uint8_t value; + case OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PIRUnoccupiedToOccupiedThreshold", 1, value); + return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UltrasonicOccupiedToUnoccupiedDelay", 1, value); + return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UltrasonicUnoccupiedToOccupiedDelay", 1, value); + return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { - uint8_t value; + case OzoneConcentrationMeasurement::Attributes::Uncertainty::Id: { + float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("UltrasonicUnoccupiedToOccupiedThreshold", 1, value); + return DataModelLogger::LogValue("Uncertainty", 1, value); } - case OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PhysicalContactOccupiedToUnoccupiedDelay", 1, value); + return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { - uint16_t value; + case OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PhysicalContactUnoccupiedToOccupiedDelay", 1, value); + return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { - uint8_t value; + case OzoneConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::OzoneConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PhysicalContactUnoccupiedToOccupiedThreshold", 1, value); + return DataModelLogger::LogValue("LevelValue", 1, value); } - case OccupancySensing::Attributes::GeneratedCommandList::Id: { + case OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OccupancySensing::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } - case OccupancySensing::Attributes::AcceptedCommandList::Id: { + case OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OccupancySensing::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OzoneConcentrationMeasurement::Id); } - case OccupancySensing::Attributes::EventList::Id: { + case OzoneConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case OccupancySensing::Attributes::AttributeList::Id: { + case OzoneConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, OccupancySensing::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, OzoneConcentrationMeasurement::Id); } - case OccupancySensing::Attributes::FeatureMap::Id: { + case OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case OccupancySensing::Attributes::ClusterRevision::Id: { + case OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16262,92 +17601,90 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case CarbonMonoxideConcentrationMeasurement::Id: { + case Pm25ConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + case Pm25ConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementUnitEnum value; + case Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::MeasurementMediumEnum value; + case Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::CarbonMonoxideConcentrationMeasurement::LevelValueEnum value; + case Pm25ConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::Pm25ConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - CarbonMonoxideConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } - case CarbonMonoxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, - CarbonMonoxideConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); } - case CarbonMonoxideConcentrationMeasurement::Attributes::EventList::Id: { + case Pm25ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::AttributeList::Id: { + case Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonMonoxideConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm25ConcentrationMeasurement::Id); } - case CarbonMonoxideConcentrationMeasurement::Attributes::FeatureMap::Id: { + case Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case CarbonMonoxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16355,92 +17692,91 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case CarbonDioxideConcentrationMeasurement::Id: { + case FormaldehydeConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementUnitEnum value; + case FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::CarbonDioxideConcentrationMeasurement::MeasurementMediumEnum value; + case FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::CarbonDioxideConcentrationMeasurement::LevelValueEnum value; + case FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::FormaldehydeConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - CarbonDioxideConcentrationMeasurement::Id); + FormaldehydeConcentrationMeasurement::Id); } - case CarbonDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, - CarbonDioxideConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FormaldehydeConcentrationMeasurement::Id); } - case CarbonDioxideConcentrationMeasurement::Attributes::EventList::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, CarbonDioxideConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, FormaldehydeConcentrationMeasurement::Id); } - case CarbonDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case CarbonDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16448,92 +17784,90 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case NitrogenDioxideConcentrationMeasurement::Id: { + case Pm1ConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::Uncertainty::Id: { + case Pm1ConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementUnitEnum value; + case Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::MeasurementMediumEnum value; + case Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::NitrogenDioxideConcentrationMeasurement::LevelValueEnum value; + case Pm1ConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::Pm1ConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - NitrogenDioxideConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } - case NitrogenDioxideConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, - NitrogenDioxideConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); } - case NitrogenDioxideConcentrationMeasurement::Attributes::EventList::Id: { + case Pm1ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::AttributeList::Id: { + case Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, NitrogenDioxideConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm1ConcentrationMeasurement::Id); } - case NitrogenDioxideConcentrationMeasurement::Attributes::FeatureMap::Id: { + case Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case NitrogenDioxideConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16541,90 +17875,90 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case OzoneConcentrationMeasurement::Id: { + case Pm10ConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case OzoneConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case OzoneConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case OzoneConcentrationMeasurement::Attributes::Uncertainty::Id: { + case Pm10ConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case OzoneConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementUnitEnum value; + case Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case OzoneConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::OzoneConcentrationMeasurement::MeasurementMediumEnum value; + case Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case OzoneConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::OzoneConcentrationMeasurement::LevelValueEnum value; + case Pm10ConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::Pm10ConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case OzoneConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OzoneConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } - case OzoneConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OzoneConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); } - case OzoneConcentrationMeasurement::Attributes::EventList::Id: { + case Pm10ConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case OzoneConcentrationMeasurement::Attributes::AttributeList::Id: { + case Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, OzoneConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm10ConcentrationMeasurement::Id); } - case OzoneConcentrationMeasurement::Attributes::FeatureMap::Id: { + case Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case OzoneConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16632,90 +17966,93 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Pm25ConcentrationMeasurement::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::Uncertainty::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementUnitEnum value; + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::Pm25ConcentrationMeasurement::MeasurementMediumEnum value; + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::Pm25ConcentrationMeasurement::LevelValueEnum value; + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } - case Pm25ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm25ConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } - case Pm25ConcentrationMeasurement::Attributes::EventList::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::AttributeList::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm25ConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, + TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); } - case Pm25ConcentrationMeasurement::Attributes::FeatureMap::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Pm25ConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16723,91 +18060,90 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case FormaldehydeConcentrationMeasurement::Id: { + case RadonConcentrationMeasurement::Id: { switch (path.mAttributeId) { - case FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Id: { + case RadonConcentrationMeasurement::Attributes::MeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasuredValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { + case RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MinMeasuredValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { + case RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { + case RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { + case RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { + case RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::Uncertainty::Id: { + case RadonConcentrationMeasurement::Attributes::Uncertainty::Id: { float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Uncertainty", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementUnitEnum value; + case RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id: { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementUnitEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementUnit", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::FormaldehydeConcentrationMeasurement::MeasurementMediumEnum value; + case RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id: { + chip::app::Clusters::RadonConcentrationMeasurement::MeasurementMediumEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MeasurementMedium", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::FormaldehydeConcentrationMeasurement::LevelValueEnum value; + case RadonConcentrationMeasurement::Attributes::LevelValue::Id: { + chip::app::Clusters::RadonConcentrationMeasurement::LevelValueEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LevelValue", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - FormaldehydeConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RadonConcentrationMeasurement::Id); } - case FormaldehydeConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, FormaldehydeConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RadonConcentrationMeasurement::Id); } - case FormaldehydeConcentrationMeasurement::Attributes::EventList::Id: { + case RadonConcentrationMeasurement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::AttributeList::Id: { + case RadonConcentrationMeasurement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, FormaldehydeConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, RadonConcentrationMeasurement::Id); } - case FormaldehydeConcentrationMeasurement::Attributes::FeatureMap::Id: { + case RadonConcentrationMeasurement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case FormaldehydeConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case RadonConcentrationMeasurement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16815,90 +18151,111 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Pm1ConcentrationMeasurement::Id: { + case WiFiNetworkManagement::Id: { switch (path.mAttributeId) { - case Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case WiFiNetworkManagement::Attributes::Ssid::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("SSID", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case WiFiNetworkManagement::Attributes::PassphraseSurrogate::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("PassphraseSurrogate", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { - uint32_t value; + case WiFiNetworkManagement::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case WiFiNetworkManagement::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { + case WiFiNetworkManagement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::Uncertainty::Id: { - float value; + case WiFiNetworkManagement::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Uncertainty", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementUnitEnum value; + } + break; + } + case ThreadBorderRouterManagement::Id: { + switch (path.mAttributeId) + { + case ThreadBorderRouterManagement::Attributes::BorderRouterName::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementUnit", 1, value); + return DataModelLogger::LogValue("BorderRouterName", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::Pm1ConcentrationMeasurement::MeasurementMediumEnum value; + case ThreadBorderRouterManagement::Attributes::BorderAgentID::Id: { + chip::ByteSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementMedium", 1, value); + return DataModelLogger::LogValue("BorderAgentID", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::Pm1ConcentrationMeasurement::LevelValueEnum value; + case ThreadBorderRouterManagement::Attributes::ThreadVersion::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LevelValue", 1, value); + return DataModelLogger::LogValue("ThreadVersion", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case ThreadBorderRouterManagement::Attributes::InterfaceEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InterfaceEnabled", 1, value); + } + case ThreadBorderRouterManagement::Attributes::ActiveDatasetTimestamp::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveDatasetTimestamp", 1, value); + } + case ThreadBorderRouterManagement::Attributes::PendingDatasetTimestamp::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("PendingDatasetTimestamp", 1, value); + } + case ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadBorderRouterManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm1ConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadBorderRouterManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::EventList::Id: { + case ThreadBorderRouterManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::AttributeList::Id: { + case ThreadBorderRouterManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm1ConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadBorderRouterManagement::Id); } - case Pm1ConcentrationMeasurement::Attributes::FeatureMap::Id: { + case ThreadBorderRouterManagement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Pm1ConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case ThreadBorderRouterManagement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16906,90 +18263,98 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Pm10ConcentrationMeasurement::Id: { + case ThreadNetworkDirectory::Id: { switch (path.mAttributeId) { - case Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case ThreadNetworkDirectory::Attributes::PreferredExtendedPanID::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("PreferredExtendedPanID", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case ThreadNetworkDirectory::Attributes::ThreadNetworks::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::ThreadNetworkDirectory::Structs::ThreadNetworkStruct::DecodableType> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("ThreadNetworks", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case ThreadNetworkDirectory::Attributes::ThreadNetworkTableSize::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogValue("ThreadNetworkTableSize", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDirectory::Id); } - case Pm10ConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { - uint32_t value; + case ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDirectory::Id); } - case Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case ThreadNetworkDirectory::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { - uint32_t value; + case ThreadNetworkDirectory::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDirectory::Id); } - case Pm10ConcentrationMeasurement::Attributes::Uncertainty::Id: { - float value; + case ThreadNetworkDirectory::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Uncertainty", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementUnitEnum value; + case ThreadNetworkDirectory::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementUnit", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::Pm10ConcentrationMeasurement::MeasurementMediumEnum value; + } + break; + } + case WakeOnLan::Id: { + switch (path.mAttributeId) + { + case WakeOnLan::Attributes::MACAddress::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementMedium", 1, value); + return DataModelLogger::LogValue("MACAddress", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::Pm10ConcentrationMeasurement::LevelValueEnum value; + case WakeOnLan::Attributes::LinkLocalAddress::Id: { + chip::ByteSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LevelValue", 1, value); + return DataModelLogger::LogValue("LinkLocalAddress", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case WakeOnLan::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WakeOnLan::Id); } - case Pm10ConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case WakeOnLan::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Pm10ConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WakeOnLan::Id); } - case Pm10ConcentrationMeasurement::Attributes::EventList::Id: { + case WakeOnLan::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::AttributeList::Id: { + case WakeOnLan::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, Pm10ConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WakeOnLan::Id); } - case Pm10ConcentrationMeasurement::Attributes::FeatureMap::Id: { + case WakeOnLan::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Pm10ConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case WakeOnLan::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -16997,93 +18362,97 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Id: { + case Channel::Id: { switch (path.mAttributeId) { - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case Channel::Attributes::ChannelList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("ChannelList", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case Channel::Attributes::Lineup::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("Lineup", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case Channel::Attributes::CurrentChannel::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogValue("CurrentChannel", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case Channel::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Channel::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { - uint32_t value; + case Channel::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Channel::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case Channel::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); + return DataModelLogger::LogValue("EventList", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { - uint32_t value; + case Channel::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Channel::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::Uncertainty::Id: { - float value; + case Channel::Attributes::FeatureMap::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Uncertainty", 1, value); + return DataModelLogger::LogValue("FeatureMap", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementUnitEnum value; + case Channel::Attributes::ClusterRevision::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementUnit", 1, value); + return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::MeasurementMediumEnum value; + } + break; + } + case TargetNavigator::Id: { + switch (path.mAttributeId) + { + case TargetNavigator::Attributes::TargetList::Id: { + chip::app::DataModel::DecodableList + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementMedium", 1, value); + return DataModelLogger::LogValue("TargetList", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement::LevelValueEnum value; + case TargetNavigator::Attributes::CurrentTarget::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LevelValue", 1, value); + return DataModelLogger::LogValue("CurrentTarget", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case TargetNavigator::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, - TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TargetNavigator::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case TargetNavigator::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, - TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TargetNavigator::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::EventList::Id: { + case TargetNavigator::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::AttributeList::Id: { + case TargetNavigator::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, - TotalVolatileOrganicCompoundsConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, TargetNavigator::Id); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::FeatureMap::Id: { + case TargetNavigator::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case TargetNavigator::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17091,90 +18460,95 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case RadonConcentrationMeasurement::Id: { + case MediaPlayback::Id: { switch (path.mAttributeId) { - case RadonConcentrationMeasurement::Attributes::MeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case MediaPlayback::Attributes::CurrentState::Id: { + chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasuredValue", 1, value); + return DataModelLogger::LogValue("CurrentState", 1, value); } - case RadonConcentrationMeasurement::Attributes::MinMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case MediaPlayback::Attributes::StartTime::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MinMeasuredValue", 1, value); + return DataModelLogger::LogValue("StartTime", 1, value); } - case RadonConcentrationMeasurement::Attributes::MaxMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case MediaPlayback::Attributes::Duration::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MaxMeasuredValue", 1, value); + return DataModelLogger::LogValue("Duration", 1, value); } - case RadonConcentrationMeasurement::Attributes::PeakMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case MediaPlayback::Attributes::SampledPosition::Id: { + chip::app::DataModel::Nullable + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValue", 1, value); + return DataModelLogger::LogValue("SampledPosition", 1, value); } - case RadonConcentrationMeasurement::Attributes::PeakMeasuredValueWindow::Id: { - uint32_t value; + case MediaPlayback::Attributes::PlaybackSpeed::Id: { + float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PeakMeasuredValueWindow", 1, value); + return DataModelLogger::LogValue("PlaybackSpeed", 1, value); } - case RadonConcentrationMeasurement::Attributes::AverageMeasuredValue::Id: { - chip::app::DataModel::Nullable value; + case MediaPlayback::Attributes::SeekRangeEnd::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValue", 1, value); + return DataModelLogger::LogValue("SeekRangeEnd", 1, value); } - case RadonConcentrationMeasurement::Attributes::AverageMeasuredValueWindow::Id: { - uint32_t value; + case MediaPlayback::Attributes::SeekRangeStart::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AverageMeasuredValueWindow", 1, value); + return DataModelLogger::LogValue("SeekRangeStart", 1, value); } - case RadonConcentrationMeasurement::Attributes::Uncertainty::Id: { - float value; + case MediaPlayback::Attributes::ActiveAudioTrack::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Uncertainty", 1, value); + return DataModelLogger::LogValue("ActiveAudioTrack", 1, value); } - case RadonConcentrationMeasurement::Attributes::MeasurementUnit::Id: { - chip::app::Clusters::RadonConcentrationMeasurement::MeasurementUnitEnum value; + case MediaPlayback::Attributes::AvailableAudioTracks::Id: { + chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementUnit", 1, value); + return DataModelLogger::LogValue("AvailableAudioTracks", 1, value); } - case RadonConcentrationMeasurement::Attributes::MeasurementMedium::Id: { - chip::app::Clusters::RadonConcentrationMeasurement::MeasurementMediumEnum value; + case MediaPlayback::Attributes::ActiveTextTrack::Id: { + chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MeasurementMedium", 1, value); + return DataModelLogger::LogValue("ActiveTextTrack", 1, value); } - case RadonConcentrationMeasurement::Attributes::LevelValue::Id: { - chip::app::Clusters::RadonConcentrationMeasurement::LevelValueEnum value; + case MediaPlayback::Attributes::AvailableTextTracks::Id: { + chip::app::DataModel::Nullable< + chip::app::DataModel::DecodableList> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LevelValue", 1, value); + return DataModelLogger::LogValue("AvailableTextTracks", 1, value); } - case RadonConcentrationMeasurement::Attributes::GeneratedCommandList::Id: { + case MediaPlayback::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, RadonConcentrationMeasurement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaPlayback::Id); } - case RadonConcentrationMeasurement::Attributes::AcceptedCommandList::Id: { + case MediaPlayback::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, RadonConcentrationMeasurement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaPlayback::Id); } - case RadonConcentrationMeasurement::Attributes::EventList::Id: { + case MediaPlayback::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case RadonConcentrationMeasurement::Attributes::AttributeList::Id: { + case MediaPlayback::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, RadonConcentrationMeasurement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaPlayback::Id); } - case RadonConcentrationMeasurement::Attributes::FeatureMap::Id: { + case MediaPlayback::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case RadonConcentrationMeasurement::Attributes::ClusterRevision::Id: { + case MediaPlayback::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17182,45 +18556,45 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case WiFiNetworkManagement::Id: { + case MediaInput::Id: { switch (path.mAttributeId) { - case WiFiNetworkManagement::Attributes::Ssid::Id: { - chip::app::DataModel::Nullable value; + case MediaInput::Attributes::InputList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SSID", 1, value); + return DataModelLogger::LogValue("InputList", 1, value); } - case WiFiNetworkManagement::Attributes::PassphraseSurrogate::Id: { - chip::app::DataModel::Nullable value; + case MediaInput::Attributes::CurrentInput::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PassphraseSurrogate", 1, value); + return DataModelLogger::LogValue("CurrentInput", 1, value); } - case WiFiNetworkManagement::Attributes::GeneratedCommandList::Id: { + case MediaInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WiFiNetworkManagement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaInput::Id); } - case WiFiNetworkManagement::Attributes::AcceptedCommandList::Id: { + case MediaInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WiFiNetworkManagement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaInput::Id); } - case WiFiNetworkManagement::Attributes::EventList::Id: { + case MediaInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case WiFiNetworkManagement::Attributes::AttributeList::Id: { + case MediaInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, WiFiNetworkManagement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaInput::Id); } - case WiFiNetworkManagement::Attributes::FeatureMap::Id: { + case MediaInput::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case WiFiNetworkManagement::Attributes::ClusterRevision::Id: { + case MediaInput::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17228,65 +18602,35 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ThreadBorderRouterManagement::Id: { + case LowPower::Id: { switch (path.mAttributeId) { - case ThreadBorderRouterManagement::Attributes::BorderRouterName::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("BorderRouterName", 1, value); - } - case ThreadBorderRouterManagement::Attributes::BorderAgentID::Id: { - chip::ByteSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("BorderAgentID", 1, value); - } - case ThreadBorderRouterManagement::Attributes::ThreadVersion::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThreadVersion", 1, value); - } - case ThreadBorderRouterManagement::Attributes::InterfaceEnabled::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InterfaceEnabled", 1, value); - } - case ThreadBorderRouterManagement::Attributes::ActiveDatasetTimestamp::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveDatasetTimestamp", 1, value); - } - case ThreadBorderRouterManagement::Attributes::PendingDatasetTimestamp::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PendingDatasetTimestamp", 1, value); - } - case ThreadBorderRouterManagement::Attributes::GeneratedCommandList::Id: { + case LowPower::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadBorderRouterManagement::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LowPower::Id); } - case ThreadBorderRouterManagement::Attributes::AcceptedCommandList::Id: { + case LowPower::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadBorderRouterManagement::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LowPower::Id); } - case ThreadBorderRouterManagement::Attributes::EventList::Id: { + case LowPower::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ThreadBorderRouterManagement::Attributes::AttributeList::Id: { + case LowPower::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadBorderRouterManagement::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, LowPower::Id); } - case ThreadBorderRouterManagement::Attributes::FeatureMap::Id: { + case LowPower::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ThreadBorderRouterManagement::Attributes::ClusterRevision::Id: { + case LowPower::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17294,52 +18638,35 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ThreadNetworkDirectory::Id: { + case KeypadInput::Id: { switch (path.mAttributeId) { - case ThreadNetworkDirectory::Attributes::PreferredExtendedPanID::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PreferredExtendedPanID", 1, value); - } - case ThreadNetworkDirectory::Attributes::ThreadNetworks::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::ThreadNetworkDirectory::Structs::ThreadNetworkStruct::DecodableType> - value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThreadNetworks", 1, value); - } - case ThreadNetworkDirectory::Attributes::ThreadNetworkTableSize::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ThreadNetworkTableSize", 1, value); - } - case ThreadNetworkDirectory::Attributes::GeneratedCommandList::Id: { + case KeypadInput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ThreadNetworkDirectory::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, KeypadInput::Id); } - case ThreadNetworkDirectory::Attributes::AcceptedCommandList::Id: { + case KeypadInput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ThreadNetworkDirectory::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, KeypadInput::Id); } - case ThreadNetworkDirectory::Attributes::EventList::Id: { + case KeypadInput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ThreadNetworkDirectory::Attributes::AttributeList::Id: { + case KeypadInput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ThreadNetworkDirectory::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, KeypadInput::Id); } - case ThreadNetworkDirectory::Attributes::FeatureMap::Id: { + case KeypadInput::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ThreadNetworkDirectory::Attributes::ClusterRevision::Id: { + case KeypadInput::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17347,45 +18674,45 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case WakeOnLan::Id: { + case ContentLauncher::Id: { switch (path.mAttributeId) { - case WakeOnLan::Attributes::MACAddress::Id: { - chip::CharSpan value; + case ContentLauncher::Attributes::AcceptHeader::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("MACAddress", 1, value); + return DataModelLogger::LogValue("AcceptHeader", 1, value); } - case WakeOnLan::Attributes::LinkLocalAddress::Id: { - chip::ByteSpan value; + case ContentLauncher::Attributes::SupportedStreamingProtocols::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("LinkLocalAddress", 1, value); + return DataModelLogger::LogValue("SupportedStreamingProtocols", 1, value); } - case WakeOnLan::Attributes::GeneratedCommandList::Id: { + case ContentLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WakeOnLan::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentLauncher::Id); } - case WakeOnLan::Attributes::AcceptedCommandList::Id: { + case ContentLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WakeOnLan::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentLauncher::Id); } - case WakeOnLan::Attributes::EventList::Id: { + case ContentLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case WakeOnLan::Attributes::AttributeList::Id: { + case ContentLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, WakeOnLan::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentLauncher::Id); } - case WakeOnLan::Attributes::FeatureMap::Id: { + case ContentLauncher::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case WakeOnLan::Attributes::ClusterRevision::Id: { + case ContentLauncher::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17393,50 +18720,45 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Channel::Id: { + case AudioOutput::Id: { switch (path.mAttributeId) { - case Channel::Attributes::ChannelList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ChannelList", 1, value); - } - case Channel::Attributes::Lineup::Id: { - chip::app::DataModel::Nullable value; + case AudioOutput::Attributes::OutputList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Lineup", 1, value); + return DataModelLogger::LogValue("OutputList", 1, value); } - case Channel::Attributes::CurrentChannel::Id: { - chip::app::DataModel::Nullable value; + case AudioOutput::Attributes::CurrentOutput::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentChannel", 1, value); + return DataModelLogger::LogValue("CurrentOutput", 1, value); } - case Channel::Attributes::GeneratedCommandList::Id: { + case AudioOutput::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Channel::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AudioOutput::Id); } - case Channel::Attributes::AcceptedCommandList::Id: { + case AudioOutput::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Channel::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AudioOutput::Id); } - case Channel::Attributes::EventList::Id: { + case AudioOutput::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Channel::Attributes::AttributeList::Id: { + case AudioOutput::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, Channel::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AudioOutput::Id); } - case Channel::Attributes::FeatureMap::Id: { + case AudioOutput::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Channel::Attributes::ClusterRevision::Id: { + case AudioOutput::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17444,46 +18766,46 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case TargetNavigator::Id: { + case ApplicationLauncher::Id: { switch (path.mAttributeId) { - case TargetNavigator::Attributes::TargetList::Id: { - chip::app::DataModel::DecodableList - value; + case ApplicationLauncher::Attributes::CatalogList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("TargetList", 1, value); + return DataModelLogger::LogValue("CatalogList", 1, value); } - case TargetNavigator::Attributes::CurrentTarget::Id: { - uint8_t value; + case ApplicationLauncher::Attributes::CurrentApp::Id: { + chip::app::DataModel::Nullable + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentTarget", 1, value); + return DataModelLogger::LogValue("CurrentApp", 1, value); } - case TargetNavigator::Attributes::GeneratedCommandList::Id: { + case ApplicationLauncher::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, TargetNavigator::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationLauncher::Id); } - case TargetNavigator::Attributes::AcceptedCommandList::Id: { + case ApplicationLauncher::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, TargetNavigator::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationLauncher::Id); } - case TargetNavigator::Attributes::EventList::Id: { + case ApplicationLauncher::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case TargetNavigator::Attributes::AttributeList::Id: { + case ApplicationLauncher::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, TargetNavigator::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationLauncher::Id); } - case TargetNavigator::Attributes::FeatureMap::Id: { + case ApplicationLauncher::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case TargetNavigator::Attributes::ClusterRevision::Id: { + case ApplicationLauncher::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17491,95 +18813,75 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case MediaPlayback::Id: { + case ApplicationBasic::Id: { switch (path.mAttributeId) { - case MediaPlayback::Attributes::CurrentState::Id: { - chip::app::Clusters::MediaPlayback::PlaybackStateEnum value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentState", 1, value); - } - case MediaPlayback::Attributes::StartTime::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartTime", 1, value); - } - case MediaPlayback::Attributes::Duration::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Duration", 1, value); - } - case MediaPlayback::Attributes::SampledPosition::Id: { - chip::app::DataModel::Nullable - value; + case ApplicationBasic::Attributes::VendorName::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SampledPosition", 1, value); + return DataModelLogger::LogValue("VendorName", 1, value); } - case MediaPlayback::Attributes::PlaybackSpeed::Id: { - float value; + case ApplicationBasic::Attributes::VendorID::Id: { + chip::VendorId value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PlaybackSpeed", 1, value); + return DataModelLogger::LogValue("VendorID", 1, value); } - case MediaPlayback::Attributes::SeekRangeEnd::Id: { - chip::app::DataModel::Nullable value; + case ApplicationBasic::Attributes::ApplicationName::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SeekRangeEnd", 1, value); + return DataModelLogger::LogValue("ApplicationName", 1, value); } - case MediaPlayback::Attributes::SeekRangeStart::Id: { - chip::app::DataModel::Nullable value; + case ApplicationBasic::Attributes::ProductID::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SeekRangeStart", 1, value); + return DataModelLogger::LogValue("ProductID", 1, value); } - case MediaPlayback::Attributes::ActiveAudioTrack::Id: { - chip::app::DataModel::Nullable value; + case ApplicationBasic::Attributes::Application::Id: { + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveAudioTrack", 1, value); + return DataModelLogger::LogValue("Application", 1, value); } - case MediaPlayback::Attributes::AvailableAudioTracks::Id: { - chip::app::DataModel::Nullable< - chip::app::DataModel::DecodableList> - value; + case ApplicationBasic::Attributes::Status::Id: { + chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AvailableAudioTracks", 1, value); + return DataModelLogger::LogValue("Status", 1, value); } - case MediaPlayback::Attributes::ActiveTextTrack::Id: { - chip::app::DataModel::Nullable value; + case ApplicationBasic::Attributes::ApplicationVersion::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveTextTrack", 1, value); + return DataModelLogger::LogValue("ApplicationVersion", 1, value); } - case MediaPlayback::Attributes::AvailableTextTracks::Id: { - chip::app::DataModel::Nullable< - chip::app::DataModel::DecodableList> - value; + case ApplicationBasic::Attributes::AllowedVendorList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AvailableTextTracks", 1, value); + return DataModelLogger::LogValue("AllowedVendorList", 1, value); } - case MediaPlayback::Attributes::GeneratedCommandList::Id: { + case ApplicationBasic::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaPlayback::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationBasic::Id); } - case MediaPlayback::Attributes::AcceptedCommandList::Id: { + case ApplicationBasic::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaPlayback::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationBasic::Id); } - case MediaPlayback::Attributes::EventList::Id: { + case ApplicationBasic::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case MediaPlayback::Attributes::AttributeList::Id: { + case ApplicationBasic::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaPlayback::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationBasic::Id); } - case MediaPlayback::Attributes::FeatureMap::Id: { + case ApplicationBasic::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case MediaPlayback::Attributes::ClusterRevision::Id: { + case ApplicationBasic::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17587,45 +18889,35 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case MediaInput::Id: { + case AccountLogin::Id: { switch (path.mAttributeId) { - case MediaInput::Attributes::InputList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("InputList", 1, value); - } - case MediaInput::Attributes::CurrentInput::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentInput", 1, value); - } - case MediaInput::Attributes::GeneratedCommandList::Id: { + case AccountLogin::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, MediaInput::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccountLogin::Id); } - case MediaInput::Attributes::AcceptedCommandList::Id: { + case AccountLogin::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, MediaInput::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccountLogin::Id); } - case MediaInput::Attributes::EventList::Id: { + case AccountLogin::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case MediaInput::Attributes::AttributeList::Id: { + case AccountLogin::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, MediaInput::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccountLogin::Id); } - case MediaInput::Attributes::FeatureMap::Id: { + case AccountLogin::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case MediaInput::Attributes::ClusterRevision::Id: { + case AccountLogin::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17633,71 +18925,77 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case LowPower::Id: { + case ContentControl::Id: { switch (path.mAttributeId) { - case LowPower::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ContentControl::Attributes::Enabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, LowPower::Id); + return DataModelLogger::LogValue("Enabled", 1, value); } - case LowPower::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case ContentControl::Attributes::OnDemandRatings::Id: { + chip::app::DataModel::DecodableList + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, LowPower::Id); + return DataModelLogger::LogValue("OnDemandRatings", 1, value); } - case LowPower::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case ContentControl::Attributes::OnDemandRatingThreshold::Id: { + chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("OnDemandRatingThreshold", 1, value); } - case LowPower::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case ContentControl::Attributes::ScheduledContentRatings::Id: { + chip::app::DataModel::DecodableList + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, LowPower::Id); + return DataModelLogger::LogValue("ScheduledContentRatings", 1, value); } - case LowPower::Attributes::FeatureMap::Id: { + case ContentControl::Attributes::ScheduledContentRatingThreshold::Id: { + chip::CharSpan value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ScheduledContentRatingThreshold", 1, value); + } + case ContentControl::Attributes::ScreenDailyTime::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("ScreenDailyTime", 1, value); } - case LowPower::Attributes::ClusterRevision::Id: { - uint16_t value; + case ContentControl::Attributes::RemainingScreenTime::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("RemainingScreenTime", 1, value); } + case ContentControl::Attributes::BlockUnrated::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("BlockUnrated", 1, value); } - break; - } - case KeypadInput::Id: { - switch (path.mAttributeId) - { - case KeypadInput::Attributes::GeneratedCommandList::Id: { + case ContentControl::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, KeypadInput::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentControl::Id); } - case KeypadInput::Attributes::AcceptedCommandList::Id: { + case ContentControl::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, KeypadInput::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentControl::Id); } - case KeypadInput::Attributes::EventList::Id: { + case ContentControl::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case KeypadInput::Attributes::AttributeList::Id: { + case ContentControl::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, KeypadInput::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentControl::Id); } - case KeypadInput::Attributes::FeatureMap::Id: { + case ContentControl::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case KeypadInput::Attributes::ClusterRevision::Id: { + case ContentControl::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17705,45 +19003,35 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ContentLauncher::Id: { + case ContentAppObserver::Id: { switch (path.mAttributeId) { - case ContentLauncher::Attributes::AcceptHeader::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AcceptHeader", 1, value); - } - case ContentLauncher::Attributes::SupportedStreamingProtocols::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SupportedStreamingProtocols", 1, value); - } - case ContentLauncher::Attributes::GeneratedCommandList::Id: { + case ContentAppObserver::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentLauncher::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentAppObserver::Id); } - case ContentLauncher::Attributes::AcceptedCommandList::Id: { + case ContentAppObserver::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentLauncher::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentAppObserver::Id); } - case ContentLauncher::Attributes::EventList::Id: { + case ContentAppObserver::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ContentLauncher::Attributes::AttributeList::Id: { + case ContentAppObserver::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentLauncher::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentAppObserver::Id); } - case ContentLauncher::Attributes::FeatureMap::Id: { + case ContentAppObserver::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ContentLauncher::Attributes::ClusterRevision::Id: { + case ContentAppObserver::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17751,45 +19039,58 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case AudioOutput::Id: { + case ZoneManagement::Id: { switch (path.mAttributeId) { - case AudioOutput::Attributes::OutputList::Id: { - chip::app::DataModel::DecodableList value; + case ZoneManagement::Attributes::SupportedZoneSources::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OutputList", 1, value); + return DataModelLogger::LogValue("SupportedZoneSources", 1, value); } - case AudioOutput::Attributes::CurrentOutput::Id: { + case ZoneManagement::Attributes::Zones::Id: { + chip::app::DataModel::DecodableList + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Zones", 1, value); + } + case ZoneManagement::Attributes::TimeControl::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("TimeControl", 1, value); + } + case ZoneManagement::Attributes::Sensitivity::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentOutput", 1, value); + return DataModelLogger::LogValue("Sensitivity", 1, value); } - case AudioOutput::Attributes::GeneratedCommandList::Id: { + case ZoneManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AudioOutput::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ZoneManagement::Id); } - case AudioOutput::Attributes::AcceptedCommandList::Id: { + case ZoneManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AudioOutput::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ZoneManagement::Id); } - case AudioOutput::Attributes::EventList::Id: { + case ZoneManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case AudioOutput::Attributes::AttributeList::Id: { + case ZoneManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, AudioOutput::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, ZoneManagement::Id); } - case AudioOutput::Attributes::FeatureMap::Id: { + case ZoneManagement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case AudioOutput::Attributes::ClusterRevision::Id: { + case ZoneManagement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -17797,236 +19098,280 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ApplicationLauncher::Id: { + case CameraAvStreamManagement::Id: { switch (path.mAttributeId) { - case ApplicationLauncher::Attributes::CatalogList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxConcurrentVideoEncoders", 1, value); + } + case CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MaxEncodedPixelRate", 1, value); + } + case CameraAvStreamManagement::Attributes::VideoSensorParams::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoSensorParams", 1, value); + } + case CameraAvStreamManagement::Attributes::NightVisionCapable::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CatalogList", 1, value); + return DataModelLogger::LogValue("NightVisionCapable", 1, value); } - case ApplicationLauncher::Attributes::CurrentApp::Id: { - chip::app::DataModel::Nullable + case CameraAvStreamManagement::Attributes::MinViewport::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MinViewport", 1, value); + } + case CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentApp", 1, value); + return DataModelLogger::LogValue("RateDistortionTradeOffPoints", 1, value); } - case ApplicationLauncher::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationLauncher::Id); + return DataModelLogger::LogValue("MaxPreRollBufferSize", 1, value); } - case ApplicationLauncher::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationLauncher::Id); + return DataModelLogger::LogValue("MicrophoneCapabilities", 1, value); } - case ApplicationLauncher::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("SpeakerCapabilities", 1, value); } - case ApplicationLauncher::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id: { + chip::app::Clusters::CameraAvStreamManagement::TwoWayTalkSupportTypeEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationLauncher::Id); + return DataModelLogger::LogValue("TwoWayTalkSupport", 1, value); } - case ApplicationLauncher::Attributes::FeatureMap::Id: { + case CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SupportedSnapshotParams", 1, value); + } + case CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("MaxNetworkBandwidth", 1, value); } - case ApplicationLauncher::Attributes::ClusterRevision::Id: { + case CameraAvStreamManagement::Attributes::CurrentFrameRate::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("CurrentFrameRate", 1, value); } + case CameraAvStreamManagement::Attributes::HDRModeEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("HDRModeEnabled", 1, value); } - break; - } - case ApplicationBasic::Id: { - switch (path.mAttributeId) - { - case ApplicationBasic::Attributes::VendorName::Id: { - chip::CharSpan value; + case CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("VendorName", 1, value); + return DataModelLogger::LogValue("CurrentVideoCodecs", 1, value); } - case ApplicationBasic::Attributes::VendorID::Id: { - chip::VendorId value; + case CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("VendorID", 1, value); + return DataModelLogger::LogValue("CurrentSnapshotConfig", 1, value); } - case ApplicationBasic::Attributes::ApplicationName::Id: { - chip::CharSpan value; + case CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ApplicationName", 1, value); + return DataModelLogger::LogValue("FabricsUsingCamera", 1, value); } - case ApplicationBasic::Attributes::ProductID::Id: { - uint16_t value; + case CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ProductID", 1, value); + return DataModelLogger::LogValue("AllocatedVideoStreams", 1, value); } - case ApplicationBasic::Attributes::Application::Id: { - chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; + case CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Application", 1, value); + return DataModelLogger::LogValue("AllocatedAudioStreams", 1, value); } - case ApplicationBasic::Attributes::Status::Id: { - chip::app::Clusters::ApplicationBasic::ApplicationStatusEnum value; + case CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType> + value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Status", 1, value); + return DataModelLogger::LogValue("AllocatedSnapshotStreams", 1, value); } - case ApplicationBasic::Attributes::ApplicationVersion::Id: { - chip::CharSpan value; + case CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ApplicationVersion", 1, value); + return DataModelLogger::LogValue("RankedVideoStreamPrioritiesList", 1, value); } - case ApplicationBasic::Attributes::AllowedVendorList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("AllowedVendorList", 1, value); + return DataModelLogger::LogValue("SoftRecordingPrivacyModeEnabled", 1, value); } - case ApplicationBasic::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ApplicationBasic::Id); + return DataModelLogger::LogValue("SoftLivestreamPrivacyModeEnabled", 1, value); } - case ApplicationBasic::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::HardPrivacyModeOn::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ApplicationBasic::Id); + return DataModelLogger::LogValue("HardPrivacyModeOn", 1, value); } - case ApplicationBasic::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::NightVision::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("NightVision", 1, value); } - case ApplicationBasic::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::NightVisionIllum::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ApplicationBasic::Id); + return DataModelLogger::LogValue("NightVisionIllum", 1, value); } - case ApplicationBasic::Attributes::FeatureMap::Id: { - uint32_t value; + case CameraAvStreamManagement::Attributes::AWBEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("AWBEnabled", 1, value); } - case ApplicationBasic::Attributes::ClusterRevision::Id: { - uint16_t value; + case CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("AutoShutterSpeedEnabled", 1, value); } + case CameraAvStreamManagement::Attributes::AutoISOEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AutoISOEnabled", 1, value); } - break; - } - case AccountLogin::Id: { - switch (path.mAttributeId) - { - case AccountLogin::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::Viewport::Id: { + chip::app::Clusters::CameraAvStreamManagement::Structs::ViewportStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, AccountLogin::Id); + return DataModelLogger::LogValue("Viewport", 1, value); } - case AccountLogin::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SpeakerMuted::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, AccountLogin::Id); + return DataModelLogger::LogValue("SpeakerMuted", 1, value); } - case AccountLogin::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); + return DataModelLogger::LogValue("SpeakerVolumeLevel", 1, value); } - case AccountLogin::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; + case CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, AccountLogin::Id); + return DataModelLogger::LogValue("SpeakerMaxLevel", 1, value); } - case AccountLogin::Attributes::FeatureMap::Id: { - uint32_t value; + case CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); + return DataModelLogger::LogValue("SpeakerMinLevel", 1, value); } - case AccountLogin::Attributes::ClusterRevision::Id: { - uint16_t value; + case CameraAvStreamManagement::Attributes::MicrophoneMuted::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); + return DataModelLogger::LogValue("MicrophoneMuted", 1, value); } + case CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("MicrophoneVolumeLevel", 1, value); } - break; - } - case ContentControl::Id: { - switch (path.mAttributeId) - { - case ContentControl::Attributes::Enabled::Id: { - bool value; + case CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("Enabled", 1, value); + return DataModelLogger::LogValue("MicrophoneMaxLevel", 1, value); } - case ContentControl::Attributes::OnDemandRatings::Id: { - chip::app::DataModel::DecodableList - value; + case CameraAvStreamManagement::Attributes::MicrophoneMinLevel::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnDemandRatings", 1, value); + return DataModelLogger::LogValue("MicrophoneMinLevel", 1, value); } - case ContentControl::Attributes::OnDemandRatingThreshold::Id: { - chip::CharSpan value; + case CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnDemandRatingThreshold", 1, value); + return DataModelLogger::LogValue("MicrophoneAGCEnabled", 1, value); } - case ContentControl::Attributes::ScheduledContentRatings::Id: { - chip::app::DataModel::DecodableList - value; + case CameraAvStreamManagement::Attributes::ImageRotation::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScheduledContentRatings", 1, value); + return DataModelLogger::LogValue("ImageRotation", 1, value); } - case ContentControl::Attributes::ScheduledContentRatingThreshold::Id: { - chip::CharSpan value; + case CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScheduledContentRatingThreshold", 1, value); + return DataModelLogger::LogValue("ImageFlipHorizontal", 1, value); } - case ContentControl::Attributes::ScreenDailyTime::Id: { - uint32_t value; + case CameraAvStreamManagement::Attributes::ImageFlipVertical::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ScreenDailyTime", 1, value); + return DataModelLogger::LogValue("ImageFlipVertical", 1, value); } - case ContentControl::Attributes::RemainingScreenTime::Id: { - uint32_t value; + case CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("RemainingScreenTime", 1, value); + return DataModelLogger::LogValue("LocalVideoRecordingEnabled", 1, value); } - case ContentControl::Attributes::BlockUnrated::Id: { + case CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id: { bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("BlockUnrated", 1, value); + return DataModelLogger::LogValue("LocalSnapshotRecordingEnabled", 1, value); } - case ContentControl::Attributes::GeneratedCommandList::Id: { + case CameraAvStreamManagement::Attributes::StatusLightEnabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StatusLightEnabled", 1, value); + } + case CameraAvStreamManagement::Attributes::StatusLightBrightness::Id: { + chip::app::Clusters::Globals::ThreeLevelAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("StatusLightBrightness", 1, value); + } + case CameraAvStreamManagement::Attributes::DepthSensorStatus::Id: { + chip::app::Clusters::CameraAvStreamManagement::TriStateAutoEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DepthSensorStatus", 1, value); + } + case CameraAvStreamManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentControl::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, CameraAvStreamManagement::Id); } - case ContentControl::Attributes::AcceptedCommandList::Id: { + case CameraAvStreamManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentControl::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, CameraAvStreamManagement::Id); } - case ContentControl::Attributes::EventList::Id: { + case CameraAvStreamManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ContentControl::Attributes::AttributeList::Id: { + case CameraAvStreamManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentControl::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, CameraAvStreamManagement::Id); } - case ContentControl::Attributes::FeatureMap::Id: { + case CameraAvStreamManagement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ContentControl::Attributes::ClusterRevision::Id: { + case CameraAvStreamManagement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -18034,35 +19379,42 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ContentAppObserver::Id: { + case WebRTCTransportProvider::Id: { switch (path.mAttributeId) { - case ContentAppObserver::Attributes::GeneratedCommandList::Id: { + case WebRTCTransportProvider::Attributes::CurrentSessions::Id: { + chip::app::DataModel::DecodableList< + chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType> + value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CurrentSessions", 1, value); + } + case WebRTCTransportProvider::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ContentAppObserver::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WebRTCTransportProvider::Id); } - case ContentAppObserver::Attributes::AcceptedCommandList::Id: { + case WebRTCTransportProvider::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ContentAppObserver::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WebRTCTransportProvider::Id); } - case ContentAppObserver::Attributes::EventList::Id: { + case WebRTCTransportProvider::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case ContentAppObserver::Attributes::AttributeList::Id: { + case WebRTCTransportProvider::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ContentAppObserver::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WebRTCTransportProvider::Id); } - case ContentAppObserver::Attributes::FeatureMap::Id: { + case WebRTCTransportProvider::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case ContentAppObserver::Attributes::ClusterRevision::Id: { + case WebRTCTransportProvider::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -18070,42 +19422,42 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case WebRTCTransportProvider::Id: { + case WebRTCTransportRequestor::Id: { switch (path.mAttributeId) { - case WebRTCTransportProvider::Attributes::CurrentSessions::Id: { + case WebRTCTransportRequestor::Attributes::CurrentSessions::Id: { chip::app::DataModel::DecodableList< - chip::app::Clusters::WebRTCTransportProvider::Structs::WebRTCSessionStruct::DecodableType> + chip::app::Clusters::WebRTCTransportRequestor::Structs::WebRTCSessionStruct::DecodableType> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentSessions", 1, value); } - case WebRTCTransportProvider::Attributes::GeneratedCommandList::Id: { + case WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WebRTCTransportProvider::Id); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, WebRTCTransportRequestor::Id); } - case WebRTCTransportProvider::Attributes::AcceptedCommandList::Id: { + case WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WebRTCTransportProvider::Id); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, WebRTCTransportRequestor::Id); } - case WebRTCTransportProvider::Attributes::EventList::Id: { + case WebRTCTransportRequestor::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case WebRTCTransportProvider::Attributes::AttributeList::Id: { + case WebRTCTransportRequestor::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, WebRTCTransportProvider::Id); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, WebRTCTransportRequestor::Id); } - case WebRTCTransportProvider::Attributes::FeatureMap::Id: { + case WebRTCTransportRequestor::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case WebRTCTransportProvider::Attributes::ClusterRevision::Id: { + case WebRTCTransportRequestor::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -19420,6 +20772,48 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case ZoneManagement::Id: { + switch (path.mCommandId) + { + case ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id: { + ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CreateTwoDCartesianZoneResponse", 1, value); + } + case ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id: { + ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GetTwoDCartesianZoneResponse", 1, value); + } + } + break; + } + case CameraAvStreamManagement::Id: { + switch (path.mCommandId) + { + case CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AudioStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id: { + CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SnapshotStreamAllocateResponse", 1, value); + } + case CameraAvStreamManagement::Commands::CaptureSnapshotResponse::Id: { + CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("CaptureSnapshotResponse", 1, value); + } + } + break; + } case WebRTCTransportProvider::Id: { switch (path.mCommandId) { @@ -20349,6 +21743,43 @@ CHIP_ERROR DataModelLogger::LogEvent(const chip::app::EventHeader & header, chip } break; } + case ZoneManagement::Id: { + switch (header.mPath.mEventId) + { + case ZoneManagement::Events::ZoneTriggered::Id: { + chip::app::Clusters::ZoneManagement::Events::ZoneTriggered::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ZoneTriggered", 1, value); + } + case ZoneManagement::Events::ZoneStopped::Id: { + chip::app::Clusters::ZoneManagement::Events::ZoneStopped::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ZoneStopped", 1, value); + } + } + break; + } + case CameraAvStreamManagement::Id: { + switch (header.mPath.mEventId) + { + case CameraAvStreamManagement::Events::VideoStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("VideoStreamChanged", 1, value); + } + case CameraAvStreamManagement::Events::AudioStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AudioStreamChanged", 1, value); + } + case CameraAvStreamManagement::Events::SnapshotStreamChanged::Id: { + chip::app::Clusters::CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("SnapshotStreamChanged", 1, value); + } + } + break; + } case CommissionerControl::Id: { switch (header.mPath.mEventId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 05432564bf..c9833ccb6c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -59,6 +59,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ViewportStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::WebRTCSessionStruct::DecodableType & value); @@ -410,6 +413,49 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianVertexStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::TwoDCartesianZoneStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneInformationStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Structs::ZoneTriggeringTimeControlStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoResolutionStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoStreamStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotStreamStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::SnapshotParamsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::RateDistortionTradeOffPointsStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioCapabilitiesStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::AudioStreamStruct::DecodableType & value); + +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Structs::VideoSensorParamsStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); @@ -681,6 +727,17 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AccountLogin::Events::LoggedOut::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Events::RemainingScreenTimeExpired::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Events::ZoneTriggered::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Events::ZoneStopped::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Events::VideoStreamChanged::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Events::AudioStreamChanged::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Events::SnapshotStreamChanged::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CommissionerControl::Events::CommissioningRequestResult::DecodableType & value); @@ -854,6 +911,24 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessageResponse::DecodableType & value); static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::DecodableType & value); +static CHIP_ERROR +LogValue(const char * label, size_t indent, + const chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::DecodableType & value); static CHIP_ERROR diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index f9e3e9d6e5..5aa0a783f8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -259,8 +259,14 @@ char const * ClusterIdToText(chip::ClusterId id) return "ContentControl"; case chip::app::Clusters::ContentAppObserver::Id: return "ContentAppObserver"; + case chip::app::Clusters::ZoneManagement::Id: + return "ZoneManagement"; + case chip::app::Clusters::CameraAvStreamManagement::Id: + return "CameraAvStreamManagement"; case chip::app::Clusters::WebRTCTransportProvider::Id: return "WebRTCTransportProvider"; + case chip::app::Clusters::WebRTCTransportRequestor::Id: + return "WebRTCTransportRequestor"; case chip::app::Clusters::Chime::Id: return "Chime"; case chip::app::Clusters::EcosystemInformation::Id: @@ -834,6 +840,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "TCAcknowledgements"; case chip::app::Clusters::GeneralCommissioning::Attributes::TCAcknowledgementsRequired::Id: return "TCAcknowledgementsRequired"; + case chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id: + return "TCUpdateDeadline"; case chip::app::Clusters::GeneralCommissioning::Attributes::GeneratedCommandList::Id: return "GeneratedCommandList"; case chip::app::Clusters::GeneralCommissioning::Attributes::AcceptedCommandList::Id: @@ -4379,6 +4387,146 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id: + return "SupportedZoneSources"; + case chip::app::Clusters::ZoneManagement::Attributes::Zones::Id: + return "Zones"; + case chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id: + return "TimeControl"; + case chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id: + return "Sensitivity"; + case chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::ZoneManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id: + return "MaxConcurrentVideoEncoders"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id: + return "MaxEncodedPixelRate"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::Id: + return "VideoSensorParams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::Id: + return "NightVisionCapable"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewport::Id: + return "MinViewport"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id: + return "RateDistortionTradeOffPoints"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id: + return "MaxPreRollBufferSize"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id: + return "MicrophoneCapabilities"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id: + return "SpeakerCapabilities"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id: + return "TwoWayTalkSupport"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id: + return "SupportedSnapshotParams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id: + return "MaxNetworkBandwidth"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::Id: + return "CurrentFrameRate"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRModeEnabled::Id: + return "HDRModeEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id: + return "CurrentVideoCodecs"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id: + return "CurrentSnapshotConfig"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id: + return "FabricsUsingCamera"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id: + return "AllocatedVideoStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id: + return "AllocatedAudioStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id: + return "AllocatedSnapshotStreams"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id: + return "RankedVideoStreamPrioritiesList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::Id: + return "SoftRecordingPrivacyModeEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::Id: + return "SoftLivestreamPrivacyModeEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyModeOn::Id: + return "HardPrivacyModeOn"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id: + return "NightVision"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id: + return "NightVisionIllum"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AWBEnabled::Id: + return "AWBEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::Id: + return "AutoShutterSpeedEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoISOEnabled::Id: + return "AutoISOEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::Id: + return "Viewport"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMuted::Id: + return "SpeakerMuted"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id: + return "SpeakerVolumeLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id: + return "SpeakerMaxLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id: + return "SpeakerMinLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMuted::Id: + return "MicrophoneMuted"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::Id: + return "MicrophoneVolumeLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::Id: + return "MicrophoneMaxLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMinLevel::Id: + return "MicrophoneMinLevel"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::Id: + return "MicrophoneAGCEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::Id: + return "ImageRotation"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id: + return "ImageFlipHorizontal"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::Id: + return "ImageFlipVertical"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id: + return "LocalVideoRecordingEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id: + return "LocalSnapshotRecordingEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightEnabled::Id: + return "StatusLightEnabled"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id: + return "StatusLightBrightness"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id: + return "DepthSensorStatus"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::CameraAvStreamManagement::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -4400,6 +4548,27 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::WebRTCTransportRequestor::Id: { + switch (id) + { + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id: + return "CurrentSessions"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { @@ -5751,6 +5920,54 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id: + return "CreateTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id: + return "UpdateTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id: + return "GetTwoDCartesianZone"; + case chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id: + return "RemoveZone"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Id: + return "AudioStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Id: + return "AudioStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Id: + return "VideoStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Id: + return "VideoStreamModify"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Id: + return "VideoStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Id: + return "SnapshotStreamAllocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Id: + return "SnapshotStreamDeallocate"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Id: + return "SetStreamPriorities"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Id: + return "CaptureSnapshot"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Id: + return "SetViewport"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Id: + return "SetImageRotation"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Id: + return "SetImageFlipHorizontal"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Id: + return "SetImageFlipVertical"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -5768,6 +5985,21 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::WebRTCTransportRequestor::Id: { + switch (id) + { + case chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id: + return "Offer"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id: + return "Answer"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id: + return "ICECandidate"; + case chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id: + return "End"; + default: + return "Unknown"; + } + } case chip::app::Clusters::Chime::Id: { switch (id) { @@ -6300,6 +6532,32 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } + case chip::app::Clusters::ZoneManagement::Id: { + switch (id) + { + case chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id: + return "CreateTwoDCartesianZoneResponse"; + case chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id: + return "GetTwoDCartesianZoneResponse"; + default: + return "Unknown"; + } + } + case chip::app::Clusters::CameraAvStreamManagement::Id: { + switch (id) + { + case chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id: + return "AudioStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id: + return "VideoStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id: + return "SnapshotStreamAllocateResponse"; + case chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshotResponse::Id: + return "CaptureSnapshotResponse"; + default: + return "Unknown"; + } + } case chip::app::Clusters::WebRTCTransportProvider::Id: { switch (id) { @@ -6378,139 +6636,141 @@ char const * DeviceTypeIdToText(chip::DeviceTypeId id) switch (id) { case 0x0000000A: - return "Matter Door Lock"; + return "Door Lock"; case 0x0000000B: - return "Matter Door Lock Controller"; + return "Door Lock Controller"; case 0x0000000E: - return "Matter Aggregator"; + return "Aggregator"; case 0x0000000F: - return "Matter Generic Switch"; + return "Generic Switch"; case 0x00000011: - return "Matter Power Source"; + return "Power Source"; case 0x00000012: - return "Matter OTA Requestor"; + return "OTA Requestor"; case 0x00000013: - return "Matter Bridged Device"; + return "Bridged Node"; case 0x00000014: - return "Matter OTA Provider"; + return "OTA Provider"; case 0x00000015: - return "Matter Contact Sensor"; + return "Contact Sensor"; case 0x00000016: - return "Matter Root Node"; + return "Root Node"; case 0x00000019: - return "Matter Secondary Network Interface Device Type"; + return "Secondary Network Interface"; case 0x00000022: - return "Matter Speaker"; + return "Speaker"; case 0x00000023: - return "Matter Casting Video Player"; + return "Casting Video Player"; case 0x00000024: - return "Matter Content App"; + return "Content App"; case 0x00000027: - return "Matter Mode Select"; + return "Mode Select"; case 0x00000028: - return "Matter Basic Video Player"; + return "Basic Video Player"; case 0x00000029: - return "Matter Casting Video Client"; + return "Casting Video Client"; case 0x0000002A: - return "Matter Video Remote Control"; + return "Video Remote Control"; case 0x0000002B: - return "Matter Fan"; + return "Fan"; case 0x0000002C: - return "Matter Air Quality Sensor"; + return "Air Quality Sensor"; case 0x0000002D: - return "Matter Air Purifier"; + return "Air Purifier"; case 0x00000041: - return "Matter Water Freeze Detector"; + return "Water Freeze Detector"; case 0x00000042: - return "Matter Water Valve"; + return "Water Valve"; case 0x00000043: - return "Matter Water Leak Detector"; + return "Water Leak Detector"; case 0x00000044: - return "Matter Rain Sensor"; + return "Rain Sensor"; case 0x00000070: - return "Matter Refrigerator"; + return "Refrigerator"; case 0x00000071: - return "Matter Temperature Controlled Cabinet"; + return "Temperature Controlled Cabinet"; case 0x00000072: - return "Matter Room Air Conditioner"; + return "Room Air Conditioner"; case 0x00000073: - return "Matter Laundry Washer"; + return "Laundry Washer"; case 0x00000074: - return "Matter Robotic Vacuum Cleaner"; + return "Robotic Vacuum Cleaner"; case 0x00000075: - return "Matter Dishwasher"; + return "Dishwasher"; case 0x00000076: - return "Matter Smoke CO Alarm"; + return "Smoke CO Alarm"; case 0x00000077: - return "Matter Cook Surface"; + return "Cook Surface"; case 0x00000078: - return "Matter Cooktop"; + return "Cooktop"; case 0x00000079: - return "Matter Microwave Oven"; + return "Microwave Oven"; case 0x0000007A: - return "Matter Extractor Hood"; + return "Extractor Hood"; case 0x0000007B: - return "Matter Oven"; + return "Oven"; case 0x0000007C: - return "Matter Laundry Dryer"; + return "Laundry Dryer"; case 0x00000090: - return "Matter Network Infrastructure Manager"; + return "Network Infrastructure Manager"; case 0x00000091: - return "Matter Thread Border Router"; + return "Thread Border Router"; case 0x00000100: - return "Matter On/Off Light"; + return "On/Off Light"; case 0x00000101: - return "Matter Dimmable Light"; + return "Dimmable Light"; case 0x00000103: - return "Matter On/Off Light Switch"; + return "On/Off Light Switch"; case 0x00000104: - return "Matter Dimmer Switch"; + return "Dimmer Switch"; case 0x00000105: - return "Matter Color Dimmer Switch"; + return "Color Dimmer Switch"; case 0x00000106: - return "Matter Light Sensor"; + return "Light Sensor"; case 0x00000107: - return "Matter Occupancy Sensor"; + return "Occupancy Sensor"; case 0x0000010A: - return "Matter On/Off Plug-in Unit"; + return "On/Off Plug-in Unit"; case 0x0000010B: - return "Matter Dimmable Plug-in Unit"; + return "Dimmable Plug-in Unit"; case 0x0000010C: - return "Matter Color Temperature Light"; + return "Color Temperature Light"; case 0x0000010D: - return "Matter Extended Color Light"; + return "Extended Color Light"; case 0x00000202: - return "Matter Window Covering"; + return "Window Covering"; case 0x00000203: - return "Matter Window Covering Controller"; + return "Window Covering Controller"; case 0x00000300: - return "Matter Heating/Cooling Unit"; + return "Heating/Cooling Unit"; case 0x00000301: - return "Matter Thermostat"; + return "Thermostat"; case 0x00000302: - return "Matter Temperature Sensor"; + return "Temperature Sensor"; case 0x00000303: - return "Matter Pump"; + return "Pump"; case 0x00000304: - return "Matter Pump Controller"; + return "Pump Controller"; case 0x00000305: - return "Matter Pressure Sensor"; + return "Pressure Sensor"; case 0x00000306: - return "Matter Flow Sensor"; + return "Flow Sensor"; case 0x00000307: - return "Matter Humidity Sensor"; + return "Humidity Sensor"; case 0x0000050C: - return "Matter EVSE"; + return "EVSE"; + case 0x0000050D: + return "Device Energy Management"; case 0x00000510: - return "Matter Electrical Sensor"; + return "Electrical Sensor"; case 0x00000840: - return "Matter Control Bridge"; + return "Control Bridge"; case 0x00000850: - return "Matter On/Off Sensor"; + return "On/Off Sensor"; case 0xFFF10001: - return "Matter Orphan Clusters"; + return "Orphan Clusters"; case 0xFFF10003: - return "Matter All-clusters-app Server Example"; + return "All-clusters-app Server Example"; default: return "Unknown"; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 329e0b8546..ac56d68687 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -154,7 +154,10 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| ZoneManagement | 0x0550 | +| CameraAvStreamManagement | 0x0551 | | WebRTCTransportProvider | 0x0553 | +| WebRTCTransportRequestor | 0x0554 | | Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | @@ -20831,6 +20834,7 @@ class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { | * TCMinRequiredVersion | 0x0006 | | * TCAcknowledgements | 0x0007 | | * TCAcknowledgementsRequired | 0x0008 | +| * TCUpdateDeadline | 0x0009 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -21859,6 +21863,91 @@ class SubscribeAttributeGeneralCommissioningTCAcknowledgementsRequired : public } }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TCUpdateDeadline + */ +class ReadGeneralCommissioningTCUpdateDeadline : public ReadAttribute { +public: + ReadGeneralCommissioningTCUpdateDeadline() + : ReadAttribute("tcupdate-deadline") + { + } + + ~ReadGeneralCommissioningTCUpdateDeadline() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralCommissioning::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTCUpdateDeadlineWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.TCUpdateDeadline response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("GeneralCommissioning TCUpdateDeadline read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeGeneralCommissioningTCUpdateDeadline : public SubscribeAttribute { +public: + SubscribeAttributeGeneralCommissioningTCUpdateDeadline() + : SubscribeAttribute("tcupdate-deadline") + { + } + + ~SubscribeAttributeGeneralCommissioningTCUpdateDeadline() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::GeneralCommissioning::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::GeneralCommissioning::Attributes::TCUpdateDeadline::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterGeneralCommissioning alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTCUpdateDeadlineWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"GeneralCommissioning.TCUpdateDeadline response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL /* @@ -160034,17 +160123,19 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /*----------------------------------------------------------------------------*\ -| Cluster WebRTCTransportProvider | 0x0553 | +| Cluster ZoneManagement | 0x0550 | |------------------------------------------------------------------------------| | Commands: | | -| * SolicitOffer | 0x01 | -| * ProvideOffer | 0x03 | -| * ProvideAnswer | 0x05 | -| * ProvideICECandidate | 0x06 | -| * EndSession | 0x07 | +| * CreateTwoDCartesianZone | 0x00 | +| * UpdateTwoDCartesianZone | 0x02 | +| * GetTwoDCartesianZone | 0x03 | +| * RemoveZone | 0x05 | |------------------------------------------------------------------------------| | Attributes: | | -| * CurrentSessions | 0x0000 | +| * SupportedZoneSources | 0x0000 | +| * Zones | 0x0001 | +| * TimeControl | 0x0002 | +| * Sensitivity | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -160053,143 +160144,220 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr | * ClusterRevision | 0xFFFD | |------------------------------------------------------------------------------| | Events: | | +| * ZoneTriggered | 0x0000 | +| * ZoneStopped | 0x0001 | \*----------------------------------------------------------------------------*/ #if MTR_ENABLE_PROVISIONAL /* - * Command SolicitOffer + * Command CreateTwoDCartesianZone */ -class WebRTCTransportProviderSolicitOffer : public ClusterCommand { +class ZoneManagementCreateTwoDCartesianZone : public ClusterCommand { public: - WebRTCTransportProviderSolicitOffer() - : ClusterCommand("solicit-offer") - , mComplex_ICEServers(&mRequest.ICEServers) + ZoneManagementCreateTwoDCartesianZone() + : ClusterCommand("create-two-dcartesian-zone") + , mComplex_Zone(&mRequest.zone) { #if MTR_ENABLE_PROVISIONAL - AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + AddArgument("Zone", &mComplex_Zone); #endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterCreateTwoDCartesianZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + params.zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + params.zone.name = [[NSString alloc] initWithBytes:mRequest.zone.name.data() length:mRequest.zone.name.size() encoding:NSUTF8StringEncoding]; + params.zone.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.zone.use)]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.zone.vertices) { + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_1; + newElement_1 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_1.x = [NSNumber numberWithUnsignedShort:entry_1.x]; + newElement_1.y = [NSNumber numberWithUnsignedShort:entry_1.y]; + [array_1 addObject:newElement_1]; + } + params.zone.vertices = array_1; + } + if (mRequest.zone.color.HasValue()) { + params.zone.color = [[NSString alloc] initWithBytes:mRequest.zone.color.Value().data() length:mRequest.zone.color.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.zone.color = nil; + } #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster createTwoDCartesianZoneWithParams:params completion: + ^(MTRZoneManagementClusterCreateTwoDCartesianZoneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZoneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::CreateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("ICEServers", &mComplex_ICEServers); -#endif // MTR_ENABLE_PROVISIONAL +/* + * Command UpdateTwoDCartesianZone + */ +class ZoneManagementUpdateTwoDCartesianZone : public ClusterCommand { +public: + ZoneManagementUpdateTwoDCartesianZone() + : ClusterCommand("update-two-dcartesian-zone") + , mComplex_Zone(&mRequest.zone) + { #if MTR_ENABLE_PROVISIONAL - AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); + AddArgument("Zone", &mComplex_Zone); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterUpdateTwoDCartesianZoneParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID]; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - if (mRequest.videoStreamID.HasValue()) { - if (mRequest.videoStreamID.Value().IsNull()) { - params.videoStreamID = nil; - } else { - params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID.Value().Value()]; + params.zone = [MTRZoneManagementClusterTwoDCartesianZoneStruct new]; + params.zone.name = [[NSString alloc] initWithBytes:mRequest.zone.name.data() length:mRequest.zone.name.size() encoding:NSUTF8StringEncoding]; + params.zone.use = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.zone.use)]; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.zone.vertices) { + MTRZoneManagementClusterTwoDCartesianVertexStruct * newElement_1; + newElement_1 = [MTRZoneManagementClusterTwoDCartesianVertexStruct new]; + newElement_1.x = [NSNumber numberWithUnsignedShort:entry_1.x]; + newElement_1.y = [NSNumber numberWithUnsignedShort:entry_1.y]; + [array_1 addObject:newElement_1]; } - } else { - params.videoStreamID = nil; + params.zone.vertices = array_1; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.audioStreamID.HasValue()) { - if (mRequest.audioStreamID.Value().IsNull()) { - params.audioStreamID = nil; - } else { - params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID.Value().Value()]; - } + if (mRequest.zone.color.HasValue()) { + params.zone.color = [[NSString alloc] initWithBytes:mRequest.zone.color.Value().data() length:mRequest.zone.color.Value().size() encoding:NSUTF8StringEncoding]; } else { - params.audioStreamID = nil; + params.zone.color = nil; } #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.ICEServers.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - for (auto & entry_1 : mRequest.ICEServers.Value()) { - MTRWebRTCTransportProviderClusterICEServerStruct * newElement_1; - newElement_1 = [MTRWebRTCTransportProviderClusterICEServerStruct new]; - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - for (auto & entry_3 : entry_1.urls) { - NSString * newElement_3; - newElement_3 = [[NSString alloc] initWithBytes:entry_3.data() length:entry_3.size() encoding:NSUTF8StringEncoding]; - [array_3 addObject:newElement_3]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster updateTwoDCartesianZoneWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } - newElement_1.urls = array_3; - } - if (entry_1.username.HasValue()) { - newElement_1.username = [[NSString alloc] initWithBytes:entry_1.username.Value().data() length:entry_1.username.Value().size() encoding:NSUTF8StringEncoding]; - } else { - newElement_1.username = nil; - } - if (entry_1.credential.HasValue()) { - newElement_1.credential = [[NSString alloc] initWithBytes:entry_1.credential.Value().data() length:entry_1.credential.Value().size() encoding:NSUTF8StringEncoding]; - } else { - newElement_1.credential = nil; - } - if (entry_1.caid.HasValue()) { - newElement_1.caid = [NSNumber numberWithUnsignedShort:entry_1.caid.Value()]; - } else { - newElement_1.caid = nil; - } - [array_1 addObject:newElement_1]; - } - params.iceServers = array_1; - } - } else { - params.iceServers = nil; + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::UpdateTwoDCartesianZone::Type mRequest; + TypedComplexArgument mComplex_Zone; +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - if (mRequest.ICETransportPolicy.HasValue()) { - params.iceTransportPolicy = [[NSString alloc] initWithBytes:mRequest.ICETransportPolicy.Value().data() length:mRequest.ICETransportPolicy.Value().size() encoding:NSUTF8StringEncoding]; - } else { - params.iceTransportPolicy = nil; - } +/* + * Command GetTwoDCartesianZone + */ +class ZoneManagementGetTwoDCartesianZone : public ClusterCommand { +public: + ZoneManagementGetTwoDCartesianZone() + : ClusterCommand("get-two-dcartesian-zone") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); #endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterGetTwoDCartesianZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - if (mRequest.metadataOptions.HasValue()) { - params.metadataOptions = [NSNumber numberWithUnsignedChar:mRequest.metadataOptions.Value().Raw()]; + if (mRequest.zoneID.HasValue()) { + if (mRequest.zoneID.Value().IsNull()) { + params.zoneID = nil; + } else { + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID.Value().Value()]; + } } else { - params.metadataOptions = nil; + params.zoneID = nil; } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster solicitOfferWithParams:params completion: - ^(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable values, NSError * _Nullable error) { + [cluster getTwoDCartesianZoneWithParams:params completion: + ^(MTRZoneManagementClusterGetTwoDCartesianZoneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); if (error == nil) { - constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::Id; + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id; RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); - constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::Id; + constexpr chip::CommandId responseId = chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZoneResponse::Id; RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { @@ -160201,101 +160369,8656 @@ class WebRTCTransportProviderSolicitOffer : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Type mRequest; - TypedComplexArgument>> mComplex_ICEServers; + chip::app::Clusters::ZoneManagement::Commands::GetTwoDCartesianZone::Type mRequest; }; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command ProvideOffer + * Command RemoveZone */ -class WebRTCTransportProviderProvideOffer : public ClusterCommand { +class ZoneManagementRemoveZone : public ClusterCommand { public: - WebRTCTransportProviderProvideOffer() - : ClusterCommand("provide-offer") - , mComplex_ICEServers(&mRequest.ICEServers) + ZoneManagementRemoveZone() + : ClusterCommand("remove-zone") { #if MTR_ENABLE_PROVISIONAL - AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); + AddArgument("ZoneID", 0, UINT16_MAX, &mRequest.zoneID); #endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRZoneManagementClusterRemoveZoneParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - AddArgument("Sdp", &mRequest.sdp); + params.zoneID = [NSNumber numberWithUnsignedShort:mRequest.zoneID]; #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster removeZoneWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::ZoneManagement::Commands::RemoveZone::Type mRequest; +}; + #endif // MTR_ENABLE_PROVISIONAL + #if MTR_ENABLE_PROVISIONAL - AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); + +/* + * Attribute SupportedZoneSources + */ +class ReadZoneManagementSupportedZoneSources : public ReadAttribute { +public: + ReadZoneManagementSupportedZoneSources() + : ReadAttribute("supported-zone-sources") + { + } + + ~ReadZoneManagementSupportedZoneSources() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedZoneSourcesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.SupportedZoneSources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement SupportedZoneSources read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementSupportedZoneSources : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementSupportedZoneSources() + : SubscribeAttribute("supported-zone-sources") + { + } + + ~SubscribeAttributeZoneManagementSupportedZoneSources() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::SupportedZoneSources::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSupportedZoneSourcesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.SupportedZoneSources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); + +/* + * Attribute Zones + */ +class ReadZoneManagementZones : public ReadAttribute { +public: + ReadZoneManagementZones() + : ReadAttribute("zones") + { + } + + ~ReadZoneManagementZones() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Zones::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeZonesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Zones response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement Zones read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementZones : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementZones() + : SubscribeAttribute("zones") + { + } + + ~SubscribeAttributeZoneManagementZones() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Zones::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeZonesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Zones response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("ICEServers", &mComplex_ICEServers); + +/* + * Attribute TimeControl + */ +class ReadZoneManagementTimeControl : public ReadAttribute { +public: + ReadZoneManagementTimeControl() + : ReadAttribute("time-control") + { + } + + ~ReadZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTimeControlWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement TimeControl read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteZoneManagementTimeControl : public WriteAttribute { +public: + WriteZoneManagementTimeControl() + : WriteAttribute("time-control") + , mComplex(&mValue) + { + AddArgument("attr-name", "time-control"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + MTRZoneManagementClusterZoneTriggeringTimeControlStruct * newElement_0; + newElement_0 = [MTRZoneManagementClusterZoneTriggeringTimeControlStruct new]; + newElement_0.initialDuration = [NSNumber numberWithUnsignedShort:entry_0.initialDuration]; + newElement_0.augmentationDuration = [NSNumber numberWithUnsignedShort:entry_0.augmentationDuration]; + newElement_0.maxDuration = [NSNumber numberWithUnsignedInt:entry_0.maxDuration]; + newElement_0.blindDuration = [NSNumber numberWithUnsignedShort:entry_0.blindDuration]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeTimeControlWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("ZoneManagement TimeControl write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeZoneManagementTimeControl : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementTimeControl() + : SubscribeAttribute("time-control") + { + } + + ~SubscribeAttributeZoneManagementTimeControl() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::TimeControl::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTimeControlWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.TimeControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); + +/* + * Attribute Sensitivity + */ +class ReadZoneManagementSensitivity : public ReadAttribute { +public: + ReadZoneManagementSensitivity() + : ReadAttribute("sensitivity") + { + } + + ~ReadZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSensitivityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Sensitivity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement Sensitivity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteZoneManagementSensitivity : public WriteAttribute { +public: + WriteZoneManagementSensitivity() + : WriteAttribute("sensitivity") + { + AddArgument("attr-name", "sensitivity"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSensitivityWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("ZoneManagement Sensitivity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeZoneManagementSensitivity : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementSensitivity() + : SubscribeAttribute("sensitivity") + { + } + + ~SubscribeAttributeZoneManagementSensitivity() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::Sensitivity::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSensitivityWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.Sensitivity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); -#endif // MTR_ENABLE_PROVISIONAL - ClusterCommand::AddArguments(); + +/* + * Attribute GeneratedCommandList + */ +class ReadZoneManagementGeneratedCommandList : public ReadAttribute { +public: + ReadZoneManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadZoneManagementGeneratedCommandList() + { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id; - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideOfferParams alloc] init]; - params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; -#if MTR_ENABLE_PROVISIONAL - if (mRequest.webRTCSessionID.IsNull()) { - params.webRTCSessionID = nil; - } else { - params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID.Value()]; + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeZoneManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; + +/* + * Attribute AcceptedCommandList + */ +class ReadZoneManagementAcceptedCommandList : public ReadAttribute { +public: + ReadZoneManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadZoneManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeZoneManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; + +/* + * Attribute EventList + */ +class ReadZoneManagementEventList : public ReadAttribute { +public: + ReadZoneManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadZoneManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeZoneManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - if (mRequest.videoStreamID.HasValue()) { - if (mRequest.videoStreamID.Value().IsNull()) { - params.videoStreamID = nil; + +/* + * Attribute AttributeList + */ +class ReadZoneManagementAttributeList : public ReadAttribute { +public: + ReadZoneManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadZoneManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID.Value().Value()]; + LogNSError("ZoneManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } - } else { - params.videoStreamID = nil; + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeZoneManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - if (mRequest.audioStreamID.HasValue()) { - if (mRequest.audioStreamID.Value().IsNull()) { - params.audioStreamID = nil; + +/* + * Attribute FeatureMap + */ +class ReadZoneManagementFeatureMap : public ReadAttribute { +public: + ReadZoneManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadZoneManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID.Value().Value()]; + LogNSError("ZoneManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } - } else { - params.audioStreamID = nil; + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeZoneManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - if (mRequest.ICEServers.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - for (auto & entry_1 : mRequest.ICEServers.Value()) { - MTRWebRTCTransportProviderClusterICEServerStruct * newElement_1; - newElement_1 = [MTRWebRTCTransportProviderClusterICEServerStruct new]; + +/* + * Attribute ClusterRevision + */ +class ReadZoneManagementClusterRevision : public ReadAttribute { +public: + ReadZoneManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadZoneManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("ZoneManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeZoneManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeZoneManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeZoneManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::ZoneManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::ZoneManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterZoneManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ZoneManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster CameraAvStreamManagement | 0x0551 | +|------------------------------------------------------------------------------| +| Commands: | | +| * AudioStreamAllocate | 0x00 | +| * AudioStreamDeallocate | 0x02 | +| * VideoStreamAllocate | 0x03 | +| * VideoStreamModify | 0x05 | +| * VideoStreamDeallocate | 0x06 | +| * SnapshotStreamAllocate | 0x07 | +| * SnapshotStreamDeallocate | 0x09 | +| * SetStreamPriorities | 0x0A | +| * CaptureSnapshot | 0x0B | +| * SetViewport | 0x0D | +| * SetImageRotation | 0x0E | +| * SetImageFlipHorizontal | 0x0F | +| * SetImageFlipVertical | 0x10 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * MaxConcurrentVideoEncoders | 0x0000 | +| * MaxEncodedPixelRate | 0x0001 | +| * VideoSensorParams | 0x0002 | +| * NightVisionCapable | 0x0003 | +| * MinViewport | 0x0004 | +| * RateDistortionTradeOffPoints | 0x0005 | +| * MaxPreRollBufferSize | 0x0006 | +| * MicrophoneCapabilities | 0x0007 | +| * SpeakerCapabilities | 0x0008 | +| * TwoWayTalkSupport | 0x0009 | +| * SupportedSnapshotParams | 0x000A | +| * MaxNetworkBandwidth | 0x000B | +| * CurrentFrameRate | 0x000C | +| * HDRModeEnabled | 0x000D | +| * CurrentVideoCodecs | 0x000E | +| * CurrentSnapshotConfig | 0x000F | +| * FabricsUsingCamera | 0x0010 | +| * AllocatedVideoStreams | 0x0011 | +| * AllocatedAudioStreams | 0x0012 | +| * AllocatedSnapshotStreams | 0x0013 | +| * RankedVideoStreamPrioritiesList | 0x0014 | +| * SoftRecordingPrivacyModeEnabled | 0x0015 | +| * SoftLivestreamPrivacyModeEnabled | 0x0016 | +| * HardPrivacyModeOn | 0x0017 | +| * NightVision | 0x0018 | +| * NightVisionIllum | 0x0019 | +| * AWBEnabled | 0x001A | +| * AutoShutterSpeedEnabled | 0x001B | +| * AutoISOEnabled | 0x001C | +| * Viewport | 0x001D | +| * SpeakerMuted | 0x001E | +| * SpeakerVolumeLevel | 0x001F | +| * SpeakerMaxLevel | 0x0020 | +| * SpeakerMinLevel | 0x0021 | +| * MicrophoneMuted | 0x0022 | +| * MicrophoneVolumeLevel | 0x0023 | +| * MicrophoneMaxLevel | 0x0024 | +| * MicrophoneMinLevel | 0x0025 | +| * MicrophoneAGCEnabled | 0x0026 | +| * ImageRotation | 0x0027 | +| * ImageFlipHorizontal | 0x0028 | +| * ImageFlipVertical | 0x0029 | +| * LocalVideoRecordingEnabled | 0x002A | +| * LocalSnapshotRecordingEnabled | 0x002B | +| * StatusLightEnabled | 0x002C | +| * StatusLightBrightness | 0x002D | +| * DepthSensorStatus | 0x002E | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +| * VideoStreamChanged | 0x0000 | +| * AudioStreamChanged | 0x0001 | +| * SnapshotStreamChanged | 0x0002 | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command AudioStreamAllocate + */ +class CameraAvStreamManagementAudioStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementAudioStreamAllocate() + : ClusterCommand("audio-stream-allocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioCodec", 0, UINT8_MAX, &mRequest.audioCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ChannelCount", 0, UINT8_MAX, &mRequest.channelCount); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("SampleRate", 0, UINT32_MAX, &mRequest.sampleRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitDepth", 0, UINT8_MAX, &mRequest.bitDepth); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterAudioStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.audioCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.audioCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.channelCount = [NSNumber numberWithUnsignedChar:mRequest.channelCount]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sampleRate = [NSNumber numberWithUnsignedInt:mRequest.sampleRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitRate = [NSNumber numberWithUnsignedInt:mRequest.bitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitDepth = [NSNumber numberWithUnsignedChar:mRequest.bitDepth]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster audioStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterAudioStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamAllocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command AudioStreamDeallocate + */ +class CameraAvStreamManagementAudioStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementAudioStreamDeallocate() + : ClusterCommand("audio-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterAudioStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster audioStreamDeallocateWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::AudioStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamAllocate + */ +class CameraAvStreamManagementVideoStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamAllocate() + : ClusterCommand("video-stream-allocate") + , mComplex_MinResolution(&mRequest.minResolution) + , mComplex_MaxResolution(&mRequest.maxResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoCodec", 0, UINT8_MAX, &mRequest.videoCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinFrameRate", 0, UINT16_MAX, &mRequest.minFrameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxFrameRate", 0, UINT16_MAX, &mRequest.maxFrameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinResolution", &mComplex_MinResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxResolution", &mComplex_MaxResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinBitRate", 0, UINT32_MAX, &mRequest.minBitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxBitRate", 0, UINT32_MAX, &mRequest.maxBitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinFragmentLen", 0, UINT16_MAX, &mRequest.minFragmentLen); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxFragmentLen", 0, UINT16_MAX, &mRequest.maxFragmentLen); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("WatermarkEnabled", 0, 1, &mRequest.watermarkEnabled); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("OSDEnabled", 0, 1, &mRequest.OSDEnabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.videoCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.videoCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minFrameRate = [NSNumber numberWithUnsignedShort:mRequest.minFrameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxFrameRate = [NSNumber numberWithUnsignedShort:mRequest.maxFrameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.minResolution.width = [NSNumber numberWithUnsignedShort:mRequest.minResolution.width]; + params.minResolution.height = [NSNumber numberWithUnsignedShort:mRequest.minResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.maxResolution.width = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.width]; + params.maxResolution.height = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minBitRate = [NSNumber numberWithUnsignedInt:mRequest.minBitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxBitRate = [NSNumber numberWithUnsignedInt:mRequest.maxBitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minFragmentLen = [NSNumber numberWithUnsignedShort:mRequest.minFragmentLen]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxFragmentLen = [NSNumber numberWithUnsignedShort:mRequest.maxFragmentLen]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.watermarkEnabled.HasValue()) { + params.watermarkEnabled = [NSNumber numberWithBool:mRequest.watermarkEnabled.Value()]; + } else { + params.watermarkEnabled = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.OSDEnabled.HasValue()) { + params.osdEnabled = [NSNumber numberWithBool:mRequest.OSDEnabled.Value()]; + } else { + params.osdEnabled = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterVideoStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamAllocate::Type mRequest; + TypedComplexArgument mComplex_MinResolution; + TypedComplexArgument mComplex_MaxResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamModify + */ +class CameraAvStreamManagementVideoStreamModify : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamModify() + : ClusterCommand("video-stream-modify") + , mComplex_Resolution(&mRequest.resolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Resolution", &mComplex_Resolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("WatermarkEnabled", 0, 1, &mRequest.watermarkEnabled); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("OSDEnabled", 0, 1, &mRequest.OSDEnabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamModifyParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.resolution.HasValue()) { + params.resolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.resolution.width = [NSNumber numberWithUnsignedShort:mRequest.resolution.Value().width]; + params.resolution.height = [NSNumber numberWithUnsignedShort:mRequest.resolution.Value().height]; + } else { + params.resolution = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.watermarkEnabled.HasValue()) { + params.watermarkEnabled = [NSNumber numberWithBool:mRequest.watermarkEnabled.Value()]; + } else { + params.watermarkEnabled = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.OSDEnabled.HasValue()) { + params.osdEnabled = [NSNumber numberWithBool:mRequest.OSDEnabled.Value()]; + } else { + params.osdEnabled = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamModifyWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamModify::Type mRequest; + TypedComplexArgument> mComplex_Resolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command VideoStreamDeallocate + */ +class CameraAvStreamManagementVideoStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementVideoStreamDeallocate() + : ClusterCommand("video-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterVideoStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster videoStreamDeallocateWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::VideoStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SnapshotStreamAllocate + */ +class CameraAvStreamManagementSnapshotStreamAllocate : public ClusterCommand { +public: + CameraAvStreamManagementSnapshotStreamAllocate() + : ClusterCommand("snapshot-stream-allocate") + , mComplex_MinResolution(&mRequest.minResolution) + , mComplex_MaxResolution(&mRequest.maxResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("ImageCodec", 0, UINT8_MAX, &mRequest.imageCodec); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("FrameRate", 0, UINT16_MAX, &mRequest.frameRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("BitRate", 0, UINT32_MAX, &mRequest.bitRate); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MinResolution", &mComplex_MinResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MaxResolution", &mComplex_MaxResolution); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Quality", 0, UINT8_MAX, &mRequest.quality); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSnapshotStreamAllocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.imageCodec = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.imageCodec)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.frameRate = [NSNumber numberWithUnsignedShort:mRequest.frameRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.bitRate = [NSNumber numberWithUnsignedInt:mRequest.bitRate]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.minResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.minResolution.width = [NSNumber numberWithUnsignedShort:mRequest.minResolution.width]; + params.minResolution.height = [NSNumber numberWithUnsignedShort:mRequest.minResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.maxResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.maxResolution.width = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.width]; + params.maxResolution.height = [NSNumber numberWithUnsignedShort:mRequest.maxResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.quality = [NSNumber numberWithUnsignedChar:mRequest.quality]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster snapshotStreamAllocateWithParams:params completion: + ^(MTRCameraAVStreamManagementClusterSnapshotStreamAllocateResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamAllocate::Type mRequest; + TypedComplexArgument mComplex_MinResolution; + TypedComplexArgument mComplex_MaxResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SnapshotStreamDeallocate + */ +class CameraAvStreamManagementSnapshotStreamDeallocate : public ClusterCommand { +public: + CameraAvStreamManagementSnapshotStreamDeallocate() + : ClusterCommand("snapshot-stream-deallocate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSnapshotStreamDeallocateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.snapshotStreamID = [NSNumber numberWithUnsignedShort:mRequest.snapshotStreamID]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster snapshotStreamDeallocateWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SnapshotStreamDeallocate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetStreamPriorities + */ +class CameraAvStreamManagementSetStreamPriorities : public ClusterCommand { +public: + CameraAvStreamManagementSetStreamPriorities() + : ClusterCommand("set-stream-priorities") + , mComplex_StreamPriorities(&mRequest.streamPriorities) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamPriorities", &mComplex_StreamPriorities); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetStreamPrioritiesParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.streamPriorities) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + params.streamPriorities = array_0; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setStreamPrioritiesWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetStreamPriorities::Type mRequest; + TypedComplexArgument> mComplex_StreamPriorities; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command CaptureSnapshot + */ +class CameraAvStreamManagementCaptureSnapshot : public ClusterCommand { +public: + CameraAvStreamManagementCaptureSnapshot() + : ClusterCommand("capture-snapshot") + , mComplex_RequestedResolution(&mRequest.requestedResolution) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("SnapshotStreamID", 0, UINT16_MAX, &mRequest.snapshotStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("RequestedResolution", &mComplex_RequestedResolution); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterCaptureSnapshotParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.snapshotStreamID = [NSNumber numberWithUnsignedShort:mRequest.snapshotStreamID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.requestedResolution = [MTRCameraAVStreamManagementClusterVideoResolutionStruct new]; + params.requestedResolution.width = [NSNumber numberWithUnsignedShort:mRequest.requestedResolution.width]; + params.requestedResolution.height = [NSNumber numberWithUnsignedShort:mRequest.requestedResolution.height]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster captureSnapshotWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::CaptureSnapshot::Type mRequest; + TypedComplexArgument mComplex_RequestedResolution; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetViewport + */ +class CameraAvStreamManagementSetViewport : public ClusterCommand { +public: + CameraAvStreamManagementSetViewport() + : ClusterCommand("set-viewport") + , mComplex_Viewport(&mRequest.viewport) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Viewport", &mComplex_Viewport); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetViewportParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.viewport = [MTRCameraAVStreamManagementClusterViewportStruct new]; + params.viewport.x1 = [NSNumber numberWithUnsignedShort:mRequest.viewport.x1]; + params.viewport.y1 = [NSNumber numberWithUnsignedShort:mRequest.viewport.y1]; + params.viewport.x2 = [NSNumber numberWithUnsignedShort:mRequest.viewport.x2]; + params.viewport.y2 = [NSNumber numberWithUnsignedShort:mRequest.viewport.y2]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setViewportWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetViewport::Type mRequest; + TypedComplexArgument mComplex_Viewport; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageRotation + */ +class CameraAvStreamManagementSetImageRotation : public ClusterCommand { +public: + CameraAvStreamManagementSetImageRotation() + : ClusterCommand("set-image-rotation") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Angle", 0, UINT16_MAX, &mRequest.angle); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageRotationParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.angle = [NSNumber numberWithUnsignedShort:mRequest.angle]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageRotationWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageRotation::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageFlipHorizontal + */ +class CameraAvStreamManagementSetImageFlipHorizontal : public ClusterCommand { +public: + CameraAvStreamManagementSetImageFlipHorizontal() + : ClusterCommand("set-image-flip-horizontal") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageFlipHorizontalParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageFlipHorizontalWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipHorizontal::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command SetImageFlipVertical + */ +class CameraAvStreamManagementSetImageFlipVertical : public ClusterCommand { +public: + CameraAvStreamManagementSetImageFlipVertical() + : ClusterCommand("set-image-flip-vertical") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Enabled", 0, 1, &mRequest.enabled); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRCameraAVStreamManagementClusterSetImageFlipVerticalParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.enabled = [NSNumber numberWithBool:mRequest.enabled]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster setImageFlipVerticalWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::CameraAvStreamManagement::Commands::SetImageFlipVertical::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxConcurrentVideoEncoders + */ +class ReadCameraAvStreamManagementMaxConcurrentVideoEncoders : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxConcurrentVideoEncoders() + : ReadAttribute("max-concurrent-video-encoders") + { + } + + ~ReadCameraAvStreamManagementMaxConcurrentVideoEncoders() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxConcurrentVideoEncodersWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxConcurrentVideoEncoders response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxConcurrentVideoEncoders read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders() + : SubscribeAttribute("max-concurrent-video-encoders") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxConcurrentVideoEncoders() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxConcurrentVideoEncoders::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaxConcurrentVideoEncodersWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxConcurrentVideoEncoders response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxEncodedPixelRate + */ +class ReadCameraAvStreamManagementMaxEncodedPixelRate : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxEncodedPixelRate() + : ReadAttribute("max-encoded-pixel-rate") + { + } + + ~ReadCameraAvStreamManagementMaxEncodedPixelRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxEncodedPixelRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxEncodedPixelRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxEncodedPixelRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate() + : SubscribeAttribute("max-encoded-pixel-rate") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxEncodedPixelRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxEncodedPixelRate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaxEncodedPixelRateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxEncodedPixelRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute VideoSensorParams + */ +class ReadCameraAvStreamManagementVideoSensorParams : public ReadAttribute { +public: + ReadCameraAvStreamManagementVideoSensorParams() + : ReadAttribute("video-sensor-params") + { + } + + ~ReadCameraAvStreamManagementVideoSensorParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeVideoSensorParamsWithCompletion:^(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.VideoSensorParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement VideoSensorParams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementVideoSensorParams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementVideoSensorParams() + : SubscribeAttribute("video-sensor-params") + { + } + + ~SubscribeAttributeCameraAvStreamManagementVideoSensorParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::VideoSensorParams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeVideoSensorParamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterVideoSensorParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.VideoSensorParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NightVisionCapable + */ +class ReadCameraAvStreamManagementNightVisionCapable : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVisionCapable() + : ReadAttribute("night-vision-capable") + { + } + + ~ReadCameraAvStreamManagementNightVisionCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionCapableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionCapable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVisionCapable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementNightVisionCapable : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVisionCapable() + : SubscribeAttribute("night-vision-capable") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVisionCapable() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionCapable::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNightVisionCapableWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionCapable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MinViewport + */ +class ReadCameraAvStreamManagementMinViewport : public ReadAttribute { +public: + ReadCameraAvStreamManagementMinViewport() + : ReadAttribute("min-viewport") + { + } + + ~ReadCameraAvStreamManagementMinViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMinViewportWithCompletion:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MinViewport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMinViewport : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMinViewport() + : SubscribeAttribute("min-viewport") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMinViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MinViewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMinViewportWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterVideoResolutionStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MinViewport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute RateDistortionTradeOffPoints + */ +class ReadCameraAvStreamManagementRateDistortionTradeOffPoints : public ReadAttribute { +public: + ReadCameraAvStreamManagementRateDistortionTradeOffPoints() + : ReadAttribute("rate-distortion-trade-off-points") + { + } + + ~ReadCameraAvStreamManagementRateDistortionTradeOffPoints() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeRateDistortionTradeOffPointsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RateDistortionTradeOffPoints response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement RateDistortionTradeOffPoints read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints() + : SubscribeAttribute("rate-distortion-trade-off-points") + { + } + + ~SubscribeAttributeCameraAvStreamManagementRateDistortionTradeOffPoints() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RateDistortionTradeOffPoints::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeRateDistortionTradeOffPointsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RateDistortionTradeOffPoints response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxPreRollBufferSize + */ +class ReadCameraAvStreamManagementMaxPreRollBufferSize : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxPreRollBufferSize() + : ReadAttribute("max-pre-roll-buffer-size") + { + } + + ~ReadCameraAvStreamManagementMaxPreRollBufferSize() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxPreRollBufferSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxPreRollBufferSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() + : SubscribeAttribute("max-pre-roll-buffer-size") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxPreRollBufferSize() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxPreRollBufferSize::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaxPreRollBufferSizeWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxPreRollBufferSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneCapabilities + */ +class ReadCameraAvStreamManagementMicrophoneCapabilities : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneCapabilities() + : ReadAttribute("microphone-capabilities") + { + } + + ~ReadCameraAvStreamManagementMicrophoneCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneCapabilitiesWithCompletion:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities() + : SubscribeAttribute("microphone-capabilities") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneCapabilities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneCapabilitiesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpeakerCapabilities + */ +class ReadCameraAvStreamManagementSpeakerCapabilities : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerCapabilities() + : ReadAttribute("speaker-capabilities") + { + } + + ~ReadCameraAvStreamManagementSpeakerCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerCapabilitiesWithCompletion:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities() + : SubscribeAttribute("speaker-capabilities") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerCapabilities() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerCapabilities::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpeakerCapabilitiesWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterAudioCapabilitiesStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute TwoWayTalkSupport + */ +class ReadCameraAvStreamManagementTwoWayTalkSupport : public ReadAttribute { +public: + ReadCameraAvStreamManagementTwoWayTalkSupport() + : ReadAttribute("two-way-talk-support") + { + } + + ~ReadCameraAvStreamManagementTwoWayTalkSupport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeTwoWayTalkSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.TwoWayTalkSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement TwoWayTalkSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport() + : SubscribeAttribute("two-way-talk-support") + { + } + + ~SubscribeAttributeCameraAvStreamManagementTwoWayTalkSupport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::TwoWayTalkSupport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeTwoWayTalkSupportWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.TwoWayTalkSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SupportedSnapshotParams + */ +class ReadCameraAvStreamManagementSupportedSnapshotParams : public ReadAttribute { +public: + ReadCameraAvStreamManagementSupportedSnapshotParams() + : ReadAttribute("supported-snapshot-params") + { + } + + ~ReadCameraAvStreamManagementSupportedSnapshotParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSupportedSnapshotParamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SupportedSnapshotParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SupportedSnapshotParams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams() + : SubscribeAttribute("supported-snapshot-params") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSupportedSnapshotParams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SupportedSnapshotParams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSupportedSnapshotParamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SupportedSnapshotParams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MaxNetworkBandwidth + */ +class ReadCameraAvStreamManagementMaxNetworkBandwidth : public ReadAttribute { +public: + ReadCameraAvStreamManagementMaxNetworkBandwidth() + : ReadAttribute("max-network-bandwidth") + { + } + + ~ReadCameraAvStreamManagementMaxNetworkBandwidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMaxNetworkBandwidthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxNetworkBandwidth response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MaxNetworkBandwidth read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth() + : SubscribeAttribute("max-network-bandwidth") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMaxNetworkBandwidth() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MaxNetworkBandwidth::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMaxNetworkBandwidthWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MaxNetworkBandwidth response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentFrameRate + */ +class ReadCameraAvStreamManagementCurrentFrameRate : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentFrameRate() + : ReadAttribute("current-frame-rate") + { + } + + ~ReadCameraAvStreamManagementCurrentFrameRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentFrameRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentFrameRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentFrameRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentFrameRate : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentFrameRate() + : SubscribeAttribute("current-frame-rate") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentFrameRate() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentFrameRate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentFrameRateWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentFrameRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute HDRModeEnabled + */ +class ReadCameraAvStreamManagementHDRModeEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementHDRModeEnabled() + : ReadAttribute("hdrmode-enabled") + { + } + + ~ReadCameraAvStreamManagementHDRModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHDRModeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement HDRModeEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementHDRModeEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementHDRModeEnabled() + : WriteAttribute("hdrmode-enabled") + { + AddArgument("attr-name", "hdrmode-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementHDRModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeHDRModeEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement HDRModeEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementHDRModeEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementHDRModeEnabled() + : SubscribeAttribute("hdrmode-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementHDRModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HDRModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeHDRModeEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HDRModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentVideoCodecs + */ +class ReadCameraAvStreamManagementCurrentVideoCodecs : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentVideoCodecs() + : ReadAttribute("current-video-codecs") + { + } + + ~ReadCameraAvStreamManagementCurrentVideoCodecs() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentVideoCodecsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentVideoCodecs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentVideoCodecs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs() + : SubscribeAttribute("current-video-codecs") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentVideoCodecs() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentVideoCodecs::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentVideoCodecsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentVideoCodecs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentSnapshotConfig + */ +class ReadCameraAvStreamManagementCurrentSnapshotConfig : public ReadAttribute { +public: + ReadCameraAvStreamManagementCurrentSnapshotConfig() + : ReadAttribute("current-snapshot-config") + { + } + + ~ReadCameraAvStreamManagementCurrentSnapshotConfig() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentSnapshotConfigWithCompletion:^(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentSnapshotConfig response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement CurrentSnapshotConfig read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig() + : SubscribeAttribute("current-snapshot-config") + { + } + + ~SubscribeAttributeCameraAvStreamManagementCurrentSnapshotConfig() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::CurrentSnapshotConfig::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentSnapshotConfigWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterSnapshotParamsStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.CurrentSnapshotConfig response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FabricsUsingCamera + */ +class ReadCameraAvStreamManagementFabricsUsingCamera : public ReadAttribute { +public: + ReadCameraAvStreamManagementFabricsUsingCamera() + : ReadAttribute("fabrics-using-camera") + { + } + + ~ReadCameraAvStreamManagementFabricsUsingCamera() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFabricsUsingCameraWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FabricsUsingCamera response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement FabricsUsingCamera read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera() + : SubscribeAttribute("fabrics-using-camera") + { + } + + ~SubscribeAttributeCameraAvStreamManagementFabricsUsingCamera() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FabricsUsingCamera::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFabricsUsingCameraWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FabricsUsingCamera response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AllocatedVideoStreams + */ +class ReadCameraAvStreamManagementAllocatedVideoStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedVideoStreams() + : ReadAttribute("allocated-video-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedVideoStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedVideoStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedVideoStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedVideoStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams() + : SubscribeAttribute("allocated-video-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedVideoStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedVideoStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAllocatedVideoStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedVideoStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AllocatedAudioStreams + */ +class ReadCameraAvStreamManagementAllocatedAudioStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedAudioStreams() + : ReadAttribute("allocated-audio-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedAudioStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedAudioStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedAudioStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedAudioStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams() + : SubscribeAttribute("allocated-audio-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedAudioStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedAudioStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAllocatedAudioStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedAudioStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AllocatedSnapshotStreams + */ +class ReadCameraAvStreamManagementAllocatedSnapshotStreams : public ReadAttribute { +public: + ReadCameraAvStreamManagementAllocatedSnapshotStreams() + : ReadAttribute("allocated-snapshot-streams") + { + } + + ~ReadCameraAvStreamManagementAllocatedSnapshotStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAllocatedSnapshotStreamsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedSnapshotStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AllocatedSnapshotStreams read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams() + : SubscribeAttribute("allocated-snapshot-streams") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAllocatedSnapshotStreams() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AllocatedSnapshotStreams::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAllocatedSnapshotStreamsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AllocatedSnapshotStreams response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute RankedVideoStreamPrioritiesList + */ +class ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList : public ReadAttribute { +public: + ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : ReadAttribute("ranked-video-stream-priorities-list") + { + } + + ~ReadCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeRankedVideoStreamPrioritiesListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RankedVideoStreamPrioritiesList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement RankedVideoStreamPrioritiesList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList : public WriteAttribute { +public: + WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : WriteAttribute("ranked-video-stream-priorities-list") + , mComplex(&mValue) + { + AddArgument("attr-name", "ranked-video-stream-priorities-list"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mValue) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + value = array_0; + } + + [cluster writeAttributeRankedVideoStreamPrioritiesListWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement RankedVideoStreamPrioritiesList write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::List mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList() + : SubscribeAttribute("ranked-video-stream-priorities-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementRankedVideoStreamPrioritiesList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::RankedVideoStreamPrioritiesList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeRankedVideoStreamPrioritiesListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.RankedVideoStreamPrioritiesList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SoftRecordingPrivacyModeEnabled + */ +class ReadCameraAvStreamManagementSoftRecordingPrivacyModeEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + : ReadAttribute("soft-recording-privacy-mode-enabled") + { + } + + ~ReadCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSoftRecordingPrivacyModeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftRecordingPrivacyModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SoftRecordingPrivacyModeEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSoftRecordingPrivacyModeEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + : WriteAttribute("soft-recording-privacy-mode-enabled") + { + AddArgument("attr-name", "soft-recording-privacy-mode-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSoftRecordingPrivacyModeEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SoftRecordingPrivacyModeEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + : SubscribeAttribute("soft-recording-privacy-mode-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSoftRecordingPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftRecordingPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSoftRecordingPrivacyModeEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftRecordingPrivacyModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SoftLivestreamPrivacyModeEnabled + */ +class ReadCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + : ReadAttribute("soft-livestream-privacy-mode-enabled") + { + } + + ~ReadCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSoftLivestreamPrivacyModeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftLivestreamPrivacyModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SoftLivestreamPrivacyModeEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + : WriteAttribute("soft-livestream-privacy-mode-enabled") + { + AddArgument("attr-name", "soft-livestream-privacy-mode-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSoftLivestreamPrivacyModeEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SoftLivestreamPrivacyModeEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + : SubscribeAttribute("soft-livestream-privacy-mode-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSoftLivestreamPrivacyModeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SoftLivestreamPrivacyModeEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSoftLivestreamPrivacyModeEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SoftLivestreamPrivacyModeEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute HardPrivacyModeOn + */ +class ReadCameraAvStreamManagementHardPrivacyModeOn : public ReadAttribute { +public: + ReadCameraAvStreamManagementHardPrivacyModeOn() + : ReadAttribute("hard-privacy-mode-on") + { + } + + ~ReadCameraAvStreamManagementHardPrivacyModeOn() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyModeOn::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeHardPrivacyModeOnWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HardPrivacyModeOn response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement HardPrivacyModeOn read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementHardPrivacyModeOn : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementHardPrivacyModeOn() + : SubscribeAttribute("hard-privacy-mode-on") + { + } + + ~SubscribeAttributeCameraAvStreamManagementHardPrivacyModeOn() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::HardPrivacyModeOn::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeHardPrivacyModeOnWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.HardPrivacyModeOn response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NightVision + */ +class ReadCameraAvStreamManagementNightVision : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVision() + : ReadAttribute("night-vision") + { + } + + ~ReadCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementNightVision : public WriteAttribute { +public: + WriteCameraAvStreamManagementNightVision() + : WriteAttribute("night-vision") + { + AddArgument("attr-name", "night-vision"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeNightVisionWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement NightVision write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementNightVision : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVision() + : SubscribeAttribute("night-vision") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNightVisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NightVisionIllum + */ +class ReadCameraAvStreamManagementNightVisionIllum : public ReadAttribute { +public: + ReadCameraAvStreamManagementNightVisionIllum() + : ReadAttribute("night-vision-illum") + { + } + + ~ReadCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNightVisionIllumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionIllum response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement NightVisionIllum read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementNightVisionIllum : public WriteAttribute { +public: + WriteCameraAvStreamManagementNightVisionIllum() + : WriteAttribute("night-vision-illum") + { + AddArgument("attr-name", "night-vision-illum"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeNightVisionIllumWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement NightVisionIllum write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementNightVisionIllum : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementNightVisionIllum() + : SubscribeAttribute("night-vision-illum") + { + } + + ~SubscribeAttributeCameraAvStreamManagementNightVisionIllum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::NightVisionIllum::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeNightVisionIllumWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.NightVisionIllum response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AWBEnabled + */ +class ReadCameraAvStreamManagementAWBEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementAWBEnabled() + : ReadAttribute("awbenabled") + { + } + + ~ReadCameraAvStreamManagementAWBEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AWBEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAWBEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AWBEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AWBEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementAWBEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementAWBEnabled() + : WriteAttribute("awbenabled") + { + AddArgument("attr-name", "awbenabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementAWBEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AWBEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeAWBEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement AWBEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementAWBEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAWBEnabled() + : SubscribeAttribute("awbenabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAWBEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AWBEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAWBEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AWBEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AutoShutterSpeedEnabled + */ +class ReadCameraAvStreamManagementAutoShutterSpeedEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementAutoShutterSpeedEnabled() + : ReadAttribute("auto-shutter-speed-enabled") + { + } + + ~ReadCameraAvStreamManagementAutoShutterSpeedEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAutoShutterSpeedEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AutoShutterSpeedEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AutoShutterSpeedEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementAutoShutterSpeedEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementAutoShutterSpeedEnabled() + : WriteAttribute("auto-shutter-speed-enabled") + { + AddArgument("attr-name", "auto-shutter-speed-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementAutoShutterSpeedEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeAutoShutterSpeedEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement AutoShutterSpeedEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementAutoShutterSpeedEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAutoShutterSpeedEnabled() + : SubscribeAttribute("auto-shutter-speed-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAutoShutterSpeedEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoShutterSpeedEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAutoShutterSpeedEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AutoShutterSpeedEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AutoISOEnabled + */ +class ReadCameraAvStreamManagementAutoISOEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementAutoISOEnabled() + : ReadAttribute("auto-isoenabled") + { + } + + ~ReadCameraAvStreamManagementAutoISOEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoISOEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAutoISOEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AutoISOEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AutoISOEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementAutoISOEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementAutoISOEnabled() + : WriteAttribute("auto-isoenabled") + { + AddArgument("attr-name", "auto-isoenabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementAutoISOEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoISOEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeAutoISOEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement AutoISOEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementAutoISOEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAutoISOEnabled() + : SubscribeAttribute("auto-isoenabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAutoISOEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AutoISOEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAutoISOEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AutoISOEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Viewport + */ +class ReadCameraAvStreamManagementViewport : public ReadAttribute { +public: + ReadCameraAvStreamManagementViewport() + : ReadAttribute("viewport") + { + } + + ~ReadCameraAvStreamManagementViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeViewportWithCompletion:^(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.Viewport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement Viewport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementViewport : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementViewport() + : SubscribeAttribute("viewport") + { + } + + ~SubscribeAttributeCameraAvStreamManagementViewport() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::Viewport::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeViewportWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRCameraAVStreamManagementClusterViewportStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.Viewport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpeakerMuted + */ +class ReadCameraAvStreamManagementSpeakerMuted : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerMuted() + : ReadAttribute("speaker-muted") + { + } + + ~ReadCameraAvStreamManagementSpeakerMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerMutedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerMuted read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerMuted : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerMuted() + : WriteAttribute("speaker-muted") + { + AddArgument("attr-name", "speaker-muted"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeSpeakerMutedWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerMuted write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerMuted : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerMuted() + : SubscribeAttribute("speaker-muted") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpeakerMutedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpeakerVolumeLevel + */ +class ReadCameraAvStreamManagementSpeakerVolumeLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerVolumeLevel() + : ReadAttribute("speaker-volume-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerVolumeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerVolumeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerVolumeLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerVolumeLevel() + : WriteAttribute("speaker-volume-level") + { + AddArgument("attr-name", "speaker-volume-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerVolumeLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerVolumeLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel() + : SubscribeAttribute("speaker-volume-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpeakerVolumeLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpeakerMaxLevel + */ +class ReadCameraAvStreamManagementSpeakerMaxLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerMaxLevel() + : ReadAttribute("speaker-max-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerMaxLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerMaxLevel() + : WriteAttribute("speaker-max-level") + { + AddArgument("attr-name", "speaker-max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerMaxLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerMaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel() + : SubscribeAttribute("speaker-max-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpeakerMaxLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute SpeakerMinLevel + */ +class ReadCameraAvStreamManagementSpeakerMinLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementSpeakerMinLevel() + : ReadAttribute("speaker-min-level") + { + } + + ~ReadCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeSpeakerMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement SpeakerMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementSpeakerMinLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementSpeakerMinLevel() + : WriteAttribute("speaker-min-level") + { + AddArgument("attr-name", "speaker-min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeSpeakerMinLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement SpeakerMinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel() + : SubscribeAttribute("speaker-min-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementSpeakerMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::SpeakerMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeSpeakerMinLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.SpeakerMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneMuted + */ +class ReadCameraAvStreamManagementMicrophoneMuted : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneMuted() + : ReadAttribute("microphone-muted") + { + } + + ~ReadCameraAvStreamManagementMicrophoneMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneMutedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneMuted read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicrophoneMuted : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicrophoneMuted() + : WriteAttribute("microphone-muted") + { + AddArgument("attr-name", "microphone-muted"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicrophoneMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeMicrophoneMutedWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicrophoneMuted write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneMuted : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneMuted() + : SubscribeAttribute("microphone-muted") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneMuted() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMuted::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneMutedWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneVolumeLevel + */ +class ReadCameraAvStreamManagementMicrophoneVolumeLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneVolumeLevel() + : ReadAttribute("microphone-volume-level") + { + } + + ~ReadCameraAvStreamManagementMicrophoneVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneVolumeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneVolumeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicrophoneVolumeLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicrophoneVolumeLevel() + : WriteAttribute("microphone-volume-level") + { + AddArgument("attr-name", "microphone-volume-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicrophoneVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicrophoneVolumeLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicrophoneVolumeLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneVolumeLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneVolumeLevel() + : SubscribeAttribute("microphone-volume-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneVolumeLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneVolumeLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneVolumeLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneVolumeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneMaxLevel + */ +class ReadCameraAvStreamManagementMicrophoneMaxLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneMaxLevel() + : ReadAttribute("microphone-max-level") + { + } + + ~ReadCameraAvStreamManagementMicrophoneMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicrophoneMaxLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicrophoneMaxLevel() + : WriteAttribute("microphone-max-level") + { + AddArgument("attr-name", "microphone-max-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicrophoneMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicrophoneMaxLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicrophoneMaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneMaxLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneMaxLevel() + : SubscribeAttribute("microphone-max-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneMaxLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMaxLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneMaxLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneMinLevel + */ +class ReadCameraAvStreamManagementMicrophoneMinLevel : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneMinLevel() + : ReadAttribute("microphone-min-level") + { + } + + ~ReadCameraAvStreamManagementMicrophoneMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicrophoneMinLevel : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicrophoneMinLevel() + : WriteAttribute("microphone-min-level") + { + AddArgument("attr-name", "microphone-min-level"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicrophoneMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeMicrophoneMinLevelWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicrophoneMinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneMinLevel : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneMinLevel() + : SubscribeAttribute("microphone-min-level") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneMinLevel() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneMinLevel::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneMinLevelWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute MicrophoneAGCEnabled + */ +class ReadCameraAvStreamManagementMicrophoneAGCEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementMicrophoneAGCEnabled() + : ReadAttribute("microphone-agcenabled") + { + } + + ~ReadCameraAvStreamManagementMicrophoneAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeMicrophoneAGCEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneAGCEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement MicrophoneAGCEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementMicrophoneAGCEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementMicrophoneAGCEnabled() + : WriteAttribute("microphone-agcenabled") + { + AddArgument("attr-name", "microphone-agcenabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementMicrophoneAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeMicrophoneAGCEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement MicrophoneAGCEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementMicrophoneAGCEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementMicrophoneAGCEnabled() + : SubscribeAttribute("microphone-agcenabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementMicrophoneAGCEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::MicrophoneAGCEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeMicrophoneAGCEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.MicrophoneAGCEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ImageRotation + */ +class ReadCameraAvStreamManagementImageRotation : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageRotation() + : ReadAttribute("image-rotation") + { + } + + ~ReadCameraAvStreamManagementImageRotation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageRotationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageRotation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageRotation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageRotation : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageRotation() + : SubscribeAttribute("image-rotation") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageRotation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageRotation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeImageRotationWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageRotation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ImageFlipHorizontal + */ +class ReadCameraAvStreamManagementImageFlipHorizontal : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageFlipHorizontal() + : ReadAttribute("image-flip-horizontal") + { + } + + ~ReadCameraAvStreamManagementImageFlipHorizontal() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageFlipHorizontalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipHorizontal response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageFlipHorizontal read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal() + : SubscribeAttribute("image-flip-horizontal") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageFlipHorizontal() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipHorizontal::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeImageFlipHorizontalWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipHorizontal response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ImageFlipVertical + */ +class ReadCameraAvStreamManagementImageFlipVertical : public ReadAttribute { +public: + ReadCameraAvStreamManagementImageFlipVertical() + : ReadAttribute("image-flip-vertical") + { + } + + ~ReadCameraAvStreamManagementImageFlipVertical() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeImageFlipVerticalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipVertical response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ImageFlipVertical read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementImageFlipVertical : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementImageFlipVertical() + : SubscribeAttribute("image-flip-vertical") + { + } + + ~SubscribeAttributeCameraAvStreamManagementImageFlipVertical() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ImageFlipVertical::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeImageFlipVerticalWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ImageFlipVertical response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute LocalVideoRecordingEnabled + */ +class ReadCameraAvStreamManagementLocalVideoRecordingEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementLocalVideoRecordingEnabled() + : ReadAttribute("local-video-recording-enabled") + { + } + + ~ReadCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeLocalVideoRecordingEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalVideoRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement LocalVideoRecordingEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementLocalVideoRecordingEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementLocalVideoRecordingEnabled() + : WriteAttribute("local-video-recording-enabled") + { + AddArgument("attr-name", "local-video-recording-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeLocalVideoRecordingEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement LocalVideoRecordingEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled() + : SubscribeAttribute("local-video-recording-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementLocalVideoRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalVideoRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeLocalVideoRecordingEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalVideoRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute LocalSnapshotRecordingEnabled + */ +class ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : ReadAttribute("local-snapshot-recording-enabled") + { + } + + ~ReadCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeLocalSnapshotRecordingEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalSnapshotRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement LocalSnapshotRecordingEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : WriteAttribute("local-snapshot-recording-enabled") + { + AddArgument("attr-name", "local-snapshot-recording-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeLocalSnapshotRecordingEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement LocalSnapshotRecordingEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled() + : SubscribeAttribute("local-snapshot-recording-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementLocalSnapshotRecordingEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::LocalSnapshotRecordingEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeLocalSnapshotRecordingEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.LocalSnapshotRecordingEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute StatusLightEnabled + */ +class ReadCameraAvStreamManagementStatusLightEnabled : public ReadAttribute { +public: + ReadCameraAvStreamManagementStatusLightEnabled() + : ReadAttribute("status-light-enabled") + { + } + + ~ReadCameraAvStreamManagementStatusLightEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeStatusLightEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement StatusLightEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementStatusLightEnabled : public WriteAttribute { +public: + WriteCameraAvStreamManagementStatusLightEnabled() + : WriteAttribute("status-light-enabled") + { + AddArgument("attr-name", "status-light-enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementStatusLightEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeStatusLightEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement StatusLightEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementStatusLightEnabled : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementStatusLightEnabled() + : SubscribeAttribute("status-light-enabled") + { + } + + ~SubscribeAttributeCameraAvStreamManagementStatusLightEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightEnabled::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeStatusLightEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute StatusLightBrightness + */ +class ReadCameraAvStreamManagementStatusLightBrightness : public ReadAttribute { +public: + ReadCameraAvStreamManagementStatusLightBrightness() + : ReadAttribute("status-light-brightness") + { + } + + ~ReadCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeStatusLightBrightnessWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightBrightness response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement StatusLightBrightness read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementStatusLightBrightness : public WriteAttribute { +public: + WriteCameraAvStreamManagementStatusLightBrightness() + : WriteAttribute("status-light-brightness") + { + AddArgument("attr-name", "status-light-brightness"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeStatusLightBrightnessWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement StatusLightBrightness write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementStatusLightBrightness : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementStatusLightBrightness() + : SubscribeAttribute("status-light-brightness") + { + } + + ~SubscribeAttributeCameraAvStreamManagementStatusLightBrightness() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::StatusLightBrightness::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeStatusLightBrightnessWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.StatusLightBrightness response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute DepthSensorStatus + */ +class ReadCameraAvStreamManagementDepthSensorStatus : public ReadAttribute { +public: + ReadCameraAvStreamManagementDepthSensorStatus() + : ReadAttribute("depth-sensor-status") + { + } + + ~ReadCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeDepthSensorStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.DepthSensorStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement DepthSensorStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteCameraAvStreamManagementDepthSensorStatus : public WriteAttribute { +public: + WriteCameraAvStreamManagementDepthSensorStatus() + : WriteAttribute("depth-sensor-status") + { + AddArgument("attr-name", "depth-sensor-status"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeDepthSensorStatusWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("CameraAVStreamManagement DepthSensorStatus write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeCameraAvStreamManagementDepthSensorStatus : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementDepthSensorStatus() + : SubscribeAttribute("depth-sensor-status") + { + } + + ~SubscribeAttributeCameraAvStreamManagementDepthSensorStatus() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::DepthSensorStatus::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeDepthSensorStatusWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.DepthSensorStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadCameraAvStreamManagementGeneratedCommandList : public ReadAttribute { +public: + ReadCameraAvStreamManagementGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadCameraAvStreamManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadCameraAvStreamManagementAcceptedCommandList : public ReadAttribute { +public: + ReadCameraAvStreamManagementAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadCameraAvStreamManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadCameraAvStreamManagementEventList : public ReadAttribute { +public: + ReadCameraAvStreamManagementEventList() + : ReadAttribute("event-list") + { + } + + ~ReadCameraAvStreamManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementEventList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadCameraAvStreamManagementAttributeList : public ReadAttribute { +public: + ReadCameraAvStreamManagementAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadCameraAvStreamManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeCameraAvStreamManagementAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadCameraAvStreamManagementFeatureMap : public ReadAttribute { +public: + ReadCameraAvStreamManagementFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadCameraAvStreamManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeCameraAvStreamManagementFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadCameraAvStreamManagementClusterRevision : public ReadAttribute { +public: + ReadCameraAvStreamManagementClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadCameraAvStreamManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("CameraAVStreamManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeCameraAvStreamManagementClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeCameraAvStreamManagementClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeCameraAvStreamManagementClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::CameraAvStreamManagement::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::CameraAvStreamManagement::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterCameraAVStreamManagement alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"CameraAVStreamManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster WebRTCTransportProvider | 0x0553 | +|------------------------------------------------------------------------------| +| Commands: | | +| * SolicitOffer | 0x01 | +| * ProvideOffer | 0x03 | +| * ProvideAnswer | 0x05 | +| * ProvideICECandidate | 0x06 | +| * EndSession | 0x07 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentSessions | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command SolicitOffer + */ +class WebRTCTransportProviderSolicitOffer : public ClusterCommand { +public: + WebRTCTransportProviderSolicitOffer() + : ClusterCommand("solicit-offer") + , mComplex_ICEServers(&mRequest.ICEServers) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICEServers", &mComplex_ICEServers); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterSolicitOfferParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.videoStreamID.HasValue()) { + if (mRequest.videoStreamID.Value().IsNull()) { + params.videoStreamID = nil; + } else { + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID.Value().Value()]; + } + } else { + params.videoStreamID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.audioStreamID.HasValue()) { + if (mRequest.audioStreamID.Value().IsNull()) { + params.audioStreamID = nil; + } else { + params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID.Value().Value()]; + } + } else { + params.audioStreamID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICEServers.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.ICEServers.Value()) { + MTRWebRTCTransportProviderClusterICEServerStruct * newElement_1; + newElement_1 = [MTRWebRTCTransportProviderClusterICEServerStruct new]; + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_1.urls) { + NSString * newElement_3; + newElement_3 = [[NSString alloc] initWithBytes:entry_3.data() length:entry_3.size() encoding:NSUTF8StringEncoding]; + [array_3 addObject:newElement_3]; + } + newElement_1.urls = array_3; + } + if (entry_1.username.HasValue()) { + newElement_1.username = [[NSString alloc] initWithBytes:entry_1.username.Value().data() length:entry_1.username.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.username = nil; + } + if (entry_1.credential.HasValue()) { + newElement_1.credential = [[NSString alloc] initWithBytes:entry_1.credential.Value().data() length:entry_1.credential.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.credential = nil; + } + if (entry_1.caid.HasValue()) { + newElement_1.caid = [NSNumber numberWithUnsignedShort:entry_1.caid.Value()]; + } else { + newElement_1.caid = nil; + } + [array_1 addObject:newElement_1]; + } + params.iceServers = array_1; + } + } else { + params.iceServers = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICETransportPolicy.HasValue()) { + params.iceTransportPolicy = [[NSString alloc] initWithBytes:mRequest.ICETransportPolicy.Value().data() length:mRequest.ICETransportPolicy.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.iceTransportPolicy = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.metadataOptions.HasValue()) { + params.metadataOptions = [NSNumber numberWithUnsignedChar:mRequest.metadataOptions.Value().Raw()]; + } else { + params.metadataOptions = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster solicitOfferWithParams:params completion: + ^(MTRWebRTCTransportProviderClusterSolicitOfferResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOfferResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::SolicitOffer::Type mRequest; + TypedComplexArgument>> mComplex_ICEServers; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ProvideOffer + */ +class WebRTCTransportProviderProvideOffer : public ClusterCommand { +public: + WebRTCTransportProviderProvideOffer() + : ClusterCommand("provide-offer") + , mComplex_ICEServers(&mRequest.ICEServers) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Sdp", &mRequest.sdp); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("StreamType", 0, UINT8_MAX, &mRequest.streamType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("VideoStreamID", 0, UINT16_MAX, &mRequest.videoStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AudioStreamID", 0, UINT16_MAX, &mRequest.audioStreamID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICEServers", &mComplex_ICEServers); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("MetadataOptions", 0, UINT8_MAX, &mRequest.metadataOptions); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideOfferParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + if (mRequest.webRTCSessionID.IsNull()) { + params.webRTCSessionID = nil; + } else { + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID.Value()]; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.streamType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.streamType)]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.videoStreamID.HasValue()) { + if (mRequest.videoStreamID.Value().IsNull()) { + params.videoStreamID = nil; + } else { + params.videoStreamID = [NSNumber numberWithUnsignedShort:mRequest.videoStreamID.Value().Value()]; + } + } else { + params.videoStreamID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.audioStreamID.HasValue()) { + if (mRequest.audioStreamID.Value().IsNull()) { + params.audioStreamID = nil; + } else { + params.audioStreamID = [NSNumber numberWithUnsignedShort:mRequest.audioStreamID.Value().Value()]; + } + } else { + params.audioStreamID = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICEServers.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.ICEServers.Value()) { + MTRWebRTCTransportProviderClusterICEServerStruct * newElement_1; + newElement_1 = [MTRWebRTCTransportProviderClusterICEServerStruct new]; + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + for (auto & entry_3 : entry_1.urls) { + NSString * newElement_3; + newElement_3 = [[NSString alloc] initWithBytes:entry_3.data() length:entry_3.size() encoding:NSUTF8StringEncoding]; + [array_3 addObject:newElement_3]; + } + newElement_1.urls = array_3; + } + if (entry_1.username.HasValue()) { + newElement_1.username = [[NSString alloc] initWithBytes:entry_1.username.Value().data() length:entry_1.username.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.username = nil; + } + if (entry_1.credential.HasValue()) { + newElement_1.credential = [[NSString alloc] initWithBytes:entry_1.credential.Value().data() length:entry_1.credential.Value().size() encoding:NSUTF8StringEncoding]; + } else { + newElement_1.credential = nil; + } + if (entry_1.caid.HasValue()) { + newElement_1.caid = [NSNumber numberWithUnsignedShort:entry_1.caid.Value()]; + } else { + newElement_1.caid = nil; + } + [array_1 addObject:newElement_1]; + } + params.iceServers = array_1; + } + } else { + params.iceServers = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICETransportPolicy.HasValue()) { + params.iceTransportPolicy = [[NSString alloc] initWithBytes:mRequest.ICETransportPolicy.Value().data() length:mRequest.ICETransportPolicy.Value().size() encoding:NSUTF8StringEncoding]; + } else { + params.iceTransportPolicy = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.metadataOptions.HasValue()) { + params.metadataOptions = [NSNumber numberWithUnsignedChar:mRequest.metadataOptions.Value().Raw()]; + } else { + params.metadataOptions = nil; + } +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster provideOfferWithParams:params completion: + ^(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type mRequest; + TypedComplexArgument>> mComplex_ICEServers; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ProvideAnswer + */ +class WebRTCTransportProviderProvideAnswer : public ClusterCommand { +public: + WebRTCTransportProviderProvideAnswer() + : ClusterCommand("provide-answer") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Sdp", &mRequest.sdp); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster provideAnswerWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command ProvideICECandidate + */ +class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { +public: + WebRTCTransportProviderProvideICECandidate() + : ClusterCommand("provide-icecandidate") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICECandidate", &mRequest.ICECandidate); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.iceCandidate = [[NSString alloc] initWithBytes:mRequest.ICECandidate.data() length:mRequest.ICECandidate.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster provideICECandidateWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command EndSession + */ +class WebRTCTransportProviderEndSession : public ClusterCommand { +public: + WebRTCTransportProviderEndSession() + : ClusterCommand("end-session") + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Reason", 0, UINT8_MAX, &mRequest.reason); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportProviderClusterEndSessionParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.reason = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.reason)]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster endSessionWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute CurrentSessions + */ +class ReadWebRTCTransportProviderCurrentSessions : public ReadAttribute { +public: + ReadWebRTCTransportProviderCurrentSessions() + : ReadAttribute("current-sessions") + { + } + + ~ReadWebRTCTransportProviderCurrentSessions() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::CurrentSessions::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeCurrentSessionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.CurrentSessions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider CurrentSessions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderCurrentSessions : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderCurrentSessions() + : SubscribeAttribute("current-sessions") + { + } + + ~SubscribeAttributeWebRTCTransportProviderCurrentSessions() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::CurrentSessions::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeCurrentSessionsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.CurrentSessions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadWebRTCTransportProviderGeneratedCommandList : public ReadAttribute { +public: + ReadWebRTCTransportProviderGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadWebRTCTransportProviderGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeWebRTCTransportProviderGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadWebRTCTransportProviderAcceptedCommandList : public ReadAttribute { +public: + ReadWebRTCTransportProviderAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadWebRTCTransportProviderAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeWebRTCTransportProviderAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadWebRTCTransportProviderEventList : public ReadAttribute { +public: + ReadWebRTCTransportProviderEventList() + : ReadAttribute("event-list") + { + } + + ~ReadWebRTCTransportProviderEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderEventList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeWebRTCTransportProviderEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadWebRTCTransportProviderAttributeList : public ReadAttribute { +public: + ReadWebRTCTransportProviderAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadWebRTCTransportProviderAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeWebRTCTransportProviderAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadWebRTCTransportProviderFeatureMap : public ReadAttribute { +public: + ReadWebRTCTransportProviderFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadWebRTCTransportProviderFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeWebRTCTransportProviderFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadWebRTCTransportProviderClusterRevision : public ReadAttribute { +public: + ReadWebRTCTransportProviderClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadWebRTCTransportProviderClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("WebRTCTransportProvider ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeWebRTCTransportProviderClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeWebRTCTransportProviderClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeWebRTCTransportProviderClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"WebRTCTransportProvider.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster WebRTCTransportRequestor | 0x0554 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Offer | 0x01 | +| * Answer | 0x02 | +| * ICECandidate | 0x03 | +| * End | 0x04 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * CurrentSessions | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command Offer + */ +class WebRTCTransportRequestorOffer : public ClusterCommand { +public: + WebRTCTransportRequestorOffer() + : ClusterCommand("offer") + , mComplex_ICEServers(&mRequest.ICEServers) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Sdp", &mRequest.sdp); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICEServers", &mComplex_ICEServers); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("ICETransportPolicy", &mRequest.ICETransportPolicy); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterOfferParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.sdp = [[NSString alloc] initWithBytes:mRequest.sdp.data() length:mRequest.sdp.size() encoding:NSUTF8StringEncoding]; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + if (mRequest.ICEServers.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + for (auto & entry_1 : mRequest.ICEServers.Value()) { + MTRWebRTCTransportRequestorClusterICEServerStruct * newElement_1; + newElement_1 = [MTRWebRTCTransportRequestorClusterICEServerStruct new]; { // Scope for our temporary variables auto * array_3 = [NSMutableArray new]; for (auto & entry_3 : entry_1.urls) { @@ -160334,30 +169057,17 @@ class WebRTCTransportProviderProvideOffer : public ClusterCommand { } else { params.iceTransportPolicy = nil; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - if (mRequest.metadataOptions.HasValue()) { - params.metadataOptions = [NSNumber numberWithUnsignedChar:mRequest.metadataOptions.Value().Raw()]; - } else { - params.metadataOptions = nil; - } #endif // MTR_ENABLE_PROVISIONAL uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster provideOfferWithParams:params completion: - ^(MTRWebRTCTransportProviderClusterProvideOfferResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - if (error == nil) { - constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::Id; - RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); - } + [cluster offerWithParams:params completion: + ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); - constexpr chip::CommandId responseId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOfferResponse::Id; - RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -160368,19 +169078,19 @@ class WebRTCTransportProviderProvideOffer : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideOffer::Type mRequest; - TypedComplexArgument>> mComplex_ICEServers; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Offer::Type mRequest; + TypedComplexArgument>> mComplex_ICEServers; }; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command ProvideAnswer + * Command Answer */ -class WebRTCTransportProviderProvideAnswer : public ClusterCommand { +class WebRTCTransportRequestorAnswer : public ClusterCommand { public: - WebRTCTransportProviderProvideAnswer() - : ClusterCommand("provide-answer") + WebRTCTransportRequestorAnswer() + : ClusterCommand("answer") { #if MTR_ENABLE_PROVISIONAL AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); @@ -160393,14 +169103,14 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideAnswerParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterAnswerParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; @@ -160411,7 +169121,7 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster provideAnswerWithParams:params completion: + [cluster answerWithParams:params completion: ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { @@ -160428,18 +169138,18 @@ class WebRTCTransportProviderProvideAnswer : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideAnswer::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::Answer::Type mRequest; }; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command ProvideICECandidate + * Command ICECandidate */ -class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { +class WebRTCTransportRequestorICECandidate : public ClusterCommand { public: - WebRTCTransportProviderProvideICECandidate() - : ClusterCommand("provide-icecandidate") + WebRTCTransportRequestorICECandidate() + : ClusterCommand("icecandidate") { #if MTR_ENABLE_PROVISIONAL AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); @@ -160452,14 +169162,14 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterProvideICECandidateParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterICECandidateParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; @@ -160470,7 +169180,7 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster provideICECandidateWithParams:params completion: + [cluster ICECandidateWithParams:params completion: ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { @@ -160487,18 +169197,18 @@ class WebRTCTransportProviderProvideICECandidate : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::ProvideICECandidate::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::ICECandidate::Type mRequest; }; #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command EndSession + * Command End */ -class WebRTCTransportProviderEndSession : public ClusterCommand { +class WebRTCTransportRequestorEnd : public ClusterCommand { public: - WebRTCTransportProviderEndSession() - : ClusterCommand("end-session") + WebRTCTransportRequestorEnd() + : ClusterCommand("end") { #if MTR_ENABLE_PROVISIONAL AddArgument("WebRTCSessionID", 0, UINT16_MAX, &mRequest.webRTCSessionID); @@ -160511,14 +169221,14 @@ class WebRTCTransportProviderEndSession : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWebRTCTransportProviderClusterEndSessionParams alloc] init]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWebRTCTransportRequestorClusterEndParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL params.webRTCSessionID = [NSNumber numberWithUnsignedShort:mRequest.webRTCSessionID]; @@ -160529,7 +169239,7 @@ class WebRTCTransportProviderEndSession : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster endSessionWithParams:params completion: + [cluster endWithParams:params completion: ^(NSError * _Nullable error) { responsesNeeded--; if (error != nil) { @@ -160546,7 +169256,7 @@ class WebRTCTransportProviderEndSession : public ClusterCommand { } private: - chip::app::Clusters::WebRTCTransportProvider::Commands::EndSession::Type mRequest; + chip::app::Clusters::WebRTCTransportRequestor::Commands::End::Type mRequest; }; #endif // MTR_ENABLE_PROVISIONAL @@ -160556,32 +169266,32 @@ class WebRTCTransportProviderEndSession : public ClusterCommand { /* * Attribute CurrentSessions */ -class ReadWebRTCTransportProviderCurrentSessions : public ReadAttribute { +class ReadWebRTCTransportRequestorCurrentSessions : public ReadAttribute { public: - ReadWebRTCTransportProviderCurrentSessions() + ReadWebRTCTransportRequestorCurrentSessions() : ReadAttribute("current-sessions") { } - ~ReadWebRTCTransportProviderCurrentSessions() + ~ReadWebRTCTransportRequestorCurrentSessions() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::CurrentSessions::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentSessionsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.CurrentSessions response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.CurrentSessions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider CurrentSessions read Error", error); + LogNSError("WebRTCTransportRequestor CurrentSessions read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160590,25 +169300,25 @@ class ReadWebRTCTransportProviderCurrentSessions : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderCurrentSessions : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorCurrentSessions : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderCurrentSessions() + SubscribeAttributeWebRTCTransportRequestorCurrentSessions() : SubscribeAttribute("current-sessions") { } - ~SubscribeAttributeWebRTCTransportProviderCurrentSessions() + ~SubscribeAttributeWebRTCTransportRequestorCurrentSessions() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::CurrentSessions::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::CurrentSessions::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -160622,7 +169332,7 @@ class SubscribeAttributeWebRTCTransportProviderCurrentSessions : public Subscrib [cluster subscribeAttributeCurrentSessionsWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.CurrentSessions response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.CurrentSessions response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -160641,32 +169351,32 @@ class SubscribeAttributeWebRTCTransportProviderCurrentSessions : public Subscrib /* * Attribute GeneratedCommandList */ -class ReadWebRTCTransportProviderGeneratedCommandList : public ReadAttribute { +class ReadWebRTCTransportRequestorGeneratedCommandList : public ReadAttribute { public: - ReadWebRTCTransportProviderGeneratedCommandList() + ReadWebRTCTransportRequestorGeneratedCommandList() : ReadAttribute("generated-command-list") { } - ~ReadWebRTCTransportProviderGeneratedCommandList() + ~ReadWebRTCTransportRequestorGeneratedCommandList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::GeneratedCommandList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.GeneratedCommandList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.GeneratedCommandList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider GeneratedCommandList read Error", error); + LogNSError("WebRTCTransportRequestor GeneratedCommandList read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160675,25 +169385,25 @@ class ReadWebRTCTransportProviderGeneratedCommandList : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderGeneratedCommandList : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderGeneratedCommandList() + SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList() : SubscribeAttribute("generated-command-list") { } - ~SubscribeAttributeWebRTCTransportProviderGeneratedCommandList() + ~SubscribeAttributeWebRTCTransportRequestorGeneratedCommandList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::GeneratedCommandList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::GeneratedCommandList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -160707,7 +169417,7 @@ class SubscribeAttributeWebRTCTransportProviderGeneratedCommandList : public Sub [cluster subscribeAttributeGeneratedCommandListWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.GeneratedCommandList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.GeneratedCommandList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -160726,32 +169436,32 @@ class SubscribeAttributeWebRTCTransportProviderGeneratedCommandList : public Sub /* * Attribute AcceptedCommandList */ -class ReadWebRTCTransportProviderAcceptedCommandList : public ReadAttribute { +class ReadWebRTCTransportRequestorAcceptedCommandList : public ReadAttribute { public: - ReadWebRTCTransportProviderAcceptedCommandList() + ReadWebRTCTransportRequestorAcceptedCommandList() : ReadAttribute("accepted-command-list") { } - ~ReadWebRTCTransportProviderAcceptedCommandList() + ~ReadWebRTCTransportRequestorAcceptedCommandList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AcceptedCommandList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.AcceptedCommandList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.AcceptedCommandList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider AcceptedCommandList read Error", error); + LogNSError("WebRTCTransportRequestor AcceptedCommandList read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160760,25 +169470,25 @@ class ReadWebRTCTransportProviderAcceptedCommandList : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderAcceptedCommandList : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderAcceptedCommandList() + SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList() : SubscribeAttribute("accepted-command-list") { } - ~SubscribeAttributeWebRTCTransportProviderAcceptedCommandList() + ~SubscribeAttributeWebRTCTransportRequestorAcceptedCommandList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AcceptedCommandList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AcceptedCommandList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -160792,7 +169502,7 @@ class SubscribeAttributeWebRTCTransportProviderAcceptedCommandList : public Subs [cluster subscribeAttributeAcceptedCommandListWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.AcceptedCommandList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.AcceptedCommandList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -160811,32 +169521,32 @@ class SubscribeAttributeWebRTCTransportProviderAcceptedCommandList : public Subs /* * Attribute EventList */ -class ReadWebRTCTransportProviderEventList : public ReadAttribute { +class ReadWebRTCTransportRequestorEventList : public ReadAttribute { public: - ReadWebRTCTransportProviderEventList() + ReadWebRTCTransportRequestorEventList() : ReadAttribute("event-list") { } - ~ReadWebRTCTransportProviderEventList() + ~ReadWebRTCTransportRequestorEventList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::EventList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.EventList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.EventList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider EventList read Error", error); + LogNSError("WebRTCTransportRequestor EventList read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160845,25 +169555,25 @@ class ReadWebRTCTransportProviderEventList : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderEventList : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorEventList : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderEventList() + SubscribeAttributeWebRTCTransportRequestorEventList() : SubscribeAttribute("event-list") { } - ~SubscribeAttributeWebRTCTransportProviderEventList() + ~SubscribeAttributeWebRTCTransportRequestorEventList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::EventList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::EventList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -160877,7 +169587,7 @@ class SubscribeAttributeWebRTCTransportProviderEventList : public SubscribeAttri [cluster subscribeAttributeEventListWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.EventList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.EventList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -160896,32 +169606,32 @@ class SubscribeAttributeWebRTCTransportProviderEventList : public SubscribeAttri /* * Attribute AttributeList */ -class ReadWebRTCTransportProviderAttributeList : public ReadAttribute { +class ReadWebRTCTransportRequestorAttributeList : public ReadAttribute { public: - ReadWebRTCTransportProviderAttributeList() + ReadWebRTCTransportRequestorAttributeList() : ReadAttribute("attribute-list") { } - ~ReadWebRTCTransportProviderAttributeList() + ~ReadWebRTCTransportRequestorAttributeList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AttributeList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.AttributeList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.AttributeList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider AttributeList read Error", error); + LogNSError("WebRTCTransportRequestor AttributeList read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160930,25 +169640,25 @@ class ReadWebRTCTransportProviderAttributeList : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderAttributeList : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorAttributeList : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderAttributeList() + SubscribeAttributeWebRTCTransportRequestorAttributeList() : SubscribeAttribute("attribute-list") { } - ~SubscribeAttributeWebRTCTransportProviderAttributeList() + ~SubscribeAttributeWebRTCTransportRequestorAttributeList() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::AttributeList::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::AttributeList::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -160962,7 +169672,7 @@ class SubscribeAttributeWebRTCTransportProviderAttributeList : public SubscribeA [cluster subscribeAttributeAttributeListWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.AttributeList response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.AttributeList response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -160981,32 +169691,32 @@ class SubscribeAttributeWebRTCTransportProviderAttributeList : public SubscribeA /* * Attribute FeatureMap */ -class ReadWebRTCTransportProviderFeatureMap : public ReadAttribute { +class ReadWebRTCTransportRequestorFeatureMap : public ReadAttribute { public: - ReadWebRTCTransportProviderFeatureMap() + ReadWebRTCTransportRequestorFeatureMap() : ReadAttribute("feature-map") { } - ~ReadWebRTCTransportProviderFeatureMap() + ~ReadWebRTCTransportRequestorFeatureMap() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::FeatureMap::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.FeatureMap response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.FeatureMap response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider FeatureMap read Error", error); + LogNSError("WebRTCTransportRequestor FeatureMap read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -161015,25 +169725,25 @@ class ReadWebRTCTransportProviderFeatureMap : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderFeatureMap : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorFeatureMap : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderFeatureMap() + SubscribeAttributeWebRTCTransportRequestorFeatureMap() : SubscribeAttribute("feature-map") { } - ~SubscribeAttributeWebRTCTransportProviderFeatureMap() + ~SubscribeAttributeWebRTCTransportRequestorFeatureMap() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::FeatureMap::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::FeatureMap::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -161047,7 +169757,7 @@ class SubscribeAttributeWebRTCTransportProviderFeatureMap : public SubscribeAttr [cluster subscribeAttributeFeatureMapWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.FeatureMap response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.FeatureMap response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -161066,32 +169776,32 @@ class SubscribeAttributeWebRTCTransportProviderFeatureMap : public SubscribeAttr /* * Attribute ClusterRevision */ -class ReadWebRTCTransportProviderClusterRevision : public ReadAttribute { +class ReadWebRTCTransportRequestorClusterRevision : public ReadAttribute { public: - ReadWebRTCTransportProviderClusterRevision() + ReadWebRTCTransportRequestorClusterRevision() : ReadAttribute("cluster-revision") { } - ~ReadWebRTCTransportProviderClusterRevision() + ~ReadWebRTCTransportRequestorClusterRevision() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::ClusterRevision::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.ClusterRevision response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.ClusterRevision response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("WebRTCTransportProvider ClusterRevision read Error", error); + LogNSError("WebRTCTransportRequestor ClusterRevision read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -161100,25 +169810,25 @@ class ReadWebRTCTransportProviderClusterRevision : public ReadAttribute { } }; -class SubscribeAttributeWebRTCTransportProviderClusterRevision : public SubscribeAttribute { +class SubscribeAttributeWebRTCTransportRequestorClusterRevision : public SubscribeAttribute { public: - SubscribeAttributeWebRTCTransportProviderClusterRevision() + SubscribeAttributeWebRTCTransportRequestorClusterRevision() : SubscribeAttribute("cluster-revision") { } - ~SubscribeAttributeWebRTCTransportProviderClusterRevision() + ~SubscribeAttributeWebRTCTransportRequestorClusterRevision() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportProvider::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportProvider::Attributes::ClusterRevision::Id; + constexpr chip::ClusterId clusterId = chip::app::Clusters::WebRTCTransportRequestor::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::WebRTCTransportRequestor::Attributes::ClusterRevision::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWebRTCTransportProvider alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWebRTCTransportRequestor alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; if (mKeepSubscriptions.HasValue()) { params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); @@ -161132,7 +169842,7 @@ class SubscribeAttributeWebRTCTransportProviderClusterRevision : public Subscrib [cluster subscribeAttributeClusterRevisionWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WebRTCTransportProvider.ClusterRevision response %@", [value description]); + NSLog(@"WebRTCTransportRequestor.ClusterRevision response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -179202,6 +187912,10 @@ void registerClusterGeneralCommissioning(Commands & commands) #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // @@ -185051,6 +193765,372 @@ void registerClusterContentAppObserver(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterZoneManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::ZoneManagement; + + const char * clusterName = "ZoneManagement"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} +void registerClusterCameraAvStreamManagement(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::CameraAvStreamManagement; + + const char * clusterName = "CameraAvStreamManagement"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterWebRTCTransportProvider(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -185111,6 +194191,63 @@ void registerClusterWebRTCTransportProvider(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterWebRTCTransportRequestor(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::WebRTCTransportRequestor; + + const char * clusterName = "WebRTCTransportRequestor"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterChime(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -185809,7 +194946,10 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterContentControl(commands); registerClusterContentAppObserver(commands); + registerClusterZoneManagement(commands); + registerClusterCameraAvStreamManagement(commands); registerClusterWebRTCTransportProvider(commands); + registerClusterWebRTCTransportRequestor(commands); registerClusterChime(commands); registerClusterEcosystemInformation(commands); registerClusterCommissionerControl(commands);